123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854 |
- (self["webpackChunkGrav"] = self["webpackChunkGrav"] || []).push([[736],{
- /***/ 26981:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- __webpack_require__(11983);
- var _global = _interopRequireDefault(__webpack_require__(40115));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
- if (_global["default"]._babelPolyfill && typeof console !== "undefined" && console.warn) {
- console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended " + "and may have consequences if different versions of the polyfills are applied sequentially. " + "If you do need to load the polyfill more than once, use @babel/polyfill/noConflict " + "instead to bypass the warning.");
- }
- _global["default"]._babelPolyfill = true;
- /***/ }),
- /***/ 11983:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- __webpack_require__(16266);
- __webpack_require__(10990);
- __webpack_require__(70911);
- __webpack_require__(14160);
- __webpack_require__(6197);
- __webpack_require__(96728);
- __webpack_require__(54039);
- __webpack_require__(93568);
- __webpack_require__(78051);
- __webpack_require__(38250);
- __webpack_require__(15434);
- __webpack_require__(54952);
- __webpack_require__(96337);
- __webpack_require__(35666);
- /***/ }),
- /***/ 69259:
- /***/ (function(module, exports, __webpack_require__) {
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) {
- if (true) {
- // AMD. Register as an anonymous module unless amdModuleId is set
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
- return (root['Chartist'] = factory());
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
- }(this, function () {
- /* Chartist.js 0.11.4
- * Copyright © 2019 Gion Kunz
- * Free to use under either the WTFPL license or the MIT license.
- * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL
- * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT
- */
- /**
- * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules.
- *
- * @module Chartist.Core
- */
- var Chartist = {
- version: '0.11.4'
- };
- (function (globalRoot, Chartist) {
- 'use strict';
- var window = globalRoot.window;
- var document = globalRoot.document;
- /**
- * This object contains all namespaces used within Chartist.
- *
- * @memberof Chartist.Core
- * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}}
- */
- Chartist.namespaces = {
- svg: 'http://www.w3.org/2000/svg',
- xmlns: 'http://www.w3.org/2000/xmlns/',
- xhtml: 'http://www.w3.org/1999/xhtml',
- xlink: 'http://www.w3.org/1999/xlink',
- ct: 'http://gionkunz.github.com/chartist-js/ct'
- };
- /**
- * Helps to simplify functional style code
- *
- * @memberof Chartist.Core
- * @param {*} n This exact value will be returned by the noop function
- * @return {*} The same value that was provided to the n parameter
- */
- Chartist.noop = function (n) {
- return n;
- };
- /**
- * Generates a-z from a number 0 to 26
- *
- * @memberof Chartist.Core
- * @param {Number} n A number from 0 to 26 that will result in a letter a-z
- * @return {String} A character from a-z based on the input number n
- */
- Chartist.alphaNumerate = function (n) {
- // Limit to a-z
- return String.fromCharCode(97 + n % 26);
- };
- /**
- * Simple recursive object extend
- *
- * @memberof Chartist.Core
- * @param {Object} target Target object where the source will be merged into
- * @param {Object...} sources This object (objects) will be merged into target and then target is returned
- * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source
- */
- Chartist.extend = function (target) {
- var i, source, sourceProp;
- target = target || {};
- for (i = 1; i < arguments.length; i++) {
- source = arguments[i];
- for (var prop in source) {
- sourceProp = source[prop];
- if (typeof sourceProp === 'object' && sourceProp !== null && !(sourceProp instanceof Array)) {
- target[prop] = Chartist.extend(target[prop], sourceProp);
- } else {
- target[prop] = sourceProp;
- }
- }
- }
- return target;
- };
- /**
- * Replaces all occurrences of subStr in str with newSubStr and returns a new string.
- *
- * @memberof Chartist.Core
- * @param {String} str
- * @param {String} subStr
- * @param {String} newSubStr
- * @return {String}
- */
- Chartist.replaceAll = function(str, subStr, newSubStr) {
- return str.replace(new RegExp(subStr, 'g'), newSubStr);
- };
- /**
- * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.
- *
- * @memberof Chartist.Core
- * @param {Number} value
- * @param {String} unit
- * @return {String} Returns the passed number value with unit.
- */
- Chartist.ensureUnit = function(value, unit) {
- if(typeof value === 'number') {
- value = value + unit;
- }
- return value;
- };
- /**
- * Converts a number or string to a quantity object.
- *
- * @memberof Chartist.Core
- * @param {String|Number} input
- * @return {Object} Returns an object containing the value as number and the unit as string.
- */
- Chartist.quantity = function(input) {
- if (typeof input === 'string') {
- var match = (/^(\d+)\s*(.*)$/g).exec(input);
- return {
- value : +match[1],
- unit: match[2] || undefined
- };
- }
- return { value: input };
- };
- /**
- * This is a wrapper around document.querySelector that will return the query if it's already of type Node
- *
- * @memberof Chartist.Core
- * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly
- * @return {Node}
- */
- Chartist.querySelector = function(query) {
- return query instanceof Node ? query : document.querySelector(query);
- };
- /**
- * Functional style helper to produce array with given length initialized with undefined values
- *
- * @memberof Chartist.Core
- * @param length
- * @return {Array}
- */
- Chartist.times = function(length) {
- return Array.apply(null, new Array(length));
- };
- /**
- * Sum helper to be used in reduce functions
- *
- * @memberof Chartist.Core
- * @param previous
- * @param current
- * @return {*}
- */
- Chartist.sum = function(previous, current) {
- return previous + (current ? current : 0);
- };
- /**
- * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor.
- *
- * @memberof Chartist.Core
- * @param {Number} factor
- * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array
- */
- Chartist.mapMultiply = function(factor) {
- return function(num) {
- return num * factor;
- };
- };
- /**
- * Add helper to be used in `Array.map` for adding a addend to each value of an array.
- *
- * @memberof Chartist.Core
- * @param {Number} addend
- * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array
- */
- Chartist.mapAdd = function(addend) {
- return function(num) {
- return num + addend;
- };
- };
- /**
- * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values).
- *
- * @memberof Chartist.Core
- * @param arr
- * @param cb
- * @return {Array}
- */
- Chartist.serialMap = function(arr, cb) {
- var result = [],
- length = Math.max.apply(null, arr.map(function(e) {
- return e.length;
- }));
- Chartist.times(length).forEach(function(e, index) {
- var args = arr.map(function(e) {
- return e[index];
- });
- result[index] = cb.apply(null, args);
- });
- return result;
- };
- /**
- * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.
- *
- * @memberof Chartist.Core
- * @param {Number} value The value that should be rounded with precision
- * @param {Number} [digits] The number of digits after decimal used to do the rounding
- * @returns {number} Rounded value
- */
- Chartist.roundWithPrecision = function(value, digits) {
- var precision = Math.pow(10, digits || Chartist.precision);
- return Math.round(value * precision) / precision;
- };
- /**
- * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.
- *
- * @memberof Chartist.Core
- * @type {number}
- */
- Chartist.precision = 8;
- /**
- * A map with characters to escape for strings to be safely used as attribute values.
- *
- * @memberof Chartist.Core
- * @type {Object}
- */
- Chartist.escapingMap = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- '\'': '''
- };
- /**
- * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.
- * If called with null or undefined the function will return immediately with null or undefined.
- *
- * @memberof Chartist.Core
- * @param {Number|String|Object} data
- * @return {String}
- */
- Chartist.serialize = function(data) {
- if(data === null || data === undefined) {
- return data;
- } else if(typeof data === 'number') {
- data = ''+data;
- } else if(typeof data === 'object') {
- data = JSON.stringify({data: data});
- }
- return Object.keys(Chartist.escapingMap).reduce(function(result, key) {
- return Chartist.replaceAll(result, key, Chartist.escapingMap[key]);
- }, data);
- };
- /**
- * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.
- *
- * @memberof Chartist.Core
- * @param {String} data
- * @return {String|Number|Object}
- */
- Chartist.deserialize = function(data) {
- if(typeof data !== 'string') {
- return data;
- }
- data = Object.keys(Chartist.escapingMap).reduce(function(result, key) {
- return Chartist.replaceAll(result, Chartist.escapingMap[key], key);
- }, data);
- try {
- data = JSON.parse(data);
- data = data.data !== undefined ? data.data : data;
- } catch(e) {}
- return data;
- };
- /**
- * Create or reinitialize the SVG element for the chart
- *
- * @memberof Chartist.Core
- * @param {Node} container The containing DOM Node object that will be used to plant the SVG element
- * @param {String} width Set the width of the SVG element. Default is 100%
- * @param {String} height Set the height of the SVG element. Default is 100%
- * @param {String} className Specify a class to be added to the SVG element
- * @return {Object} The created/reinitialized SVG element
- */
- Chartist.createSvg = function (container, width, height, className) {
- var svg;
- width = width || '100%';
- height = height || '100%';
- // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it
- // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/
- Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) {
- return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct');
- }).forEach(function removePreviousElement(svg) {
- container.removeChild(svg);
- });
- // Create svg object with width and height or use 100% as default
- svg = new Chartist.Svg('svg').attr({
- width: width,
- height: height
- }).addClass(className);
- svg._node.style.width = width;
- svg._node.style.height = height;
- // Add the DOM node to our container
- container.appendChild(svg._node);
- return svg;
- };
- /**
- * Ensures that the data object passed as second argument to the charts is present and correctly initialized.
- *
- * @param {Object} data The data object that is passed as second argument to the charts
- * @return {Object} The normalized data object
- */
- Chartist.normalizeData = function(data, reverse, multi) {
- var labelCount;
- var output = {
- raw: data,
- normalized: {}
- };
- // Check if we should generate some labels based on existing series data
- output.normalized.series = Chartist.getDataArray({
- series: data.series || []
- }, reverse, multi);
- // If all elements of the normalized data array are arrays we're dealing with
- // multi series data and we need to find the largest series if they are un-even
- if (output.normalized.series.every(function(value) {
- return value instanceof Array;
- })) {
- // Getting the series with the the most elements
- labelCount = Math.max.apply(null, output.normalized.series.map(function(series) {
- return series.length;
- }));
- } else {
- // We're dealing with Pie data so we just take the normalized array length
- labelCount = output.normalized.series.length;
- }
- output.normalized.labels = (data.labels || []).slice();
- // Padding the labels to labelCount with empty strings
- Array.prototype.push.apply(
- output.normalized.labels,
- Chartist.times(Math.max(0, labelCount - output.normalized.labels.length)).map(function() {
- return '';
- })
- );
- if(reverse) {
- Chartist.reverseData(output.normalized);
- }
- return output;
- };
- /**
- * This function safely checks if an objects has an owned property.
- *
- * @param {Object} object The object where to check for a property
- * @param {string} property The property name
- * @returns {boolean} Returns true if the object owns the specified property
- */
- Chartist.safeHasProperty = function(object, property) {
- return object !== null &&
- typeof object === 'object' &&
- object.hasOwnProperty(property);
- };
- /**
- * Checks if a value is considered a hole in the data series.
- *
- * @param {*} value
- * @returns {boolean} True if the value is considered a data hole
- */
- Chartist.isDataHoleValue = function(value) {
- return value === null ||
- value === undefined ||
- (typeof value === 'number' && isNaN(value));
- };
- /**
- * Reverses the series, labels and series data arrays.
- *
- * @memberof Chartist.Core
- * @param data
- */
- Chartist.reverseData = function(data) {
- data.labels.reverse();
- data.series.reverse();
- for (var i = 0; i < data.series.length; i++) {
- if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) {
- data.series[i].data.reverse();
- } else if(data.series[i] instanceof Array) {
- data.series[i].reverse();
- }
- }
- };
- /**
- * Convert data series into plain array
- *
- * @memberof Chartist.Core
- * @param {Object} data The series object that contains the data to be visualized in the chart
- * @param {Boolean} [reverse] If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too.
- * @param {Boolean} [multi] Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created.
- * @return {Array} A plain array that contains the data to be visualized in the chart
- */
- Chartist.getDataArray = function(data, reverse, multi) {
- // Recursively walks through nested arrays and convert string values to numbers and objects with value properties
- // to values. Check the tests in data core -> data normalization for a detailed specification of expected values
- function recursiveConvert(value) {
- if(Chartist.safeHasProperty(value, 'value')) {
- // We are dealing with value object notation so we need to recurse on value property
- return recursiveConvert(value.value);
- } else if(Chartist.safeHasProperty(value, 'data')) {
- // We are dealing with series object notation so we need to recurse on data property
- return recursiveConvert(value.data);
- } else if(value instanceof Array) {
- // Data is of type array so we need to recurse on the series
- return value.map(recursiveConvert);
- } else if(Chartist.isDataHoleValue(value)) {
- // We're dealing with a hole in the data and therefore need to return undefined
- // We're also returning undefined for multi value output
- return undefined;
- } else {
- // We need to prepare multi value output (x and y data)
- if(multi) {
- var multiValue = {};
- // Single series value arrays are assumed to specify the Y-Axis value
- // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]
- // If multi is a string then it's assumed that it specified which dimension should be filled as default
- if(typeof multi === 'string') {
- multiValue[multi] = Chartist.getNumberOrUndefined(value);
- } else {
- multiValue.y = Chartist.getNumberOrUndefined(value);
- }
- multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;
- multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;
- return multiValue;
- } else {
- // We can return simple data
- return Chartist.getNumberOrUndefined(value);
- }
- }
- }
- return data.series.map(recursiveConvert);
- };
- /**
- * Converts a number into a padding object.
- *
- * @memberof Chartist.Core
- * @param {Object|Number} padding
- * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed
- * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned.
- */
- Chartist.normalizePadding = function(padding, fallback) {
- fallback = fallback || 0;
- return typeof padding === 'number' ? {
- top: padding,
- right: padding,
- bottom: padding,
- left: padding
- } : {
- top: typeof padding.top === 'number' ? padding.top : fallback,
- right: typeof padding.right === 'number' ? padding.right : fallback,
- bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback,
- left: typeof padding.left === 'number' ? padding.left : fallback
- };
- };
- Chartist.getMetaData = function(series, index) {
- var value = series.data ? series.data[index] : series[index];
- return value ? value.meta : undefined;
- };
- /**
- * Calculate the order of magnitude for the chart scale
- *
- * @memberof Chartist.Core
- * @param {Number} value The value Range of the chart
- * @return {Number} The order of magnitude
- */
- Chartist.orderOfMagnitude = function (value) {
- return Math.floor(Math.log(Math.abs(value)) / Math.LN10);
- };
- /**
- * Project a data length into screen coordinates (pixels)
- *
- * @memberof Chartist.Core
- * @param {Object} axisLength The svg element for the chart
- * @param {Number} length Single data value from a series array
- * @param {Object} bounds All the values to set the bounds of the chart
- * @return {Number} The projected data length in pixels
- */
- Chartist.projectLength = function (axisLength, length, bounds) {
- return length / bounds.range * axisLength;
- };
- /**
- * Get the height of the area in the chart for the data series
- *
- * @memberof Chartist.Core
- * @param {Object} svg The svg element for the chart
- * @param {Object} options The Object that contains all the optional values for the chart
- * @return {Number} The height of the area in the chart for the data series
- */
- Chartist.getAvailableHeight = function (svg, options) {
- return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0);
- };
- /**
- * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart.
- *
- * @memberof Chartist.Core
- * @param {Array} data The array that contains the data to be visualized in the chart
- * @param {Object} options The Object that contains the chart options
- * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration
- * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart.
- */
- Chartist.getHighLow = function (data, options, dimension) {
- // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred
- options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {});
- var highLow = {
- high: options.high === undefined ? -Number.MAX_VALUE : +options.high,
- low: options.low === undefined ? Number.MAX_VALUE : +options.low
- };
- var findHigh = options.high === undefined;
- var findLow = options.low === undefined;
- // Function to recursively walk through arrays and find highest and lowest number
- function recursiveHighLow(data) {
- if(data === undefined) {
- return undefined;
- } else if(data instanceof Array) {
- for (var i = 0; i < data.length; i++) {
- recursiveHighLow(data[i]);
- }
- } else {
- var value = dimension ? +data[dimension] : +data;
- if (findHigh && value > highLow.high) {
- highLow.high = value;
- }
- if (findLow && value < highLow.low) {
- highLow.low = value;
- }
- }
- }
- // Start to find highest and lowest number recursively
- if(findHigh || findLow) {
- recursiveHighLow(data);
- }
- // Overrides of high / low based on reference value, it will make sure that the invisible reference value is
- // used to generate the chart. This is useful when the chart always needs to contain the position of the
- // invisible reference value in the view i.e. for bipolar scales.
- if (options.referenceValue || options.referenceValue === 0) {
- highLow.high = Math.max(options.referenceValue, highLow.high);
- highLow.low = Math.min(options.referenceValue, highLow.low);
- }
- // If high and low are the same because of misconfiguration or flat data (only the same value) we need
- // to set the high or low to 0 depending on the polarity
- if (highLow.high <= highLow.low) {
- // If both values are 0 we set high to 1
- if (highLow.low === 0) {
- highLow.high = 1;
- } else if (highLow.low < 0) {
- // If we have the same negative value for the bounds we set bounds.high to 0
- highLow.high = 0;
- } else if (highLow.high > 0) {
- // If we have the same positive value for the bounds we set bounds.low to 0
- highLow.low = 0;
- } else {
- // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors
- highLow.high = 1;
- highLow.low = 0;
- }
- }
- return highLow;
- };
- /**
- * Checks if a value can be safely coerced to a number. This includes all values except null which result in finite numbers when coerced. This excludes NaN, since it's not finite.
- *
- * @memberof Chartist.Core
- * @param value
- * @returns {Boolean}
- */
- Chartist.isNumeric = function(value) {
- return value === null ? false : isFinite(value);
- };
- /**
- * Returns true on all falsey values except the numeric value 0.
- *
- * @memberof Chartist.Core
- * @param value
- * @returns {boolean}
- */
- Chartist.isFalseyButZero = function(value) {
- return !value && value !== 0;
- };
- /**
- * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined.
- *
- * @memberof Chartist.Core
- * @param value
- * @returns {*}
- */
- Chartist.getNumberOrUndefined = function(value) {
- return Chartist.isNumeric(value) ? +value : undefined;
- };
- /**
- * Checks if provided value object is multi value (contains x or y properties)
- *
- * @memberof Chartist.Core
- * @param value
- */
- Chartist.isMultiValue = function(value) {
- return typeof value === 'object' && ('x' in value || 'y' in value);
- };
- /**
- * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return `defaultValue`.
- *
- * @memberof Chartist.Core
- * @param value
- * @param dimension
- * @param defaultValue
- * @returns {*}
- */
- Chartist.getMultiValue = function(value, dimension) {
- if(Chartist.isMultiValue(value)) {
- return Chartist.getNumberOrUndefined(value[dimension || 'y']);
- } else {
- return Chartist.getNumberOrUndefined(value);
- }
- };
- /**
- * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.
- *
- * @memberof Chartist.Core
- * @param {Number} num An integer number where the smallest factor should be searched for
- * @returns {Number} The smallest integer factor of the parameter num.
- */
- Chartist.rho = function(num) {
- if(num === 1) {
- return num;
- }
- function gcd(p, q) {
- if (p % q === 0) {
- return q;
- } else {
- return gcd(q, p % q);
- }
- }
- function f(x) {
- return x * x + 1;
- }
- var x1 = 2, x2 = 2, divisor;
- if (num % 2 === 0) {
- return 2;
- }
- do {
- x1 = f(x1) % num;
- x2 = f(f(x2)) % num;
- divisor = gcd(Math.abs(x1 - x2), num);
- } while (divisor === 1);
- return divisor;
- };
- /**
- * Calculate and retrieve all the bounds for the chart and return them in one array
- *
- * @memberof Chartist.Core
- * @param {Number} axisLength The length of the Axis used for
- * @param {Object} highLow An object containing a high and low property indicating the value range of the chart.
- * @param {Number} scaleMinSpace The minimum projected length a step should result in
- * @param {Boolean} onlyInteger
- * @return {Object} All the values to set the bounds of the chart
- */
- Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) {
- var i,
- optimizationCounter = 0,
- newMin,
- newMax,
- bounds = {
- high: highLow.high,
- low: highLow.low
- };
- bounds.valueRange = bounds.high - bounds.low;
- bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange);
- bounds.step = Math.pow(10, bounds.oom);
- bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step;
- bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step;
- bounds.range = bounds.max - bounds.min;
- bounds.numberOfSteps = Math.round(bounds.range / bounds.step);
- // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace
- // If we are already below the scaleMinSpace value we will scale up
- var length = Chartist.projectLength(axisLength, bounds.step, bounds);
- var scaleUp = length < scaleMinSpace;
- var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0;
- // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1
- if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) {
- bounds.step = 1;
- } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) {
- // If step 1 was too small, we can try the smallest factor of range
- // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor
- // is larger than the scaleMinSpace we should go for it.
- bounds.step = smallestFactor;
- } else {
- // Trying to divide or multiply by 2 and find the best step value
- while (true) {
- if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) {
- bounds.step *= 2;
- } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) {
- bounds.step /= 2;
- if(onlyInteger && bounds.step % 1 !== 0) {
- bounds.step *= 2;
- break;
- }
- } else {
- break;
- }
- if(optimizationCounter++ > 1000) {
- throw new Error('Exceeded maximum number of iterations while optimizing scale step!');
- }
- }
- }
- var EPSILON = 2.221E-16;
- bounds.step = Math.max(bounds.step, EPSILON);
- function safeIncrement(value, increment) {
- // If increment is too small use *= (1+EPSILON) as a simple nextafter
- if (value === (value += increment)) {
- value *= (1 + (increment > 0 ? EPSILON : -EPSILON));
- }
- return value;
- }
- // Narrow min and max based on new step
- newMin = bounds.min;
- newMax = bounds.max;
- while (newMin + bounds.step <= bounds.low) {
- newMin = safeIncrement(newMin, bounds.step);
- }
- while (newMax - bounds.step >= bounds.high) {
- newMax = safeIncrement(newMax, -bounds.step);
- }
- bounds.min = newMin;
- bounds.max = newMax;
- bounds.range = bounds.max - bounds.min;
- var values = [];
- for (i = bounds.min; i <= bounds.max; i = safeIncrement(i, bounds.step)) {
- var value = Chartist.roundWithPrecision(i);
- if (value !== values[values.length - 1]) {
- values.push(value);
- }
- }
- bounds.values = values;
- return bounds;
- };
- /**
- * Calculate cartesian coordinates of polar coordinates
- *
- * @memberof Chartist.Core
- * @param {Number} centerX X-axis coordinates of center point of circle segment
- * @param {Number} centerY X-axis coordinates of center point of circle segment
- * @param {Number} radius Radius of circle segment
- * @param {Number} angleInDegrees Angle of circle segment in degrees
- * @return {{x:Number, y:Number}} Coordinates of point on circumference
- */
- Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) {
- var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
- return {
- x: centerX + (radius * Math.cos(angleInRadians)),
- y: centerY + (radius * Math.sin(angleInRadians))
- };
- };
- /**
- * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right
- *
- * @memberof Chartist.Core
- * @param {Object} svg The svg element for the chart
- * @param {Object} options The Object that contains all the optional values for the chart
- * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used
- * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements
- */
- Chartist.createChartRect = function (svg, options, fallbackPadding) {
- var hasAxis = !!(options.axisX || options.axisY);
- var yAxisOffset = hasAxis ? options.axisY.offset : 0;
- var xAxisOffset = hasAxis ? options.axisX.offset : 0;
- // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0
- var width = svg.width() || Chartist.quantity(options.width).value || 0;
- var height = svg.height() || Chartist.quantity(options.height).value || 0;
- var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding);
- // If settings were to small to cope with offset (legacy) and padding, we'll adjust
- width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right);
- height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom);
- var chartRect = {
- padding: normalizedPadding,
- width: function () {
- return this.x2 - this.x1;
- },
- height: function () {
- return this.y1 - this.y2;
- }
- };
- if(hasAxis) {
- if (options.axisX.position === 'start') {
- chartRect.y2 = normalizedPadding.top + xAxisOffset;
- chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);
- } else {
- chartRect.y2 = normalizedPadding.top;
- chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1);
- }
- if (options.axisY.position === 'start') {
- chartRect.x1 = normalizedPadding.left + yAxisOffset;
- chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);
- } else {
- chartRect.x1 = normalizedPadding.left;
- chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1);
- }
- } else {
- chartRect.x1 = normalizedPadding.left;
- chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);
- chartRect.y2 = normalizedPadding.top;
- chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);
- }
- return chartRect;
- };
- /**
- * Creates a grid line based on a projected value.
- *
- * @memberof Chartist.Core
- * @param position
- * @param index
- * @param axis
- * @param offset
- * @param length
- * @param group
- * @param classes
- * @param eventEmitter
- */
- Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) {
- var positionalData = {};
- positionalData[axis.units.pos + '1'] = position;
- positionalData[axis.units.pos + '2'] = position;
- positionalData[axis.counterUnits.pos + '1'] = offset;
- positionalData[axis.counterUnits.pos + '2'] = offset + length;
- var gridElement = group.elem('line', positionalData, classes.join(' '));
- // Event for grid draw
- eventEmitter.emit('draw',
- Chartist.extend({
- type: 'grid',
- axis: axis,
- index: index,
- group: group,
- element: gridElement
- }, positionalData)
- );
- };
- /**
- * Creates a grid background rect and emits the draw event.
- *
- * @memberof Chartist.Core
- * @param gridGroup
- * @param chartRect
- * @param className
- * @param eventEmitter
- */
- Chartist.createGridBackground = function (gridGroup, chartRect, className, eventEmitter) {
- var gridBackground = gridGroup.elem('rect', {
- x: chartRect.x1,
- y: chartRect.y2,
- width: chartRect.width(),
- height: chartRect.height(),
- }, className, true);
- // Event for grid background draw
- eventEmitter.emit('draw', {
- type: 'gridBackground',
- group: gridGroup,
- element: gridBackground
- });
- };
- /**
- * Creates a label based on a projected value and an axis.
- *
- * @memberof Chartist.Core
- * @param position
- * @param length
- * @param index
- * @param labels
- * @param axis
- * @param axisOffset
- * @param labelOffset
- * @param group
- * @param classes
- * @param useForeignObject
- * @param eventEmitter
- */
- Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) {
- var labelElement;
- var positionalData = {};
- positionalData[axis.units.pos] = position + labelOffset[axis.units.pos];
- positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos];
- positionalData[axis.units.len] = length;
- positionalData[axis.counterUnits.len] = Math.max(0, axisOffset - 10);
- if(useForeignObject) {
- // We need to set width and height explicitly to px as span will not expand with width and height being
- // 100% in all browsers
- var content = document.createElement('span');
- content.className = classes.join(' ');
- content.setAttribute('xmlns', Chartist.namespaces.xhtml);
- content.innerText = labels[index];
- content.style[axis.units.len] = Math.round(positionalData[axis.units.len]) + 'px';
- content.style[axis.counterUnits.len] = Math.round(positionalData[axis.counterUnits.len]) + 'px';
- labelElement = group.foreignObject(content, Chartist.extend({
- style: 'overflow: visible;'
- }, positionalData));
- } else {
- labelElement = group.elem('text', positionalData, classes.join(' ')).text(labels[index]);
- }
- eventEmitter.emit('draw', Chartist.extend({
- type: 'label',
- axis: axis,
- index: index,
- group: group,
- element: labelElement,
- text: labels[index]
- }, positionalData));
- };
- /**
- * Helper to read series specific options from options object. It automatically falls back to the global option if
- * there is no option in the series options.
- *
- * @param {Object} series Series object
- * @param {Object} options Chartist options object
- * @param {string} key The options key that should be used to obtain the options
- * @returns {*}
- */
- Chartist.getSeriesOption = function(series, options, key) {
- if(series.name && options.series && options.series[series.name]) {
- var seriesOptions = options.series[series.name];
- return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key];
- } else {
- return options[key];
- }
- };
- /**
- * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches
- *
- * @memberof Chartist.Core
- * @param {Object} options Options set by user
- * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart
- * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events
- * @return {Object} The consolidated options object from the defaults, base and matching responsive options
- */
- Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) {
- var baseOptions = Chartist.extend({}, options),
- currentOptions,
- mediaQueryListeners = [],
- i;
- function updateCurrentOptions(mediaEvent) {
- var previousOptions = currentOptions;
- currentOptions = Chartist.extend({}, baseOptions);
- if (responsiveOptions) {
- for (i = 0; i < responsiveOptions.length; i++) {
- var mql = window.matchMedia(responsiveOptions[i][0]);
- if (mql.matches) {
- currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]);
- }
- }
- }
- if(eventEmitter && mediaEvent) {
- eventEmitter.emit('optionsChanged', {
- previousOptions: previousOptions,
- currentOptions: currentOptions
- });
- }
- }
- function removeMediaQueryListeners() {
- mediaQueryListeners.forEach(function(mql) {
- mql.removeListener(updateCurrentOptions);
- });
- }
- if (!window.matchMedia) {
- throw 'window.matchMedia not found! Make sure you\'re using a polyfill.';
- } else if (responsiveOptions) {
- for (i = 0; i < responsiveOptions.length; i++) {
- var mql = window.matchMedia(responsiveOptions[i][0]);
- mql.addListener(updateCurrentOptions);
- mediaQueryListeners.push(mql);
- }
- }
- // Execute initially without an event argument so we get the correct options
- updateCurrentOptions();
- return {
- removeMediaQueryListeners: removeMediaQueryListeners,
- getCurrentOptions: function getCurrentOptions() {
- return Chartist.extend({}, currentOptions);
- }
- };
- };
- /**
- * Splits a list of coordinates and associated values into segments. Each returned segment contains a pathCoordinates
- * valueData property describing the segment.
- *
- * With the default options, segments consist of contiguous sets of points that do not have an undefined value. Any
- * points with undefined values are discarded.
- *
- * **Options**
- * The following options are used to determine how segments are formed
- * ```javascript
- * var options = {
- * // If fillHoles is true, undefined values are simply discarded without creating a new segment. Assuming other options are default, this returns single segment.
- * fillHoles: false,
- * // If increasingX is true, the coordinates in all segments have strictly increasing x-values.
- * increasingX: false
- * };
- * ```
- *
- * @memberof Chartist.Core
- * @param {Array} pathCoordinates List of point coordinates to be split in the form [x1, y1, x2, y2 ... xn, yn]
- * @param {Array} values List of associated point values in the form [v1, v2 .. vn]
- * @param {Object} options Options set by user
- * @return {Array} List of segments, each containing a pathCoordinates and valueData property.
- */
- Chartist.splitIntoSegments = function(pathCoordinates, valueData, options) {
- var defaultOptions = {
- increasingX: false,
- fillHoles: false
- };
- options = Chartist.extend({}, defaultOptions, options);
- var segments = [];
- var hole = true;
- for(var i = 0; i < pathCoordinates.length; i += 2) {
- // If this value is a "hole" we set the hole flag
- if(Chartist.getMultiValue(valueData[i / 2].value) === undefined) {
- // if(valueData[i / 2].value === undefined) {
- if(!options.fillHoles) {
- hole = true;
- }
- } else {
- if(options.increasingX && i >= 2 && pathCoordinates[i] <= pathCoordinates[i-2]) {
- // X is not increasing, so we need to make sure we start a new segment
- hole = true;
- }
- // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment
- if(hole) {
- segments.push({
- pathCoordinates: [],
- valueData: []
- });
- // As we have a valid value now, we are not in a "hole" anymore
- hole = false;
- }
- // Add to the segment pathCoordinates and valueData
- segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);
- segments[segments.length - 1].valueData.push(valueData[i / 2]);
- }
- }
- return segments;
- };
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * Chartist path interpolation functions.
- *
- * @module Chartist.Interpolation
- */
- /* global Chartist */
- (function(globalRoot, Chartist) {
- 'use strict';
- Chartist.Interpolation = {};
- /**
- * This interpolation function does not smooth the path and the result is only containing lines and no curves.
- *
- * @example
- * var chart = new Chartist.Line('.ct-chart', {
- * labels: [1, 2, 3, 4, 5],
- * series: [[1, 2, 8, 1, 7]]
- * }, {
- * lineSmooth: Chartist.Interpolation.none({
- * fillHoles: false
- * })
- * });
- *
- *
- * @memberof Chartist.Interpolation
- * @return {Function}
- */
- Chartist.Interpolation.none = function(options) {
- var defaultOptions = {
- fillHoles: false
- };
- options = Chartist.extend({}, defaultOptions, options);
- return function none(pathCoordinates, valueData) {
- var path = new Chartist.Svg.Path();
- var hole = true;
- for(var i = 0; i < pathCoordinates.length; i += 2) {
- var currX = pathCoordinates[i];
- var currY = pathCoordinates[i + 1];
- var currData = valueData[i / 2];
- if(Chartist.getMultiValue(currData.value) !== undefined) {
- if(hole) {
- path.move(currX, currY, false, currData);
- } else {
- path.line(currX, currY, false, currData);
- }
- hole = false;
- } else if(!options.fillHoles) {
- hole = true;
- }
- }
- return path;
- };
- };
- /**
- * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.
- *
- * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point.
- *
- * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.
- *
- * @example
- * var chart = new Chartist.Line('.ct-chart', {
- * labels: [1, 2, 3, 4, 5],
- * series: [[1, 2, 8, 1, 7]]
- * }, {
- * lineSmooth: Chartist.Interpolation.simple({
- * divisor: 2,
- * fillHoles: false
- * })
- * });
- *
- *
- * @memberof Chartist.Interpolation
- * @param {Object} options The options of the simple interpolation factory function.
- * @return {Function}
- */
- Chartist.Interpolation.simple = function(options) {
- var defaultOptions = {
- divisor: 2,
- fillHoles: false
- };
- options = Chartist.extend({}, defaultOptions, options);
- var d = 1 / Math.max(1, options.divisor);
- return function simple(pathCoordinates, valueData) {
- var path = new Chartist.Svg.Path();
- var prevX, prevY, prevData;
- for(var i = 0; i < pathCoordinates.length; i += 2) {
- var currX = pathCoordinates[i];
- var currY = pathCoordinates[i + 1];
- var length = (currX - prevX) * d;
- var currData = valueData[i / 2];
- if(currData.value !== undefined) {
- if(prevData === undefined) {
- path.move(currX, currY, false, currData);
- } else {
- path.curve(
- prevX + length,
- prevY,
- currX - length,
- currY,
- currX,
- currY,
- false,
- currData
- );
- }
- prevX = currX;
- prevY = currY;
- prevData = currData;
- } else if(!options.fillHoles) {
- prevX = currX = prevData = undefined;
- }
- }
- return path;
- };
- };
- /**
- * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.
- *
- * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.
- *
- * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.
- *
- * @example
- * var chart = new Chartist.Line('.ct-chart', {
- * labels: [1, 2, 3, 4, 5],
- * series: [[1, 2, 8, 1, 7]]
- * }, {
- * lineSmooth: Chartist.Interpolation.cardinal({
- * tension: 1,
- * fillHoles: false
- * })
- * });
- *
- * @memberof Chartist.Interpolation
- * @param {Object} options The options of the cardinal factory function.
- * @return {Function}
- */
- Chartist.Interpolation.cardinal = function(options) {
- var defaultOptions = {
- tension: 1,
- fillHoles: false
- };
- options = Chartist.extend({}, defaultOptions, options);
- var t = Math.min(1, Math.max(0, options.tension)),
- c = 1 - t;
- return function cardinal(pathCoordinates, valueData) {
- // First we try to split the coordinates into segments
- // This is necessary to treat "holes" in line charts
- var segments = Chartist.splitIntoSegments(pathCoordinates, valueData, {
- fillHoles: options.fillHoles
- });
- if(!segments.length) {
- // If there were no segments return 'Chartist.Interpolation.none'
- return Chartist.Interpolation.none()([]);
- } else if(segments.length > 1) {
- // If the split resulted in more that one segment we need to interpolate each segment individually and join them
- // afterwards together into a single path.
- var paths = [];
- // For each segment we will recurse the cardinal function
- segments.forEach(function(segment) {
- paths.push(cardinal(segment.pathCoordinates, segment.valueData));
- });
- // Join the segment path data into a single path and return
- return Chartist.Svg.Path.join(paths);
- } else {
- // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first
- // segment
- pathCoordinates = segments[0].pathCoordinates;
- valueData = segments[0].valueData;
- // If less than two points we need to fallback to no smoothing
- if(pathCoordinates.length <= 4) {
- return Chartist.Interpolation.none()(pathCoordinates, valueData);
- }
- var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]),
- z;
- for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) {
- var p = [
- {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]},
- {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]},
- {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]},
- {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]}
- ];
- if (z) {
- if (!i) {
- p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]};
- } else if (iLen - 4 === i) {
- p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};
- } else if (iLen - 2 === i) {
- p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};
- p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]};
- }
- } else {
- if (iLen - 4 === i) {
- p[3] = p[2];
- } else if (!i) {
- p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]};
- }
- }
- path.curve(
- (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x),
- (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y),
- (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x),
- (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y),
- p[2].x,
- p[2].y,
- false,
- valueData[(i + 2) / 2]
- );
- }
- return path;
- }
- };
- };
- /**
- * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points.
- *
- * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.
- *
- * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points.
- *
- * All smoothing functions within Chartist are factory functions that accept an options parameter.
- *
- * @example
- * var chart = new Chartist.Line('.ct-chart', {
- * labels: [1, 2, 3, 4, 5],
- * series: [[1, 2, 8, 1, 7]]
- * }, {
- * lineSmooth: Chartist.Interpolation.monotoneCubic({
- * fillHoles: false
- * })
- * });
- *
- * @memberof Chartist.Interpolation
- * @param {Object} options The options of the monotoneCubic factory function.
- * @return {Function}
- */
- Chartist.Interpolation.monotoneCubic = function(options) {
- var defaultOptions = {
- fillHoles: false
- };
- options = Chartist.extend({}, defaultOptions, options);
- return function monotoneCubic(pathCoordinates, valueData) {
- // First we try to split the coordinates into segments
- // This is necessary to treat "holes" in line charts
- var segments = Chartist.splitIntoSegments(pathCoordinates, valueData, {
- fillHoles: options.fillHoles,
- increasingX: true
- });
- if(!segments.length) {
- // If there were no segments return 'Chartist.Interpolation.none'
- return Chartist.Interpolation.none()([]);
- } else if(segments.length > 1) {
- // If the split resulted in more that one segment we need to interpolate each segment individually and join them
- // afterwards together into a single path.
- var paths = [];
- // For each segment we will recurse the monotoneCubic fn function
- segments.forEach(function(segment) {
- paths.push(monotoneCubic(segment.pathCoordinates, segment.valueData));
- });
- // Join the segment path data into a single path and return
- return Chartist.Svg.Path.join(paths);
- } else {
- // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first
- // segment
- pathCoordinates = segments[0].pathCoordinates;
- valueData = segments[0].valueData;
- // If less than three points we need to fallback to no smoothing
- if(pathCoordinates.length <= 4) {
- return Chartist.Interpolation.none()(pathCoordinates, valueData);
- }
- var xs = [],
- ys = [],
- i,
- n = pathCoordinates.length / 2,
- ms = [],
- ds = [], dys = [], dxs = [],
- path;
- // Populate x and y coordinates into separate arrays, for readability
- for(i = 0; i < n; i++) {
- xs[i] = pathCoordinates[i * 2];
- ys[i] = pathCoordinates[i * 2 + 1];
- }
- // Calculate deltas and derivative
- for(i = 0; i < n - 1; i++) {
- dys[i] = ys[i + 1] - ys[i];
- dxs[i] = xs[i + 1] - xs[i];
- ds[i] = dys[i] / dxs[i];
- }
- // Determine desired slope (m) at each point using Fritsch-Carlson method
- // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation
- ms[0] = ds[0];
- ms[n - 1] = ds[n - 2];
- for(i = 1; i < n - 1; i++) {
- if(ds[i] === 0 || ds[i - 1] === 0 || (ds[i - 1] > 0) !== (ds[i] > 0)) {
- ms[i] = 0;
- } else {
- ms[i] = 3 * (dxs[i - 1] + dxs[i]) / (
- (2 * dxs[i] + dxs[i - 1]) / ds[i - 1] +
- (dxs[i] + 2 * dxs[i - 1]) / ds[i]);
- if(!isFinite(ms[i])) {
- ms[i] = 0;
- }
- }
- }
- // Now build a path from the slopes
- path = new Chartist.Svg.Path().move(xs[0], ys[0], false, valueData[0]);
- for(i = 0; i < n - 1; i++) {
- path.curve(
- // First control point
- xs[i] + dxs[i] / 3,
- ys[i] + ms[i] * dxs[i] / 3,
- // Second control point
- xs[i + 1] - dxs[i] / 3,
- ys[i + 1] - ms[i + 1] * dxs[i] / 3,
- // End point
- xs[i + 1],
- ys[i + 1],
- false,
- valueData[i + 1]
- );
- }
- return path;
- }
- };
- };
- /**
- * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.
- *
- * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.
- *
- * @example
- * var chart = new Chartist.Line('.ct-chart', {
- * labels: [1, 2, 3, 4, 5],
- * series: [[1, 2, 8, 1, 7]]
- * }, {
- * lineSmooth: Chartist.Interpolation.step({
- * postpone: true,
- * fillHoles: false
- * })
- * });
- *
- * @memberof Chartist.Interpolation
- * @param options
- * @returns {Function}
- */
- Chartist.Interpolation.step = function(options) {
- var defaultOptions = {
- postpone: true,
- fillHoles: false
- };
- options = Chartist.extend({}, defaultOptions, options);
- return function step(pathCoordinates, valueData) {
- var path = new Chartist.Svg.Path();
- var prevX, prevY, prevData;
- for (var i = 0; i < pathCoordinates.length; i += 2) {
- var currX = pathCoordinates[i];
- var currY = pathCoordinates[i + 1];
- var currData = valueData[i / 2];
- // If the current point is also not a hole we can draw the step lines
- if(currData.value !== undefined) {
- if(prevData === undefined) {
- path.move(currX, currY, false, currData);
- } else {
- if(options.postpone) {
- // If postponed we should draw the step line with the value of the previous value
- path.line(currX, prevY, false, prevData);
- } else {
- // If not postponed we should draw the step line with the value of the current value
- path.line(prevX, currY, false, currData);
- }
- // Line to the actual point (this should only be a Y-Axis movement
- path.line(currX, currY, false, currData);
- }
- prevX = currX;
- prevY = currY;
- prevData = currData;
- } else if(!options.fillHoles) {
- prevX = prevY = prevData = undefined;
- }
- }
- return path;
- };
- };
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * A very basic event module that helps to generate and catch events.
- *
- * @module Chartist.Event
- */
- /* global Chartist */
- (function (globalRoot, Chartist) {
- 'use strict';
- Chartist.EventEmitter = function () {
- var handlers = [];
- /**
- * Add an event handler for a specific event
- *
- * @memberof Chartist.Event
- * @param {String} event The event name
- * @param {Function} handler A event handler function
- */
- function addEventHandler(event, handler) {
- handlers[event] = handlers[event] || [];
- handlers[event].push(handler);
- }
- /**
- * Remove an event handler of a specific event name or remove all event handlers for a specific event.
- *
- * @memberof Chartist.Event
- * @param {String} event The event name where a specific or all handlers should be removed
- * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed.
- */
- function removeEventHandler(event, handler) {
- // Only do something if there are event handlers with this name existing
- if(handlers[event]) {
- // If handler is set we will look for a specific handler and only remove this
- if(handler) {
- handlers[event].splice(handlers[event].indexOf(handler), 1);
- if(handlers[event].length === 0) {
- delete handlers[event];
- }
- } else {
- // If no handler is specified we remove all handlers for this event
- delete handlers[event];
- }
- }
- }
- /**
- * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter.
- *
- * @memberof Chartist.Event
- * @param {String} event The event name that should be triggered
- * @param {*} data Arbitrary data that will be passed to the event handler callback functions
- */
- function emit(event, data) {
- // Only do something if there are event handlers with this name existing
- if(handlers[event]) {
- handlers[event].forEach(function(handler) {
- handler(data);
- });
- }
- // Emit event to star event handlers
- if(handlers['*']) {
- handlers['*'].forEach(function(starHandler) {
- starHandler(event, data);
- });
- }
- }
- return {
- addEventHandler: addEventHandler,
- removeEventHandler: removeEventHandler,
- emit: emit
- };
- };
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * This module provides some basic prototype inheritance utilities.
- *
- * @module Chartist.Class
- */
- /* global Chartist */
- (function(globalRoot, Chartist) {
- 'use strict';
- function listToArray(list) {
- var arr = [];
- if (list.length) {
- for (var i = 0; i < list.length; i++) {
- arr.push(list[i]);
- }
- }
- return arr;
- }
- /**
- * Method to extend from current prototype.
- *
- * @memberof Chartist.Class
- * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class.
- * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used.
- * @return {Function} Constructor function of the new class
- *
- * @example
- * var Fruit = Class.extend({
- * color: undefined,
- * sugar: undefined,
- *
- * constructor: function(color, sugar) {
- * this.color = color;
- * this.sugar = sugar;
- * },
- *
- * eat: function() {
- * this.sugar = 0;
- * return this;
- * }
- * });
- *
- * var Banana = Fruit.extend({
- * length: undefined,
- *
- * constructor: function(length, sugar) {
- * Banana.super.constructor.call(this, 'Yellow', sugar);
- * this.length = length;
- * }
- * });
- *
- * var banana = new Banana(20, 40);
- * console.log('banana instanceof Fruit', banana instanceof Fruit);
- * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana));
- * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype);
- * console.log(banana.sugar);
- * console.log(banana.eat().sugar);
- * console.log(banana.color);
- */
- function extend(properties, superProtoOverride) {
- var superProto = superProtoOverride || this.prototype || Chartist.Class;
- var proto = Object.create(superProto);
- Chartist.Class.cloneDefinitions(proto, properties);
- var constr = function() {
- var fn = proto.constructor || function () {},
- instance;
- // If this is linked to the Chartist namespace the constructor was not called with new
- // To provide a fallback we will instantiate here and return the instance
- instance = this === Chartist ? Object.create(proto) : this;
- fn.apply(instance, Array.prototype.slice.call(arguments, 0));
- // If this constructor was not called with new we need to return the instance
- // This will not harm when the constructor has been called with new as the returned value is ignored
- return instance;
- };
- constr.prototype = proto;
- constr.super = superProto;
- constr.extend = this.extend;
- return constr;
- }
- // Variable argument list clones args > 0 into args[0] and retruns modified args[0]
- function cloneDefinitions() {
- var args = listToArray(arguments);
- var target = args[0];
- args.splice(1, args.length - 1).forEach(function (source) {
- Object.getOwnPropertyNames(source).forEach(function (propName) {
- // If this property already exist in target we delete it first
- delete target[propName];
- // Define the property with the descriptor from source
- Object.defineProperty(target, propName,
- Object.getOwnPropertyDescriptor(source, propName));
- });
- });
- return target;
- }
- Chartist.Class = {
- extend: extend,
- cloneDefinitions: cloneDefinitions
- };
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * Base for all chart types. The methods in Chartist.Base are inherited to all chart types.
- *
- * @module Chartist.Base
- */
- /* global Chartist */
- (function(globalRoot, Chartist) {
- 'use strict';
- var window = globalRoot.window;
- // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance.
- // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not
- // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage.
- // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html
- // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj
- // The problem is with the label offsets that can't be converted into percentage and affecting the chart container
- /**
- * Updates the chart which currently does a full reconstruction of the SVG DOM
- *
- * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.
- * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.
- * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base
- * @memberof Chartist.Base
- */
- function update(data, options, override) {
- if(data) {
- this.data = data || {};
- this.data.labels = this.data.labels || [];
- this.data.series = this.data.series || [];
- // Event for data transformation that allows to manipulate the data before it gets rendered in the charts
- this.eventEmitter.emit('data', {
- type: 'update',
- data: this.data
- });
- }
- if(options) {
- this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options);
- // If chartist was not initialized yet, we just set the options and leave the rest to the initialization
- // Otherwise we re-create the optionsProvider at this point
- if(!this.initializeTimeoutId) {
- this.optionsProvider.removeMediaQueryListeners();
- this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);
- }
- }
- // Only re-created the chart if it has been initialized yet
- if(!this.initializeTimeoutId) {
- this.createChart(this.optionsProvider.getCurrentOptions());
- }
- // Return a reference to the chart object to chain up calls
- return this;
- }
- /**
- * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.
- *
- * @memberof Chartist.Base
- */
- function detach() {
- // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore
- // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout
- if(!this.initializeTimeoutId) {
- window.removeEventListener('resize', this.resizeListener);
- this.optionsProvider.removeMediaQueryListeners();
- } else {
- window.clearTimeout(this.initializeTimeoutId);
- }
- return this;
- }
- /**
- * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.
- *
- * @memberof Chartist.Base
- * @param {String} event Name of the event. Check the examples for supported events.
- * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.
- */
- function on(event, handler) {
- this.eventEmitter.addEventHandler(event, handler);
- return this;
- }
- /**
- * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.
- *
- * @memberof Chartist.Base
- * @param {String} event Name of the event for which a handler should be removed
- * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.
- */
- function off(event, handler) {
- this.eventEmitter.removeEventHandler(event, handler);
- return this;
- }
- function initialize() {
- // Add window resize listener that re-creates the chart
- window.addEventListener('resize', this.resizeListener);
- // Obtain current options based on matching media queries (if responsive options are given)
- // This will also register a listener that is re-creating the chart based on media changes
- this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);
- // Register options change listener that will trigger a chart update
- this.eventEmitter.addEventHandler('optionsChanged', function() {
- this.update();
- }.bind(this));
- // Before the first chart creation we need to register us with all plugins that are configured
- // Initialize all relevant plugins with our chart object and the plugin options specified in the config
- if(this.options.plugins) {
- this.options.plugins.forEach(function(plugin) {
- if(plugin instanceof Array) {
- plugin[0](this, plugin[1]);
- } else {
- plugin(this);
- }
- }.bind(this));
- }
- // Event for data transformation that allows to manipulate the data before it gets rendered in the charts
- this.eventEmitter.emit('data', {
- type: 'initial',
- data: this.data
- });
- // Create the first chart
- this.createChart(this.optionsProvider.getCurrentOptions());
- // As chart is initialized from the event loop now we can reset our timeout reference
- // This is important if the chart gets initialized on the same element twice
- this.initializeTimeoutId = undefined;
- }
- /**
- * Constructor of chart base class.
- *
- * @param query
- * @param data
- * @param defaultOptions
- * @param options
- * @param responsiveOptions
- * @constructor
- */
- function Base(query, data, defaultOptions, options, responsiveOptions) {
- this.container = Chartist.querySelector(query);
- this.data = data || {};
- this.data.labels = this.data.labels || [];
- this.data.series = this.data.series || [];
- this.defaultOptions = defaultOptions;
- this.options = options;
- this.responsiveOptions = responsiveOptions;
- this.eventEmitter = Chartist.EventEmitter();
- this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility');
- this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute');
- this.resizeListener = function resizeListener(){
- this.update();
- }.bind(this);
- if(this.container) {
- // If chartist was already initialized in this container we are detaching all event listeners first
- if(this.container.__chartist__) {
- this.container.__chartist__.detach();
- }
- this.container.__chartist__ = this;
- }
- // Using event loop for first draw to make it possible to register event listeners in the same call stack where
- // the chart was created.
- this.initializeTimeoutId = setTimeout(initialize.bind(this), 0);
- }
- // Creating the chart base class
- Chartist.Base = Chartist.Class.extend({
- constructor: Base,
- optionsProvider: undefined,
- container: undefined,
- svg: undefined,
- eventEmitter: undefined,
- createChart: function() {
- throw new Error('Base chart type can\'t be instantiated!');
- },
- update: update,
- detach: detach,
- on: on,
- off: off,
- version: Chartist.version,
- supportsForeignObject: false
- });
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * Chartist SVG module for simple SVG DOM abstraction
- *
- * @module Chartist.Svg
- */
- /* global Chartist */
- (function(globalRoot, Chartist) {
- 'use strict';
- var document = globalRoot.document;
- /**
- * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.
- *
- * @memberof Chartist.Svg
- * @constructor
- * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg
- * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.
- * @param {String} className This class or class list will be added to the SVG element
- * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child
- * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element
- */
- function Svg(name, attributes, className, parent, insertFirst) {
- // If Svg is getting called with an SVG element we just return the wrapper
- if(name instanceof Element) {
- this._node = name;
- } else {
- this._node = document.createElementNS(Chartist.namespaces.svg, name);
- // If this is an SVG element created then custom namespace
- if(name === 'svg') {
- this.attr({
- 'xmlns:ct': Chartist.namespaces.ct
- });
- }
- }
- if(attributes) {
- this.attr(attributes);
- }
- if(className) {
- this.addClass(className);
- }
- if(parent) {
- if (insertFirst && parent._node.firstChild) {
- parent._node.insertBefore(this._node, parent._node.firstChild);
- } else {
- parent._node.appendChild(this._node);
- }
- }
- }
- /**
- * Set attributes on the current SVG element of the wrapper you're currently working on.
- *
- * @memberof Chartist.Svg
- * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value.
- * @param {String} [ns] If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object.
- * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function.
- */
- function attr(attributes, ns) {
- if(typeof attributes === 'string') {
- if(ns) {
- return this._node.getAttributeNS(ns, attributes);
- } else {
- return this._node.getAttribute(attributes);
- }
- }
- Object.keys(attributes).forEach(function(key) {
- // If the attribute value is undefined we can skip this one
- if(attributes[key] === undefined) {
- return;
- }
- if (key.indexOf(':') !== -1) {
- var namespacedAttribute = key.split(':');
- this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]);
- } else {
- this._node.setAttribute(key, attributes[key]);
- }
- }.bind(this));
- return this;
- }
- /**
- * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.
- *
- * @memberof Chartist.Svg
- * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper
- * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.
- * @param {String} [className] This class or class list will be added to the SVG element
- * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element
- * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data
- */
- function elem(name, attributes, className, insertFirst) {
- return new Chartist.Svg(name, attributes, className, this, insertFirst);
- }
- /**
- * Returns the parent Chartist.SVG wrapper object
- *
- * @memberof Chartist.Svg
- * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null.
- */
- function parent() {
- return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null;
- }
- /**
- * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.
- *
- * @memberof Chartist.Svg
- * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element
- */
- function root() {
- var node = this._node;
- while(node.nodeName !== 'svg') {
- node = node.parentNode;
- }
- return new Chartist.Svg(node);
- }
- /**
- * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.
- *
- * @memberof Chartist.Svg
- * @param {String} selector A CSS selector that is used to query for child SVG elements
- * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found
- */
- function querySelector(selector) {
- var foundNode = this._node.querySelector(selector);
- return foundNode ? new Chartist.Svg(foundNode) : null;
- }
- /**
- * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.
- *
- * @memberof Chartist.Svg
- * @param {String} selector A CSS selector that is used to query for child SVG elements
- * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found
- */
- function querySelectorAll(selector) {
- var foundNodes = this._node.querySelectorAll(selector);
- return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null;
- }
- /**
- * Returns the underlying SVG node for the current element.
- *
- * @memberof Chartist.Svg
- * @returns {Node}
- */
- function getNode() {
- return this._node;
- }
- /**
- * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.
- *
- * @memberof Chartist.Svg
- * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject
- * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added.
- * @param {String} [className] This class or class list will be added to the SVG element
- * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child
- * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element
- */
- function foreignObject(content, attributes, className, insertFirst) {
- // If content is string then we convert it to DOM
- // TODO: Handle case where content is not a string nor a DOM Node
- if(typeof content === 'string') {
- var container = document.createElement('div');
- container.innerHTML = content;
- content = container.firstChild;
- }
- // Adding namespace to content element
- content.setAttribute('xmlns', Chartist.namespaces.xmlns);
- // Creating the foreignObject without required extension attribute (as described here
- // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement)
- var fnObj = this.elem('foreignObject', attributes, className, insertFirst);
- // Add content to foreignObjectElement
- fnObj._node.appendChild(content);
- return fnObj;
- }
- /**
- * This method adds a new text element to the current Chartist.Svg wrapper.
- *
- * @memberof Chartist.Svg
- * @param {String} t The text that should be added to the text element that is created
- * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element
- */
- function text(t) {
- this._node.appendChild(document.createTextNode(t));
- return this;
- }
- /**
- * This method will clear all child nodes of the current wrapper object.
- *
- * @memberof Chartist.Svg
- * @return {Chartist.Svg} The same wrapper object that got emptied
- */
- function empty() {
- while (this._node.firstChild) {
- this._node.removeChild(this._node.firstChild);
- }
- return this;
- }
- /**
- * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.
- *
- * @memberof Chartist.Svg
- * @return {Chartist.Svg} The parent wrapper object of the element that got removed
- */
- function remove() {
- this._node.parentNode.removeChild(this._node);
- return this.parent();
- }
- /**
- * This method will replace the element with a new element that can be created outside of the current DOM.
- *
- * @memberof Chartist.Svg
- * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object
- * @return {Chartist.Svg} The wrapper of the new element
- */
- function replace(newElement) {
- this._node.parentNode.replaceChild(newElement._node, this._node);
- return newElement;
- }
- /**
- * This method will append an element to the current element as a child.
- *
- * @memberof Chartist.Svg
- * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child
- * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child
- * @return {Chartist.Svg} The wrapper of the appended object
- */
- function append(element, insertFirst) {
- if(insertFirst && this._node.firstChild) {
- this._node.insertBefore(element._node, this._node.firstChild);
- } else {
- this._node.appendChild(element._node);
- }
- return this;
- }
- /**
- * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.
- *
- * @memberof Chartist.Svg
- * @return {Array} A list of classes or an empty array if there are no classes on the current element
- */
- function classes() {
- return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\s+/) : [];
- }
- /**
- * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.
- *
- * @memberof Chartist.Svg
- * @param {String} names A white space separated list of class names
- * @return {Chartist.Svg} The wrapper of the current element
- */
- function addClass(names) {
- this._node.setAttribute('class',
- this.classes(this._node)
- .concat(names.trim().split(/\s+/))
- .filter(function(elem, pos, self) {
- return self.indexOf(elem) === pos;
- }).join(' ')
- );
- return this;
- }
- /**
- * Removes one or a space separated list of classes from the current element.
- *
- * @memberof Chartist.Svg
- * @param {String} names A white space separated list of class names
- * @return {Chartist.Svg} The wrapper of the current element
- */
- function removeClass(names) {
- var removedClasses = names.trim().split(/\s+/);
- this._node.setAttribute('class', this.classes(this._node).filter(function(name) {
- return removedClasses.indexOf(name) === -1;
- }).join(' '));
- return this;
- }
- /**
- * Removes all classes from the current element.
- *
- * @memberof Chartist.Svg
- * @return {Chartist.Svg} The wrapper of the current element
- */
- function removeAllClasses() {
- this._node.setAttribute('class', '');
- return this;
- }
- /**
- * Get element height using `getBoundingClientRect`
- *
- * @memberof Chartist.Svg
- * @return {Number} The elements height in pixels
- */
- function height() {
- return this._node.getBoundingClientRect().height;
- }
- /**
- * Get element width using `getBoundingClientRect`
- *
- * @memberof Chartist.Core
- * @return {Number} The elements width in pixels
- */
- function width() {
- return this._node.getBoundingClientRect().width;
- }
- /**
- * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve.
- * **An animations object could look like this:**
- * ```javascript
- * element.animate({
- * opacity: {
- * dur: 1000,
- * from: 0,
- * to: 1
- * },
- * x1: {
- * dur: '1000ms',
- * from: 100,
- * to: 200,
- * easing: 'easeOutQuart'
- * },
- * y1: {
- * dur: '2s',
- * from: 0,
- * to: 100
- * }
- * });
- * ```
- * **Automatic unit conversion**
- * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds.
- * **Guided mode**
- * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill="freeze"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it.
- * If guided mode is enabled the following behavior is added:
- * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation
- * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation)
- * - The animate element will be forced to use `fill="freeze"`
- * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately.
- * - After the animation the element attribute value will be set to the `to` value of the animation
- * - The animate element is deleted from the DOM
- *
- * @memberof Chartist.Svg
- * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode.
- * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated.
- * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends.
- * @return {Chartist.Svg} The current element where the animation was added
- */
- function animate(animations, guided, eventEmitter) {
- if(guided === undefined) {
- guided = true;
- }
- Object.keys(animations).forEach(function createAnimateForAttributes(attribute) {
- function createAnimate(animationDefinition, guided) {
- var attributeProperties = {},
- animate,
- timeout,
- easing;
- // Check if an easing is specified in the definition object and delete it from the object as it will not
- // be part of the animate element attributes.
- if(animationDefinition.easing) {
- // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object
- easing = animationDefinition.easing instanceof Array ?
- animationDefinition.easing :
- Chartist.Svg.Easing[animationDefinition.easing];
- delete animationDefinition.easing;
- }
- // If numeric dur or begin was provided we assume milli seconds
- animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms');
- animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms');
- if(easing) {
- animationDefinition.calcMode = 'spline';
- animationDefinition.keySplines = easing.join(' ');
- animationDefinition.keyTimes = '0;1';
- }
- // Adding "fill: freeze" if we are in guided mode and set initial attribute values
- if(guided) {
- animationDefinition.fill = 'freeze';
- // Animated property on our element should already be set to the animation from value in guided mode
- attributeProperties[attribute] = animationDefinition.from;
- this.attr(attributeProperties);
- // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin
- // which needs to be in ms aside
- timeout = Chartist.quantity(animationDefinition.begin || 0).value;
- animationDefinition.begin = 'indefinite';
- }
- animate = this.elem('animate', Chartist.extend({
- attributeName: attribute
- }, animationDefinition));
- if(guided) {
- // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout
- setTimeout(function() {
- // If beginElement fails we set the animated attribute to the end position and remove the animate element
- // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in
- // the browser. (Currently FF 34 does not support animate elements in foreignObjects)
- try {
- animate._node.beginElement();
- } catch(err) {
- // Set animated attribute to current animated value
- attributeProperties[attribute] = animationDefinition.to;
- this.attr(attributeProperties);
- // Remove the animate element as it's no longer required
- animate.remove();
- }
- }.bind(this), timeout);
- }
- if(eventEmitter) {
- animate._node.addEventListener('beginEvent', function handleBeginEvent() {
- eventEmitter.emit('animationBegin', {
- element: this,
- animate: animate._node,
- params: animationDefinition
- });
- }.bind(this));
- }
- animate._node.addEventListener('endEvent', function handleEndEvent() {
- if(eventEmitter) {
- eventEmitter.emit('animationEnd', {
- element: this,
- animate: animate._node,
- params: animationDefinition
- });
- }
- if(guided) {
- // Set animated attribute to current animated value
- attributeProperties[attribute] = animationDefinition.to;
- this.attr(attributeProperties);
- // Remove the animate element as it's no longer required
- animate.remove();
- }
- }.bind(this));
- }
- // If current attribute is an array of definition objects we create an animate for each and disable guided mode
- if(animations[attribute] instanceof Array) {
- animations[attribute].forEach(function(animationDefinition) {
- createAnimate.bind(this)(animationDefinition, false);
- }.bind(this));
- } else {
- createAnimate.bind(this)(animations[attribute], guided);
- }
- }.bind(this));
- return this;
- }
- Chartist.Svg = Chartist.Class.extend({
- constructor: Svg,
- attr: attr,
- elem: elem,
- parent: parent,
- root: root,
- querySelector: querySelector,
- querySelectorAll: querySelectorAll,
- getNode: getNode,
- foreignObject: foreignObject,
- text: text,
- empty: empty,
- remove: remove,
- replace: replace,
- append: append,
- classes: classes,
- addClass: addClass,
- removeClass: removeClass,
- removeAllClasses: removeAllClasses,
- height: height,
- width: width,
- animate: animate
- });
- /**
- * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.
- *
- * @memberof Chartist.Svg
- * @param {String} feature The SVG 1.1 feature that should be checked for support.
- * @return {Boolean} True of false if the feature is supported or not
- */
- Chartist.Svg.isSupported = function(feature) {
- return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1');
- };
- /**
- * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions.
- *
- * @memberof Chartist.Svg
- */
- var easingCubicBeziers = {
- easeInSine: [0.47, 0, 0.745, 0.715],
- easeOutSine: [0.39, 0.575, 0.565, 1],
- easeInOutSine: [0.445, 0.05, 0.55, 0.95],
- easeInQuad: [0.55, 0.085, 0.68, 0.53],
- easeOutQuad: [0.25, 0.46, 0.45, 0.94],
- easeInOutQuad: [0.455, 0.03, 0.515, 0.955],
- easeInCubic: [0.55, 0.055, 0.675, 0.19],
- easeOutCubic: [0.215, 0.61, 0.355, 1],
- easeInOutCubic: [0.645, 0.045, 0.355, 1],
- easeInQuart: [0.895, 0.03, 0.685, 0.22],
- easeOutQuart: [0.165, 0.84, 0.44, 1],
- easeInOutQuart: [0.77, 0, 0.175, 1],
- easeInQuint: [0.755, 0.05, 0.855, 0.06],
- easeOutQuint: [0.23, 1, 0.32, 1],
- easeInOutQuint: [0.86, 0, 0.07, 1],
- easeInExpo: [0.95, 0.05, 0.795, 0.035],
- easeOutExpo: [0.19, 1, 0.22, 1],
- easeInOutExpo: [1, 0, 0, 1],
- easeInCirc: [0.6, 0.04, 0.98, 0.335],
- easeOutCirc: [0.075, 0.82, 0.165, 1],
- easeInOutCirc: [0.785, 0.135, 0.15, 0.86],
- easeInBack: [0.6, -0.28, 0.735, 0.045],
- easeOutBack: [0.175, 0.885, 0.32, 1.275],
- easeInOutBack: [0.68, -0.55, 0.265, 1.55]
- };
- Chartist.Svg.Easing = easingCubicBeziers;
- /**
- * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements.
- * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`.
- *
- * @memberof Chartist.Svg
- * @param {Array<Node>|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)
- * @constructor
- */
- function SvgList(nodeList) {
- var list = this;
- this.svgElements = [];
- for(var i = 0; i < nodeList.length; i++) {
- this.svgElements.push(new Chartist.Svg(nodeList[i]));
- }
- // Add delegation methods for Chartist.Svg
- Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) {
- return ['constructor',
- 'parent',
- 'querySelector',
- 'querySelectorAll',
- 'replace',
- 'append',
- 'classes',
- 'height',
- 'width'].indexOf(prototypeProperty) === -1;
- }).forEach(function(prototypeProperty) {
- list[prototypeProperty] = function() {
- var args = Array.prototype.slice.call(arguments, 0);
- list.svgElements.forEach(function(element) {
- Chartist.Svg.prototype[prototypeProperty].apply(element, args);
- });
- return list;
- };
- });
- }
- Chartist.Svg.List = Chartist.Class.extend({
- constructor: SvgList
- });
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * Chartist SVG path module for SVG path description creation and modification.
- *
- * @module Chartist.Svg.Path
- */
- /* global Chartist */
- (function(globalRoot, Chartist) {
- 'use strict';
- /**
- * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported.
- *
- * @memberof Chartist.Svg.Path
- * @type {Object}
- */
- var elementDescriptions = {
- m: ['x', 'y'],
- l: ['x', 'y'],
- c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'],
- a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y']
- };
- /**
- * Default options for newly created SVG path objects.
- *
- * @memberof Chartist.Svg.Path
- * @type {Object}
- */
- var defaultOptions = {
- // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed.
- accuracy: 3
- };
- function element(command, params, pathElements, pos, relative, data) {
- var pathElement = Chartist.extend({
- command: relative ? command.toLowerCase() : command.toUpperCase()
- }, params, data ? { data: data } : {} );
- pathElements.splice(pos, 0, pathElement);
- }
- function forEachParam(pathElements, cb) {
- pathElements.forEach(function(pathElement, pathElementIndex) {
- elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) {
- cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements);
- });
- });
- }
- /**
- * Used to construct a new path object.
- *
- * @memberof Chartist.Svg.Path
- * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end)
- * @param {Object} options Options object that overrides the default objects. See default options for more details.
- * @constructor
- */
- function SvgPath(close, options) {
- this.pathElements = [];
- this.pos = 0;
- this.close = close;
- this.options = Chartist.extend({}, defaultOptions, options);
- }
- /**
- * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor.
- *
- * @memberof Chartist.Svg.Path
- * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array.
- * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned.
- */
- function position(pos) {
- if(pos !== undefined) {
- this.pos = Math.max(0, Math.min(this.pathElements.length, pos));
- return this;
- } else {
- return this.pos;
- }
- }
- /**
- * Removes elements from the path starting at the current position.
- *
- * @memberof Chartist.Svg.Path
- * @param {Number} count Number of path elements that should be removed from the current position.
- * @return {Chartist.Svg.Path} The current path object for easy call chaining.
- */
- function remove(count) {
- this.pathElements.splice(this.pos, count);
- return this;
- }
- /**
- * Use this function to add a new move SVG path element.
- *
- * @memberof Chartist.Svg.Path
- * @param {Number} x The x coordinate for the move element.
- * @param {Number} y The y coordinate for the move element.
- * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter)
- * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement
- * @return {Chartist.Svg.Path} The current path object for easy call chaining.
- */
- function move(x, y, relative, data) {
- element('M', {
- x: +x,
- y: +y
- }, this.pathElements, this.pos++, relative, data);
- return this;
- }
- /**
- * Use this function to add a new line SVG path element.
- *
- * @memberof Chartist.Svg.Path
- * @param {Number} x The x coordinate for the line element.
- * @param {Number} y The y coordinate for the line element.
- * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter)
- * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement
- * @return {Chartist.Svg.Path} The current path object for easy call chaining.
- */
- function line(x, y, relative, data) {
- element('L', {
- x: +x,
- y: +y
- }, this.pathElements, this.pos++, relative, data);
- return this;
- }
- /**
- * Use this function to add a new curve SVG path element.
- *
- * @memberof Chartist.Svg.Path
- * @param {Number} x1 The x coordinate for the first control point of the bezier curve.
- * @param {Number} y1 The y coordinate for the first control point of the bezier curve.
- * @param {Number} x2 The x coordinate for the second control point of the bezier curve.
- * @param {Number} y2 The y coordinate for the second control point of the bezier curve.
- * @param {Number} x The x coordinate for the target point of the curve element.
- * @param {Number} y The y coordinate for the target point of the curve element.
- * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)
- * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement
- * @return {Chartist.Svg.Path} The current path object for easy call chaining.
- */
- function curve(x1, y1, x2, y2, x, y, relative, data) {
- element('C', {
- x1: +x1,
- y1: +y1,
- x2: +x2,
- y2: +y2,
- x: +x,
- y: +y
- }, this.pathElements, this.pos++, relative, data);
- return this;
- }
- /**
- * Use this function to add a new non-bezier curve SVG path element.
- *
- * @memberof Chartist.Svg.Path
- * @param {Number} rx The radius to be used for the x-axis of the arc.
- * @param {Number} ry The radius to be used for the y-axis of the arc.
- * @param {Number} xAr Defines the orientation of the arc
- * @param {Number} lAf Large arc flag
- * @param {Number} sf Sweep flag
- * @param {Number} x The x coordinate for the target point of the curve element.
- * @param {Number} y The y coordinate for the target point of the curve element.
- * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)
- * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement
- * @return {Chartist.Svg.Path} The current path object for easy call chaining.
- */
- function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) {
- element('A', {
- rx: +rx,
- ry: +ry,
- xAr: +xAr,
- lAf: +lAf,
- sf: +sf,
- x: +x,
- y: +y
- }, this.pathElements, this.pos++, relative, data);
- return this;
- }
- /**
- * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object.
- *
- * @memberof Chartist.Svg.Path
- * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components.
- * @return {Chartist.Svg.Path} The current path object for easy call chaining.
- */
- function parse(path) {
- // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']]
- var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2')
- .replace(/([0-9])([A-Za-z])/g, '$1 $2')
- .split(/[\s,]+/)
- .reduce(function(result, element) {
- if(element.match(/[A-Za-z]/)) {
- result.push([]);
- }
- result[result.length - 1].push(element);
- return result;
- }, []);
- // If this is a closed path we remove the Z at the end because this is determined by the close option
- if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') {
- chunks.pop();
- }
- // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters
- // For example {command: 'M', x: '10', y: '10'}
- var elements = chunks.map(function(chunk) {
- var command = chunk.shift(),
- description = elementDescriptions[command.toLowerCase()];
- return Chartist.extend({
- command: command
- }, description.reduce(function(result, paramName, index) {
- result[paramName] = +chunk[index];
- return result;
- }, {}));
- });
- // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position
- var spliceArgs = [this.pos, 0];
- Array.prototype.push.apply(spliceArgs, elements);
- Array.prototype.splice.apply(this.pathElements, spliceArgs);
- // Increase the internal position by the element count
- this.pos += elements.length;
- return this;
- }
- /**
- * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string.
- *
- * @memberof Chartist.Svg.Path
- * @return {String}
- */
- function stringify() {
- var accuracyMultiplier = Math.pow(10, this.options.accuracy);
- return this.pathElements.reduce(function(path, pathElement) {
- var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) {
- return this.options.accuracy ?
- (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) :
- pathElement[paramName];
- }.bind(this));
- return path + pathElement.command + params.join(',');
- }.bind(this), '') + (this.close ? 'Z' : '');
- }
- /**
- * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate.
- *
- * @memberof Chartist.Svg.Path
- * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements.
- * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements.
- * @return {Chartist.Svg.Path} The current path object for easy call chaining.
- */
- function scale(x, y) {
- forEachParam(this.pathElements, function(pathElement, paramName) {
- pathElement[paramName] *= paramName[0] === 'x' ? x : y;
- });
- return this;
- }
- /**
- * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate.
- *
- * @memberof Chartist.Svg.Path
- * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements.
- * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements.
- * @return {Chartist.Svg.Path} The current path object for easy call chaining.
- */
- function translate(x, y) {
- forEachParam(this.pathElements, function(pathElement, paramName) {
- pathElement[paramName] += paramName[0] === 'x' ? x : y;
- });
- return this;
- }
- /**
- * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path.
- * The method signature of the callback function looks like this:
- * ```javascript
- * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements)
- * ```
- * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate.
- *
- * @memberof Chartist.Svg.Path
- * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description.
- * @return {Chartist.Svg.Path} The current path object for easy call chaining.
- */
- function transform(transformFnc) {
- forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) {
- var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements);
- if(transformed || transformed === 0) {
- pathElement[paramName] = transformed;
- }
- });
- return this;
- }
- /**
- * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned.
- *
- * @memberof Chartist.Svg.Path
- * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used.
- * @return {Chartist.Svg.Path}
- */
- function clone(close) {
- var c = new Chartist.Svg.Path(close || this.close);
- c.pos = this.pos;
- c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) {
- return Chartist.extend({}, pathElement);
- });
- c.options = Chartist.extend({}, this.options);
- return c;
- }
- /**
- * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings.
- *
- * @memberof Chartist.Svg.Path
- * @param {String} command The command you'd like to use to split the path
- * @return {Array<Chartist.Svg.Path>}
- */
- function splitByCommand(command) {
- var split = [
- new Chartist.Svg.Path()
- ];
- this.pathElements.forEach(function(pathElement) {
- if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) {
- split.push(new Chartist.Svg.Path());
- }
- split[split.length - 1].pathElements.push(pathElement);
- });
- return split;
- }
- /**
- * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths.
- *
- * @memberof Chartist.Svg.Path
- * @param {Array<Chartist.Svg.Path>} paths A list of paths to be joined together. The order is important.
- * @param {boolean} close If the newly created path should be a closed path
- * @param {Object} options Path options for the newly created path.
- * @return {Chartist.Svg.Path}
- */
- function join(paths, close, options) {
- var joinedPath = new Chartist.Svg.Path(close, options);
- for(var i = 0; i < paths.length; i++) {
- var path = paths[i];
- for(var j = 0; j < path.pathElements.length; j++) {
- joinedPath.pathElements.push(path.pathElements[j]);
- }
- }
- return joinedPath;
- }
- Chartist.Svg.Path = Chartist.Class.extend({
- constructor: SvgPath,
- position: position,
- remove: remove,
- move: move,
- line: line,
- curve: curve,
- arc: arc,
- scale: scale,
- translate: translate,
- transform: transform,
- parse: parse,
- stringify: stringify,
- clone: clone,
- splitByCommand: splitByCommand
- });
- Chartist.Svg.Path.elementDescriptions = elementDescriptions;
- Chartist.Svg.Path.join = join;
- }(this || __webpack_require__.g, Chartist));
- ;/* global Chartist */
- (function (globalRoot, Chartist) {
- 'use strict';
- var window = globalRoot.window;
- var document = globalRoot.document;
- var axisUnits = {
- x: {
- pos: 'x',
- len: 'width',
- dir: 'horizontal',
- rectStart: 'x1',
- rectEnd: 'x2',
- rectOffset: 'y2'
- },
- y: {
- pos: 'y',
- len: 'height',
- dir: 'vertical',
- rectStart: 'y2',
- rectEnd: 'y1',
- rectOffset: 'x1'
- }
- };
- function Axis(units, chartRect, ticks, options) {
- this.units = units;
- this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x;
- this.chartRect = chartRect;
- this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart];
- this.gridOffset = chartRect[units.rectOffset];
- this.ticks = ticks;
- this.options = options;
- }
- function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) {
- var axisOptions = chartOptions['axis' + this.units.pos.toUpperCase()];
- var projectedValues = this.ticks.map(this.projectValue.bind(this));
- var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc);
- projectedValues.forEach(function(projectedValue, index) {
- var labelOffset = {
- x: 0,
- y: 0
- };
- // TODO: Find better solution for solving this problem
- // Calculate how much space we have available for the label
- var labelLength;
- if(projectedValues[index + 1]) {
- // If we still have one label ahead, we can calculate the distance to the next tick / label
- labelLength = projectedValues[index + 1] - projectedValue;
- } else {
- // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to
- // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will
- // still be visible inside of the chart padding.
- labelLength = Math.max(this.axisLength - projectedValue, 30);
- }
- // Skip grid lines and labels where interpolated label values are falsey (execpt for 0)
- if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') {
- return;
- }
- // Transform to global coordinates using the chartRect
- // We also need to set the label offset for the createLabel function
- if(this.units.pos === 'x') {
- projectedValue = this.chartRect.x1 + projectedValue;
- labelOffset.x = chartOptions.axisX.labelOffset.x;
- // If the labels should be positioned in start position (top side for vertical axis) we need to set a
- // different offset as for positioned with end (bottom)
- if(chartOptions.axisX.position === 'start') {
- labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);
- } else {
- labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);
- }
- } else {
- projectedValue = this.chartRect.y1 - projectedValue;
- labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0);
- // If the labels should be positioned in start position (left side for horizontal axis) we need to set a
- // different offset as for positioned with end (right side)
- if(chartOptions.axisY.position === 'start') {
- labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10;
- } else {
- labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10;
- }
- }
- if(axisOptions.showGrid) {
- Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [
- chartOptions.classNames.grid,
- chartOptions.classNames[this.units.dir]
- ], eventEmitter);
- }
- if(axisOptions.showLabel) {
- Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [
- chartOptions.classNames.label,
- chartOptions.classNames[this.units.dir],
- (axisOptions.position === 'start' ? chartOptions.classNames[axisOptions.position] : chartOptions.classNames['end'])
- ], useForeignObject, eventEmitter);
- }
- }.bind(this));
- }
- Chartist.Axis = Chartist.Class.extend({
- constructor: Axis,
- createGridAndLabels: createGridAndLabels,
- projectValue: function(value, index, data) {
- throw new Error('Base axis can\'t be instantiated!');
- }
- });
- Chartist.Axis.units = axisUnits;
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart.
- * **Options**
- * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.
- * ```javascript
- * var options = {
- * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored
- * high: 100,
- * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored
- * low: 0,
- * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel).
- * scaleMinSpace: 20,
- * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only.
- * onlyInteger: true,
- * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart.
- * referenceValue: 5
- * };
- * ```
- *
- * @module Chartist.AutoScaleAxis
- */
- /* global Chartist */
- (function (globalRoot, Chartist) {
- 'use strict';
- var window = globalRoot.window;
- var document = globalRoot.document;
- function AutoScaleAxis(axisUnit, data, chartRect, options) {
- // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options
- var highLow = options.highLow || Chartist.getHighLow(data, options, axisUnit.pos);
- this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger);
- this.range = {
- min: this.bounds.min,
- max: this.bounds.max
- };
- Chartist.AutoScaleAxis.super.constructor.call(this,
- axisUnit,
- chartRect,
- this.bounds.values,
- options);
- }
- function projectValue(value) {
- return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range;
- }
- Chartist.AutoScaleAxis = Chartist.Axis.extend({
- constructor: AutoScaleAxis,
- projectValue: projectValue
- });
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum.
- * **Options**
- * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.
- * ```javascript
- * var options = {
- * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored
- * high: 100,
- * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored
- * low: 0,
- * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1.
- * divisor: 4,
- * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated.
- * ticks: [1, 10, 20, 30]
- * };
- * ```
- *
- * @module Chartist.FixedScaleAxis
- */
- /* global Chartist */
- (function (globalRoot, Chartist) {
- 'use strict';
- var window = globalRoot.window;
- var document = globalRoot.document;
- function FixedScaleAxis(axisUnit, data, chartRect, options) {
- var highLow = options.highLow || Chartist.getHighLow(data, options, axisUnit.pos);
- this.divisor = options.divisor || 1;
- this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) {
- return highLow.low + (highLow.high - highLow.low) / this.divisor * index;
- }.bind(this));
- this.ticks.sort(function(a, b) {
- return a - b;
- });
- this.range = {
- min: highLow.low,
- max: highLow.high
- };
- Chartist.FixedScaleAxis.super.constructor.call(this,
- axisUnit,
- chartRect,
- this.ticks,
- options);
- this.stepLength = this.axisLength / this.divisor;
- }
- function projectValue(value) {
- return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min);
- }
- Chartist.FixedScaleAxis = Chartist.Axis.extend({
- constructor: FixedScaleAxis,
- projectValue: projectValue
- });
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose.
- * **Options**
- * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.
- * ```javascript
- * var options = {
- * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks.
- * ticks: ['One', 'Two', 'Three'],
- * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead.
- * stretch: true
- * };
- * ```
- *
- * @module Chartist.StepAxis
- */
- /* global Chartist */
- (function (globalRoot, Chartist) {
- 'use strict';
- var window = globalRoot.window;
- var document = globalRoot.document;
- function StepAxis(axisUnit, data, chartRect, options) {
- Chartist.StepAxis.super.constructor.call(this,
- axisUnit,
- chartRect,
- options.ticks,
- options);
- var calc = Math.max(1, options.ticks.length - (options.stretch ? 1 : 0));
- this.stepLength = this.axisLength / calc;
- }
- function projectValue(value, index) {
- return this.stepLength * index;
- }
- Chartist.StepAxis = Chartist.Axis.extend({
- constructor: StepAxis,
- projectValue: projectValue
- });
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point.
- *
- * For examples on how to use the line chart please check the examples of the `Chartist.Line` method.
- *
- * @module Chartist.Line
- */
- /* global Chartist */
- (function(globalRoot, Chartist){
- 'use strict';
- var window = globalRoot.window;
- var document = globalRoot.document;
- /**
- * Default options in line charts. Expand the code view to see a detailed list of options with comments.
- *
- * @memberof Chartist.Line
- */
- var defaultOptions = {
- // Options for X-Axis
- axisX: {
- // The offset of the labels to the chart area
- offset: 30,
- // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.
- position: 'end',
- // Allows you to correct label positioning on this axis by positive or negative x and y offset.
- labelOffset: {
- x: 0,
- y: 0
- },
- // If labels should be shown or not
- showLabel: true,
- // If the axis grid should be drawn or not
- showGrid: true,
- // Interpolation function that allows you to intercept the value from the axis label
- labelInterpolationFnc: Chartist.noop,
- // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.
- type: undefined
- },
- // Options for Y-Axis
- axisY: {
- // The offset of the labels to the chart area
- offset: 40,
- // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.
- position: 'start',
- // Allows you to correct label positioning on this axis by positive or negative x and y offset.
- labelOffset: {
- x: 0,
- y: 0
- },
- // If labels should be shown or not
- showLabel: true,
- // If the axis grid should be drawn or not
- showGrid: true,
- // Interpolation function that allows you to intercept the value from the axis label
- labelInterpolationFnc: Chartist.noop,
- // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.
- type: undefined,
- // This value specifies the minimum height in pixel of the scale steps
- scaleMinSpace: 20,
- // Use only integer values (whole numbers) for the scale steps
- onlyInteger: false
- },
- // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
- width: undefined,
- // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
- height: undefined,
- // If the line should be drawn or not
- showLine: true,
- // If dots should be drawn or not
- showPoint: true,
- // If the line chart should draw an area
- showArea: false,
- // The base for the area chart that will be used to close the area shape (is normally 0)
- areaBase: 0,
- // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description.
- lineSmooth: true,
- // If the line chart should add a background fill to the .ct-grids group.
- showGridBackground: false,
- // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value
- low: undefined,
- // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value
- high: undefined,
- // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}
- chartPadding: {
- top: 15,
- right: 15,
- bottom: 5,
- left: 10
- },
- // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.
- fullWidth: false,
- // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
- reverseData: false,
- // Override the class names that get used to generate the SVG structure of the chart
- classNames: {
- chart: 'ct-chart-line',
- label: 'ct-label',
- labelGroup: 'ct-labels',
- series: 'ct-series',
- line: 'ct-line',
- point: 'ct-point',
- area: 'ct-area',
- grid: 'ct-grid',
- gridGroup: 'ct-grids',
- gridBackground: 'ct-grid-background',
- vertical: 'ct-vertical',
- horizontal: 'ct-horizontal',
- start: 'ct-start',
- end: 'ct-end'
- }
- };
- /**
- * Creates a new chart
- *
- */
- function createChart(options) {
- var data = Chartist.normalizeData(this.data, options.reverseData, true);
- // Create new svg object
- this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);
- // Create groups for labels, grid and series
- var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);
- var seriesGroup = this.svg.elem('g');
- var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);
- var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);
- var axisX, axisY;
- if(options.axisX.type === undefined) {
- axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {
- ticks: data.normalized.labels,
- stretch: options.fullWidth
- }));
- } else {
- axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);
- }
- if(options.axisY.type === undefined) {
- axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {
- high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,
- low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low
- }));
- } else {
- axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);
- }
- axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);
- axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);
- if (options.showGridBackground) {
- Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);
- }
- // Draw the series
- data.raw.series.forEach(function(series, seriesIndex) {
- var seriesElement = seriesGroup.elem('g');
- // Write attributes to series group element. If series name or meta is undefined the attributes will not be written
- seriesElement.attr({
- 'ct:series-name': series.name,
- 'ct:meta': Chartist.serialize(series.meta)
- });
- // Use series class from series data or if not set generate one
- seriesElement.addClass([
- options.classNames.series,
- (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))
- ].join(' '));
- var pathCoordinates = [],
- pathData = [];
- data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {
- var p = {
- x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),
- y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])
- };
- pathCoordinates.push(p.x, p.y);
- pathData.push({
- value: value,
- valueIndex: valueIndex,
- meta: Chartist.getMetaData(series, valueIndex)
- });
- }.bind(this));
- var seriesOptions = {
- lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),
- showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),
- showLine: Chartist.getSeriesOption(series, options, 'showLine'),
- showArea: Chartist.getSeriesOption(series, options, 'showArea'),
- areaBase: Chartist.getSeriesOption(series, options, 'areaBase')
- };
- var smoothing = typeof seriesOptions.lineSmooth === 'function' ?
- seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());
- // Interpolating path where pathData will be used to annotate each path element so we can trace back the original
- // index, value and meta data
- var path = smoothing(pathCoordinates, pathData);
- // If we should show points we need to create them now to avoid secondary loop
- // Points are drawn from the pathElements returned by the interpolation function
- // Small offset for Firefox to render squares correctly
- if (seriesOptions.showPoint) {
- path.pathElements.forEach(function(pathElement) {
- var point = seriesElement.elem('line', {
- x1: pathElement.x,
- y1: pathElement.y,
- x2: pathElement.x + 0.01,
- y2: pathElement.y
- }, options.classNames.point).attr({
- 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),
- 'ct:meta': Chartist.serialize(pathElement.data.meta)
- });
- this.eventEmitter.emit('draw', {
- type: 'point',
- value: pathElement.data.value,
- index: pathElement.data.valueIndex,
- meta: pathElement.data.meta,
- series: series,
- seriesIndex: seriesIndex,
- axisX: axisX,
- axisY: axisY,
- group: seriesElement,
- element: point,
- x: pathElement.x,
- y: pathElement.y
- });
- }.bind(this));
- }
- if(seriesOptions.showLine) {
- var line = seriesElement.elem('path', {
- d: path.stringify()
- }, options.classNames.line, true);
- this.eventEmitter.emit('draw', {
- type: 'line',
- values: data.normalized.series[seriesIndex],
- path: path.clone(),
- chartRect: chartRect,
- index: seriesIndex,
- series: series,
- seriesIndex: seriesIndex,
- seriesMeta: series.meta,
- axisX: axisX,
- axisY: axisY,
- group: seriesElement,
- element: line
- });
- }
- // Area currently only works with axes that support a range!
- if(seriesOptions.showArea && axisY.range) {
- // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that
- // the area is not drawn outside the chart area.
- var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);
- // We project the areaBase value into screen coordinates
- var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);
- // In order to form the area we'll first split the path by move commands so we can chunk it up into segments
- path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {
- // We filter only "solid" segments that contain more than one point. Otherwise there's no need for an area
- return pathSegment.pathElements.length > 1;
- }).map(function convertToArea(solidPathSegments) {
- // Receiving the filtered solid path segments we can now convert those segments into fill areas
- var firstElement = solidPathSegments.pathElements[0];
- var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];
- // Cloning the solid path segment with closing option and removing the first move command from the clone
- // We then insert a new move that should start at the area base and draw a straight line up or down
- // at the end of the path we add an additional straight line to the projected area base value
- // As the closing option is set our path will be automatically closed
- return solidPathSegments.clone(true)
- .position(0)
- .remove(1)
- .move(firstElement.x, areaBaseProjected)
- .line(firstElement.x, firstElement.y)
- .position(solidPathSegments.pathElements.length + 1)
- .line(lastElement.x, areaBaseProjected);
- }).forEach(function createArea(areaPath) {
- // For each of our newly created area paths, we'll now create path elements by stringifying our path objects
- // and adding the created DOM elements to the correct series group
- var area = seriesElement.elem('path', {
- d: areaPath.stringify()
- }, options.classNames.area, true);
- // Emit an event for each area that was drawn
- this.eventEmitter.emit('draw', {
- type: 'area',
- values: data.normalized.series[seriesIndex],
- path: areaPath.clone(),
- series: series,
- seriesIndex: seriesIndex,
- axisX: axisX,
- axisY: axisY,
- chartRect: chartRect,
- index: seriesIndex,
- group: seriesElement,
- element: area
- });
- }.bind(this));
- }
- }.bind(this));
- this.eventEmitter.emit('created', {
- bounds: axisY.bounds,
- chartRect: chartRect,
- axisX: axisX,
- axisY: axisY,
- svg: this.svg,
- options: options
- });
- }
- /**
- * This method creates a new line chart.
- *
- * @memberof Chartist.Line
- * @param {String|Node} query A selector query string or directly a DOM element
- * @param {Object} data The data object that needs to consist of a labels and a series array
- * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.
- * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]
- * @return {Object} An object which exposes the API for the created chart
- *
- * @example
- * // Create a simple line chart
- * var data = {
- * // A labels array that can contain any sort of values
- * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
- * // Our series array that contains series objects or in this case series data arrays
- * series: [
- * [5, 2, 4, 2, 0]
- * ]
- * };
- *
- * // As options we currently only set a static size of 300x200 px
- * var options = {
- * width: '300px',
- * height: '200px'
- * };
- *
- * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options
- * new Chartist.Line('.ct-chart', data, options);
- *
- * @example
- * // Use specific interpolation function with configuration from the Chartist.Interpolation module
- *
- * var chart = new Chartist.Line('.ct-chart', {
- * labels: [1, 2, 3, 4, 5],
- * series: [
- * [1, 1, 8, 1, 7]
- * ]
- * }, {
- * lineSmooth: Chartist.Interpolation.cardinal({
- * tension: 0.2
- * })
- * });
- *
- * @example
- * // Create a line chart with responsive options
- *
- * var data = {
- * // A labels array that can contain any sort of values
- * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
- * // Our series array that contains series objects or in this case series data arrays
- * series: [
- * [5, 2, 4, 2, 0]
- * ]
- * };
- *
- * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries.
- * var responsiveOptions = [
- * ['screen and (min-width: 641px) and (max-width: 1024px)', {
- * showPoint: false,
- * axisX: {
- * labelInterpolationFnc: function(value) {
- * // Will return Mon, Tue, Wed etc. on medium screens
- * return value.slice(0, 3);
- * }
- * }
- * }],
- * ['screen and (max-width: 640px)', {
- * showLine: false,
- * axisX: {
- * labelInterpolationFnc: function(value) {
- * // Will return M, T, W etc. on small screens
- * return value[0];
- * }
- * }
- * }]
- * ];
- *
- * new Chartist.Line('.ct-chart', data, null, responsiveOptions);
- *
- */
- function Line(query, data, options, responsiveOptions) {
- Chartist.Line.super.constructor.call(this,
- query,
- data,
- defaultOptions,
- Chartist.extend({}, defaultOptions, options),
- responsiveOptions);
- }
- // Creating line chart type in Chartist namespace
- Chartist.Line = Chartist.Base.extend({
- constructor: Line,
- createChart: createChart
- });
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts.
- *
- * @module Chartist.Bar
- */
- /* global Chartist */
- (function(globalRoot, Chartist){
- 'use strict';
- var window = globalRoot.window;
- var document = globalRoot.document;
- /**
- * Default options in bar charts. Expand the code view to see a detailed list of options with comments.
- *
- * @memberof Chartist.Bar
- */
- var defaultOptions = {
- // Options for X-Axis
- axisX: {
- // The offset of the chart drawing area to the border of the container
- offset: 30,
- // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.
- position: 'end',
- // Allows you to correct label positioning on this axis by positive or negative x and y offset.
- labelOffset: {
- x: 0,
- y: 0
- },
- // If labels should be shown or not
- showLabel: true,
- // If the axis grid should be drawn or not
- showGrid: true,
- // Interpolation function that allows you to intercept the value from the axis label
- labelInterpolationFnc: Chartist.noop,
- // This value specifies the minimum width in pixel of the scale steps
- scaleMinSpace: 30,
- // Use only integer values (whole numbers) for the scale steps
- onlyInteger: false
- },
- // Options for Y-Axis
- axisY: {
- // The offset of the chart drawing area to the border of the container
- offset: 40,
- // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.
- position: 'start',
- // Allows you to correct label positioning on this axis by positive or negative x and y offset.
- labelOffset: {
- x: 0,
- y: 0
- },
- // If labels should be shown or not
- showLabel: true,
- // If the axis grid should be drawn or not
- showGrid: true,
- // Interpolation function that allows you to intercept the value from the axis label
- labelInterpolationFnc: Chartist.noop,
- // This value specifies the minimum height in pixel of the scale steps
- scaleMinSpace: 20,
- // Use only integer values (whole numbers) for the scale steps
- onlyInteger: false
- },
- // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
- width: undefined,
- // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
- height: undefined,
- // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value
- high: undefined,
- // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value
- low: undefined,
- // Unless low/high are explicitly set, bar chart will be centered at zero by default. Set referenceValue to null to auto scale.
- referenceValue: 0,
- // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}
- chartPadding: {
- top: 15,
- right: 15,
- bottom: 5,
- left: 10
- },
- // Specify the distance in pixel of bars in a group
- seriesBarDistance: 15,
- // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options.
- stackBars: false,
- // If set to 'overlap' this property will force the stacked bars to draw from the zero line.
- // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.
- stackMode: 'accumulate',
- // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values.
- horizontalBars: false,
- // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time.
- distributeSeries: false,
- // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
- reverseData: false,
- // If the bar chart should add a background fill to the .ct-grids group.
- showGridBackground: false,
- // Override the class names that get used to generate the SVG structure of the chart
- classNames: {
- chart: 'ct-chart-bar',
- horizontalBars: 'ct-horizontal-bars',
- label: 'ct-label',
- labelGroup: 'ct-labels',
- series: 'ct-series',
- bar: 'ct-bar',
- grid: 'ct-grid',
- gridGroup: 'ct-grids',
- gridBackground: 'ct-grid-background',
- vertical: 'ct-vertical',
- horizontal: 'ct-horizontal',
- start: 'ct-start',
- end: 'ct-end'
- }
- };
- /**
- * Creates a new chart
- *
- */
- function createChart(options) {
- var data;
- var highLow;
- if(options.distributeSeries) {
- data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');
- data.normalized.series = data.normalized.series.map(function(value) {
- return [value];
- });
- } else {
- data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');
- }
- // Create new svg element
- this.svg = Chartist.createSvg(
- this.container,
- options.width,
- options.height,
- options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')
- );
- // Drawing groups in correct order
- var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);
- var seriesGroup = this.svg.elem('g');
- var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);
- if(options.stackBars && data.normalized.series.length !== 0) {
- // If stacked bars we need to calculate the high low from stacked values from each series
- var serialSums = Chartist.serialMap(data.normalized.series, function serialSums() {
- return Array.prototype.slice.call(arguments).map(function(value) {
- return value;
- }).reduce(function(prev, curr) {
- return {
- x: prev.x + (curr && curr.x) || 0,
- y: prev.y + (curr && curr.y) || 0
- };
- }, {x: 0, y: 0});
- });
- highLow = Chartist.getHighLow([serialSums], options, options.horizontalBars ? 'x' : 'y');
- } else {
- highLow = Chartist.getHighLow(data.normalized.series, options, options.horizontalBars ? 'x' : 'y');
- }
- // Overrides of high / low from settings
- highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);
- highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);
- var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);
- var valueAxis,
- labelAxisTicks,
- labelAxis,
- axisX,
- axisY;
- // We need to set step count based on some options combinations
- if(options.distributeSeries && options.stackBars) {
- // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should
- // use only the first label for the step axis
- labelAxisTicks = data.normalized.labels.slice(0, 1);
- } else {
- // If distributed series are enabled but stacked bars aren't, we should use the series labels
- // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array
- // as the bars are normalized
- labelAxisTicks = data.normalized.labels;
- }
- // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.
- if(options.horizontalBars) {
- if(options.axisX.type === undefined) {
- valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {
- highLow: highLow,
- referenceValue: 0
- }));
- } else {
- valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {
- highLow: highLow,
- referenceValue: 0
- }));
- }
- if(options.axisY.type === undefined) {
- labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, {
- ticks: labelAxisTicks
- });
- } else {
- labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);
- }
- } else {
- if(options.axisX.type === undefined) {
- labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, {
- ticks: labelAxisTicks
- });
- } else {
- labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);
- }
- if(options.axisY.type === undefined) {
- valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {
- highLow: highLow,
- referenceValue: 0
- }));
- } else {
- valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {
- highLow: highLow,
- referenceValue: 0
- }));
- }
- }
- // Projected 0 point
- var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));
- // Used to track the screen coordinates of stacked bars
- var stackedBarValues = [];
- labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);
- valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);
- if (options.showGridBackground) {
- Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);
- }
- // Draw the series
- data.raw.series.forEach(function(series, seriesIndex) {
- // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.
- var biPol = seriesIndex - (data.raw.series.length - 1) / 2;
- // Half of the period width between vertical grid lines used to position bars
- var periodHalfLength;
- // Current series SVG element
- var seriesElement;
- // We need to set periodHalfLength based on some options combinations
- if(options.distributeSeries && !options.stackBars) {
- // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array
- // which is the series count and divide by 2
- periodHalfLength = labelAxis.axisLength / data.normalized.series.length / 2;
- } else if(options.distributeSeries && options.stackBars) {
- // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis
- // length by 2
- periodHalfLength = labelAxis.axisLength / 2;
- } else {
- // On regular bar charts we should just use the series length
- periodHalfLength = labelAxis.axisLength / data.normalized.series[seriesIndex].length / 2;
- }
- // Adding the series group to the series element
- seriesElement = seriesGroup.elem('g');
- // Write attributes to series group element. If series name or meta is undefined the attributes will not be written
- seriesElement.attr({
- 'ct:series-name': series.name,
- 'ct:meta': Chartist.serialize(series.meta)
- });
- // Use series class from series data or if not set generate one
- seriesElement.addClass([
- options.classNames.series,
- (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))
- ].join(' '));
- data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {
- var projected,
- bar,
- previousStack,
- labelAxisValueIndex;
- // We need to set labelAxisValueIndex based on some options combinations
- if(options.distributeSeries && !options.stackBars) {
- // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection
- // on the step axis for label positioning
- labelAxisValueIndex = seriesIndex;
- } else if(options.distributeSeries && options.stackBars) {
- // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use
- // 0 for projection on the label step axis
- labelAxisValueIndex = 0;
- } else {
- // On regular bar charts we just use the value index to project on the label step axis
- labelAxisValueIndex = valueIndex;
- }
- // We need to transform coordinates differently based on the chart layout
- if(options.horizontalBars) {
- projected = {
- x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized.series[seriesIndex]),
- y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized.series[seriesIndex])
- };
- } else {
- projected = {
- x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]),
- y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized.series[seriesIndex])
- }
- }
- // If the label axis is a step based axis we will offset the bar into the middle of between two steps using
- // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using
- // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not
- // add any automated positioning.
- if(labelAxis instanceof Chartist.StepAxis) {
- // Offset to center bar between grid lines, but only if the step axis is not stretched
- if(!labelAxis.options.stretch) {
- projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);
- }
- // Using bi-polar offset for multiple series if no stacked bars or series distribution is used
- projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);
- }
- // Enter value in stacked bar values used to remember previous screen value for stacking up bars
- previousStack = stackedBarValues[valueIndex] || zeroPoint;
- stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);
- // Skip if value is undefined
- if(value === undefined) {
- return;
- }
- var positions = {};
- positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];
- positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];
- if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {
- // Stack mode: accumulate (default)
- // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line
- // We want backwards compatibility, so the expected fallback without the 'stackMode' option
- // to be the original behaviour (accumulate)
- positions[labelAxis.counterUnits.pos + '1'] = previousStack;
- positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];
- } else {
- // Draw from the zero line normally
- // This is also the same code for Stack mode: overlap
- positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;
- positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];
- }
- // Limit x and y so that they are within the chart rect
- positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);
- positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);
- positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);
- positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);
- var metaData = Chartist.getMetaData(series, valueIndex);
- // Create bar element
- bar = seriesElement.elem('line', positions, options.classNames.bar).attr({
- 'ct:value': [value.x, value.y].filter(Chartist.isNumeric).join(','),
- 'ct:meta': Chartist.serialize(metaData)
- });
- this.eventEmitter.emit('draw', Chartist.extend({
- type: 'bar',
- value: value,
- index: valueIndex,
- meta: metaData,
- series: series,
- seriesIndex: seriesIndex,
- axisX: axisX,
- axisY: axisY,
- chartRect: chartRect,
- group: seriesElement,
- element: bar
- }, positions));
- }.bind(this));
- }.bind(this));
- this.eventEmitter.emit('created', {
- bounds: valueAxis.bounds,
- chartRect: chartRect,
- axisX: axisX,
- axisY: axisY,
- svg: this.svg,
- options: options
- });
- }
- /**
- * This method creates a new bar chart and returns API object that you can use for later changes.
- *
- * @memberof Chartist.Bar
- * @param {String|Node} query A selector query string or directly a DOM element
- * @param {Object} data The data object that needs to consist of a labels and a series array
- * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.
- * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]
- * @return {Object} An object which exposes the API for the created chart
- *
- * @example
- * // Create a simple bar chart
- * var data = {
- * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
- * series: [
- * [5, 2, 4, 2, 0]
- * ]
- * };
- *
- * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object.
- * new Chartist.Bar('.ct-chart', data);
- *
- * @example
- * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10
- * new Chartist.Bar('.ct-chart', {
- * labels: [1, 2, 3, 4, 5, 6, 7],
- * series: [
- * [1, 3, 2, -5, -3, 1, -6],
- * [-5, -2, -4, -1, 2, -3, 1]
- * ]
- * }, {
- * seriesBarDistance: 12,
- * low: -10,
- * high: 10
- * });
- *
- */
- function Bar(query, data, options, responsiveOptions) {
- Chartist.Bar.super.constructor.call(this,
- query,
- data,
- defaultOptions,
- Chartist.extend({}, defaultOptions, options),
- responsiveOptions);
- }
- // Creating bar chart type in Chartist namespace
- Chartist.Bar = Chartist.Base.extend({
- constructor: Bar,
- createChart: createChart
- });
- }(this || __webpack_require__.g, Chartist));
- ;/**
- * The pie chart module of Chartist that can be used to draw pie, donut or gauge charts
- *
- * @module Chartist.Pie
- */
- /* global Chartist */
- (function(globalRoot, Chartist) {
- 'use strict';
- var window = globalRoot.window;
- var document = globalRoot.document;
- /**
- * Default options in line charts. Expand the code view to see a detailed list of options with comments.
- *
- * @memberof Chartist.Pie
- */
- var defaultOptions = {
- // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
- width: undefined,
- // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
- height: undefined,
- // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}
- chartPadding: 5,
- // Override the class names that are used to generate the SVG structure of the chart
- classNames: {
- chartPie: 'ct-chart-pie',
- chartDonut: 'ct-chart-donut',
- series: 'ct-series',
- slicePie: 'ct-slice-pie',
- sliceDonut: 'ct-slice-donut',
- sliceDonutSolid: 'ct-slice-donut-solid',
- label: 'ct-label'
- },
- // The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise.
- startAngle: 0,
- // An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts.
- total: undefined,
- // If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices.
- donut: false,
- // If specified the donut segments will be drawn as shapes instead of strokes.
- donutSolid: false,
- // Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future.
- // This option can be set as number or string to specify a relative width (i.e. 100 or '30%').
- donutWidth: 60,
- // If a label should be shown or not
- showLabel: true,
- // Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center.
- labelOffset: 0,
- // This option can be set to 'inside', 'outside' or 'center'. Positioned with 'inside' the labels will be placed on half the distance of the radius to the border of the Pie by respecting the 'labelOffset'. The 'outside' option will place the labels at the border of the pie and 'center' will place the labels in the absolute center point of the chart. The 'center' option only makes sense in conjunction with the 'labelOffset' option.
- labelPosition: 'inside',
- // An interpolation function for the label value
- labelInterpolationFnc: Chartist.noop,
- // Label direction can be 'neutral', 'explode' or 'implode'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center.
- labelDirection: 'neutral',
- // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
- reverseData: false,
- // If true empty values will be ignored to avoid drawing unncessary slices and labels
- ignoreEmptyValues: false
- };
- /**
- * Determines SVG anchor position based on direction and center parameter
- *
- * @param center
- * @param label
- * @param direction
- * @return {string}
- */
- function determineAnchorPosition(center, label, direction) {
- var toTheRight = label.x > center.x;
- if(toTheRight && direction === 'explode' ||
- !toTheRight && direction === 'implode') {
- return 'start';
- } else if(toTheRight && direction === 'implode' ||
- !toTheRight && direction === 'explode') {
- return 'end';
- } else {
- return 'middle';
- }
- }
- /**
- * Creates the pie chart
- *
- * @param options
- */
- function createChart(options) {
- var data = Chartist.normalizeData(this.data);
- var seriesGroups = [],
- labelsGroup,
- chartRect,
- radius,
- labelRadius,
- totalDataSum,
- startAngle = options.startAngle;
- // Create SVG.js draw
- this.svg = Chartist.createSvg(this.container, options.width, options.height,options.donut ? options.classNames.chartDonut : options.classNames.chartPie);
- // Calculate charting rect
- chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);
- // Get biggest circle radius possible within chartRect
- radius = Math.min(chartRect.width() / 2, chartRect.height() / 2);
- // Calculate total of all series to get reference value or use total reference from optional options
- totalDataSum = options.total || data.normalized.series.reduce(function(previousValue, currentValue) {
- return previousValue + currentValue;
- }, 0);
- var donutWidth = Chartist.quantity(options.donutWidth);
- if (donutWidth.unit === '%') {
- donutWidth.value *= radius / 100;
- }
- // If this is a donut chart we need to adjust our radius to enable strokes to be drawn inside
- // Unfortunately this is not possible with the current SVG Spec
- // See this proposal for more details: http://lists.w3.org/Archives/Public/www-svg/2003Oct/0000.html
- radius -= options.donut && !options.donutSolid ? donutWidth.value / 2 : 0;
- // If labelPosition is set to `outside` or a donut chart is drawn then the label position is at the radius,
- // if regular pie chart it's half of the radius
- if(options.labelPosition === 'outside' || options.donut && !options.donutSolid) {
- labelRadius = radius;
- } else if(options.labelPosition === 'center') {
- // If labelPosition is center we start with 0 and will later wait for the labelOffset
- labelRadius = 0;
- } else if(options.donutSolid) {
- labelRadius = radius - donutWidth.value / 2;
- } else {
- // Default option is 'inside' where we use half the radius so the label will be placed in the center of the pie
- // slice
- labelRadius = radius / 2;
- }
- // Add the offset to the labelRadius where a negative offset means closed to the center of the chart
- labelRadius += options.labelOffset;
- // Calculate end angle based on total sum and current data value and offset with padding
- var center = {
- x: chartRect.x1 + chartRect.width() / 2,
- y: chartRect.y2 + chartRect.height() / 2
- };
- // Check if there is only one non-zero value in the series array.
- var hasSingleValInSeries = data.raw.series.filter(function(val) {
- return val.hasOwnProperty('value') ? val.value !== 0 : val !== 0;
- }).length === 1;
- // Creating the series groups
- data.raw.series.forEach(function(series, index) {
- seriesGroups[index] = this.svg.elem('g', null, null);
- }.bind(this));
- //if we need to show labels we create the label group now
- if(options.showLabel) {
- labelsGroup = this.svg.elem('g', null, null);
- }
- // Draw the series
- // initialize series groups
- data.raw.series.forEach(function(series, index) {
- // If current value is zero and we are ignoring empty values then skip to next value
- if (data.normalized.series[index] === 0 && options.ignoreEmptyValues) return;
- // If the series is an object and contains a name or meta data we add a custom attribute
- seriesGroups[index].attr({
- 'ct:series-name': series.name
- });
- // Use series class from series data or if not set generate one
- seriesGroups[index].addClass([
- options.classNames.series,
- (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(index))
- ].join(' '));
- // If the whole dataset is 0 endAngle should be zero. Can't divide by 0.
- var endAngle = (totalDataSum > 0 ? startAngle + data.normalized.series[index] / totalDataSum * 360 : 0);
- // Use slight offset so there are no transparent hairline issues
- var overlappigStartAngle = Math.max(0, startAngle - (index === 0 || hasSingleValInSeries ? 0 : 0.2));
- // If we need to draw the arc for all 360 degrees we need to add a hack where we close the circle
- // with Z and use 359.99 degrees
- if(endAngle - overlappigStartAngle >= 359.99) {
- endAngle = overlappigStartAngle + 359.99;
- }
- var start = Chartist.polarToCartesian(center.x, center.y, radius, overlappigStartAngle),
- end = Chartist.polarToCartesian(center.x, center.y, radius, endAngle);
- var innerStart,
- innerEnd,
- donutSolidRadius;
- // Create a new path element for the pie chart. If this isn't a donut chart we should close the path for a correct stroke
- var path = new Chartist.Svg.Path(!options.donut || options.donutSolid)
- .move(end.x, end.y)
- .arc(radius, radius, 0, endAngle - startAngle > 180, 0, start.x, start.y);
- // If regular pie chart (no donut) we add a line to the center of the circle for completing the pie
- if(!options.donut) {
- path.line(center.x, center.y);
- } else if (options.donutSolid) {
- donutSolidRadius = radius - donutWidth.value;
- innerStart = Chartist.polarToCartesian(center.x, center.y, donutSolidRadius, startAngle - (index === 0 || hasSingleValInSeries ? 0 : 0.2));
- innerEnd = Chartist.polarToCartesian(center.x, center.y, donutSolidRadius, endAngle);
- path.line(innerStart.x, innerStart.y);
- path.arc(donutSolidRadius, donutSolidRadius, 0, endAngle - startAngle > 180, 1, innerEnd.x, innerEnd.y);
- }
- // Create the SVG path
- // If this is a donut chart we add the donut class, otherwise just a regular slice
- var pathClassName = options.classNames.slicePie;
- if (options.donut) {
- pathClassName = options.classNames.sliceDonut;
- if (options.donutSolid) {
- pathClassName = options.classNames.sliceDonutSolid;
- }
- }
- var pathElement = seriesGroups[index].elem('path', {
- d: path.stringify()
- }, pathClassName);
- // Adding the pie series value to the path
- pathElement.attr({
- 'ct:value': data.normalized.series[index],
- 'ct:meta': Chartist.serialize(series.meta)
- });
- // If this is a donut, we add the stroke-width as style attribute
- if(options.donut && !options.donutSolid) {
- pathElement._node.style.strokeWidth = donutWidth.value + 'px';
- }
- // Fire off draw event
- this.eventEmitter.emit('draw', {
- type: 'slice',
- value: data.normalized.series[index],
- totalDataSum: totalDataSum,
- index: index,
- meta: series.meta,
- series: series,
- group: seriesGroups[index],
- element: pathElement,
- path: path.clone(),
- center: center,
- radius: radius,
- startAngle: startAngle,
- endAngle: endAngle
- });
- // If we need to show labels we need to add the label for this slice now
- if(options.showLabel) {
- var labelPosition;
- if(data.raw.series.length === 1) {
- // If we have only 1 series, we can position the label in the center of the pie
- labelPosition = {
- x: center.x,
- y: center.y
- };
- } else {
- // Position at the labelRadius distance from center and between start and end angle
- labelPosition = Chartist.polarToCartesian(
- center.x,
- center.y,
- labelRadius,
- startAngle + (endAngle - startAngle) / 2
- );
- }
- var rawValue;
- if(data.normalized.labels && !Chartist.isFalseyButZero(data.normalized.labels[index])) {
- rawValue = data.normalized.labels[index];
- } else {
- rawValue = data.normalized.series[index];
- }
- var interpolatedValue = options.labelInterpolationFnc(rawValue, index);
- if(interpolatedValue || interpolatedValue === 0) {
- var labelElement = labelsGroup.elem('text', {
- dx: labelPosition.x,
- dy: labelPosition.y,
- 'text-anchor': determineAnchorPosition(center, labelPosition, options.labelDirection)
- }, options.classNames.label).text('' + interpolatedValue);
- // Fire off draw event
- this.eventEmitter.emit('draw', {
- type: 'label',
- index: index,
- group: labelsGroup,
- element: labelElement,
- text: '' + interpolatedValue,
- x: labelPosition.x,
- y: labelPosition.y
- });
- }
- }
- // Set next startAngle to current endAngle.
- // (except for last slice)
- startAngle = endAngle;
- }.bind(this));
- this.eventEmitter.emit('created', {
- chartRect: chartRect,
- svg: this.svg,
- options: options
- });
- }
- /**
- * This method creates a new pie chart and returns an object that can be used to redraw the chart.
- *
- * @memberof Chartist.Pie
- * @param {String|Node} query A selector query string or directly a DOM element
- * @param {Object} data The data object in the pie chart needs to have a series property with a one dimensional data array. The values will be normalized against each other and don't necessarily need to be in percentage. The series property can also be an array of value objects that contain a value property and a className property to override the CSS class name for the series group.
- * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.
- * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]
- * @return {Object} An object with a version and an update method to manually redraw the chart
- *
- * @example
- * // Simple pie chart example with four series
- * new Chartist.Pie('.ct-chart', {
- * series: [10, 2, 4, 3]
- * });
- *
- * @example
- * // Drawing a donut chart
- * new Chartist.Pie('.ct-chart', {
- * series: [10, 2, 4, 3]
- * }, {
- * donut: true
- * });
- *
- * @example
- * // Using donut, startAngle and total to draw a gauge chart
- * new Chartist.Pie('.ct-chart', {
- * series: [20, 10, 30, 40]
- * }, {
- * donut: true,
- * donutWidth: 20,
- * startAngle: 270,
- * total: 200
- * });
- *
- * @example
- * // Drawing a pie chart with padding and labels that are outside the pie
- * new Chartist.Pie('.ct-chart', {
- * series: [20, 10, 30, 40]
- * }, {
- * chartPadding: 30,
- * labelOffset: 50,
- * labelDirection: 'explode'
- * });
- *
- * @example
- * // Overriding the class names for individual series as well as a name and meta data.
- * // The name will be written as ct:series-name attribute and the meta data will be serialized and written
- * // to a ct:meta attribute.
- * new Chartist.Pie('.ct-chart', {
- * series: [{
- * value: 20,
- * name: 'Series 1',
- * className: 'my-custom-class-one',
- * meta: 'Meta One'
- * }, {
- * value: 10,
- * name: 'Series 2',
- * className: 'my-custom-class-two',
- * meta: 'Meta Two'
- * }, {
- * value: 70,
- * name: 'Series 3',
- * className: 'my-custom-class-three',
- * meta: 'Meta Three'
- * }]
- * });
- */
- function Pie(query, data, options, responsiveOptions) {
- Chartist.Pie.super.constructor.call(this,
- query,
- data,
- defaultOptions,
- Chartist.extend({}, defaultOptions, options),
- responsiveOptions);
- }
- // Creating pie chart type in Chartist namespace
- Chartist.Pie = Chartist.Base.extend({
- constructor: Pie,
- createChart: createChart,
- determineAnchorPosition: determineAnchorPosition
- });
- }(this || __webpack_require__.g, Chartist));
- return Chartist;
- }));
- /***/ }),
- /***/ 23350:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,
- emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,
- unorderedListRE = /[*+-]\s/;
- CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
- if (cm.getOption("disableInput")) return CodeMirror.Pass;
- var ranges = cm.listSelections(), replacements = [];
- for (var i = 0; i < ranges.length; i++) {
- var pos = ranges[i].head;
- // If we're not in Markdown mode, fall back to normal newlineAndIndent
- var eolState = cm.getStateAfter(pos.line);
- var inner = CodeMirror.innerMode(cm.getMode(), eolState);
- if (inner.mode.name !== "markdown" && inner.mode.helperType !== "markdown") {
- cm.execCommand("newlineAndIndent");
- return;
- } else {
- eolState = inner.state;
- }
- var inList = eolState.list !== false;
- var inQuote = eolState.quote !== 0;
- var line = cm.getLine(pos.line), match = listRE.exec(line);
- var cursorBeforeBullet = /^\s*$/.test(line.slice(0, pos.ch));
- if (!ranges[i].empty() || (!inList && !inQuote) || !match || cursorBeforeBullet) {
- cm.execCommand("newlineAndIndent");
- return;
- }
- if (emptyListRE.test(line)) {
- var endOfQuote = inQuote && />\s*$/.test(line)
- var endOfList = !/>\s*$/.test(line)
- if (endOfQuote || endOfList) cm.replaceRange("", {
- line: pos.line, ch: 0
- }, {
- line: pos.line, ch: pos.ch + 1
- });
- replacements[i] = "\n";
- } else {
- var indent = match[1], after = match[5];
- var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
- var bullet = numbered ? (parseInt(match[3], 10) + 1) + match[4] : match[2].replace("x", " ");
- replacements[i] = "\n" + indent + bullet + after;
- if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
- }
- }
- cm.replaceSelections(replacements);
- };
- // Auto-updating Markdown list numbers when a new item is added to the
- // middle of a list
- function incrementRemainingMarkdownListNumbers(cm, pos) {
- var startLine = pos.line, lookAhead = 0, skipCount = 0;
- var startItem = listRE.exec(cm.getLine(startLine)), startIndent = startItem[1];
- do {
- lookAhead += 1;
- var nextLineNumber = startLine + lookAhead;
- var nextLine = cm.getLine(nextLineNumber), nextItem = listRE.exec(nextLine);
- if (nextItem) {
- var nextIndent = nextItem[1];
- var newNumber = (parseInt(startItem[3], 10) + lookAhead - skipCount);
- var nextNumber = (parseInt(nextItem[3], 10)), itemNumber = nextNumber;
- if (startIndent === nextIndent && !isNaN(nextNumber)) {
- if (newNumber === nextNumber) itemNumber = nextNumber + 1;
- if (newNumber > nextNumber) itemNumber = newNumber + 1;
- cm.replaceRange(
- nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
- {
- line: nextLineNumber, ch: 0
- }, {
- line: nextLineNumber, ch: nextLine.length
- });
- } else {
- if (startIndent.length > nextIndent.length) return;
- // This doesn't run if the next line immediately indents, as it is
- // not clear of the users intention (new indented item or same level)
- if ((startIndent.length < nextIndent.length) && (lookAhead === 1)) return;
- skipCount += 1;
- }
- }
- } while (nextItem);
- }
- });
- /***/ }),
- /***/ 41423:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- // Depends on csslint.js from https://github.com/stubbornella/csslint
- // declare global: CSSLint
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.registerHelper("lint", "css", function(text, options) {
- var found = [];
- if (!window.CSSLint) {
- if (window.console) {
- window.console.error("Error: window.CSSLint not defined, CodeMirror CSS linting cannot run.");
- }
- return found;
- }
- var results = CSSLint.verify(text, options), messages = results.messages, message = null;
- for ( var i = 0; i < messages.length; i++) {
- message = messages[i];
- var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col;
- found.push({
- from: CodeMirror.Pos(startLine, startCol),
- to: CodeMirror.Pos(endLine, endCol),
- message: message.message,
- severity : message.type
- });
- }
- return found;
- });
- });
- /***/ }),
- /***/ 96477:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- // Depends on jshint.js from https://github.com/jshint/jshint
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- // declare global: JSHINT
- function validator(text, options) {
- if (!window.JSHINT) {
- if (window.console) {
- window.console.error("Error: window.JSHINT not defined, CodeMirror JavaScript linting cannot run.");
- }
- return [];
- }
- if (!options.indent) // JSHint error.character actually is a column index, this fixes underlining on lines using tabs for indentation
- options.indent = 1; // JSHint default value is 4
- JSHINT(text, options, options.globals);
- var errors = JSHINT.data().errors, result = [];
- if (errors) parseErrors(errors, result);
- return result;
- }
- CodeMirror.registerHelper("lint", "javascript", validator);
- function parseErrors(errors, output) {
- for ( var i = 0; i < errors.length; i++) {
- var error = errors[i];
- if (error) {
- if (error.line <= 0) {
- if (window.console) {
- window.console.warn("Cannot display JSHint error (invalid line " + error.line + ")", error);
- }
- continue;
- }
- var start = error.character - 1, end = start + 1;
- if (error.evidence) {
- var index = error.evidence.substring(start).search(/.\b/);
- if (index > -1) {
- end += index;
- }
- }
- // Convert to format expected by validation service
- var hint = {
- message: error.reason,
- severity: error.code ? (error.code.startsWith('W') ? "warning" : "error") : "error",
- from: CodeMirror.Pos(error.line - 1, start),
- to: CodeMirror.Pos(error.line - 1, end)
- };
- output.push(hint);
- }
- }
- }
- });
- /***/ }),
- /***/ 62193:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- // Depends on jsonlint.js from https://github.com/zaach/jsonlint
- // declare global: jsonlint
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.registerHelper("lint", "json", function(text) {
- var found = [];
- if (!window.jsonlint) {
- if (window.console) {
- window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.");
- }
- return found;
- }
- // for jsonlint's web dist jsonlint is exported as an object with a single property parser, of which parseError
- // is a subproperty
- var jsonlint = window.jsonlint.parser || window.jsonlint
- jsonlint.parseError = function(str, hash) {
- var loc = hash.loc;
- found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
- to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
- message: str});
- };
- try { jsonlint.parse(text); }
- catch(e) {}
- return found;
- });
- });
- /***/ }),
- /***/ 3256:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- var GUTTER_ID = "CodeMirror-lint-markers";
- var LINT_LINE_ID = "CodeMirror-lint-line-";
- function showTooltip(cm, e, content) {
- var tt = document.createElement("div");
- tt.className = "CodeMirror-lint-tooltip cm-s-" + cm.options.theme;
- tt.appendChild(content.cloneNode(true));
- if (cm.state.lint.options.selfContain)
- cm.getWrapperElement().appendChild(tt);
- else
- document.body.appendChild(tt);
- function position(e) {
- if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
- tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
- tt.style.left = (e.clientX + 5) + "px";
- }
- CodeMirror.on(document, "mousemove", position);
- position(e);
- if (tt.style.opacity != null) tt.style.opacity = 1;
- return tt;
- }
- function rm(elt) {
- if (elt.parentNode) elt.parentNode.removeChild(elt);
- }
- function hideTooltip(tt) {
- if (!tt.parentNode) return;
- if (tt.style.opacity == null) rm(tt);
- tt.style.opacity = 0;
- setTimeout(function() { rm(tt); }, 600);
- }
- function showTooltipFor(cm, e, content, node) {
- var tooltip = showTooltip(cm, e, content);
- function hide() {
- CodeMirror.off(node, "mouseout", hide);
- if (tooltip) { hideTooltip(tooltip); tooltip = null; }
- }
- var poll = setInterval(function() {
- if (tooltip) for (var n = node;; n = n.parentNode) {
- if (n && n.nodeType == 11) n = n.host;
- if (n == document.body) return;
- if (!n) { hide(); break; }
- }
- if (!tooltip) return clearInterval(poll);
- }, 400);
- CodeMirror.on(node, "mouseout", hide);
- }
- function LintState(cm, conf, hasGutter) {
- this.marked = [];
- if (conf instanceof Function) conf = {getAnnotations: conf};
- if (!conf || conf === true) conf = {};
- this.options = {};
- this.linterOptions = conf.options || {};
- for (var prop in defaults) this.options[prop] = defaults[prop];
- for (var prop in conf) {
- if (defaults.hasOwnProperty(prop)) {
- if (conf[prop] != null) this.options[prop] = conf[prop];
- } else if (!conf.options) {
- this.linterOptions[prop] = conf[prop];
- }
- }
- this.timeout = null;
- this.hasGutter = hasGutter;
- this.onMouseOver = function(e) { onMouseOver(cm, e); };
- this.waitingFor = 0
- }
- var defaults = {
- highlightLines: false,
- tooltips: true,
- delay: 500,
- lintOnChange: true,
- getAnnotations: null,
- async: false,
- selfContain: null,
- formatAnnotation: null,
- onUpdateLinting: null
- }
- function clearMarks(cm) {
- var state = cm.state.lint;
- if (state.hasGutter) cm.clearGutter(GUTTER_ID);
- if (state.options.highlightLines) clearErrorLines(cm);
- for (var i = 0; i < state.marked.length; ++i)
- state.marked[i].clear();
- state.marked.length = 0;
- }
- function clearErrorLines(cm) {
- cm.eachLine(function(line) {
- var has = line.wrapClass && /\bCodeMirror-lint-line-\w+\b/.exec(line.wrapClass);
- if (has) cm.removeLineClass(line, "wrap", has[0]);
- })
- }
- function makeMarker(cm, labels, severity, multiple, tooltips) {
- var marker = document.createElement("div"), inner = marker;
- marker.className = "CodeMirror-lint-marker CodeMirror-lint-marker-" + severity;
- if (multiple) {
- inner = marker.appendChild(document.createElement("div"));
- inner.className = "CodeMirror-lint-marker CodeMirror-lint-marker-multiple";
- }
- if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) {
- showTooltipFor(cm, e, labels, inner);
- });
- return marker;
- }
- function getMaxSeverity(a, b) {
- if (a == "error") return a;
- else return b;
- }
- function groupByLine(annotations) {
- var lines = [];
- for (var i = 0; i < annotations.length; ++i) {
- var ann = annotations[i], line = ann.from.line;
- (lines[line] || (lines[line] = [])).push(ann);
- }
- return lines;
- }
- function annotationTooltip(ann) {
- var severity = ann.severity;
- if (!severity) severity = "error";
- var tip = document.createElement("div");
- tip.className = "CodeMirror-lint-message CodeMirror-lint-message-" + severity;
- if (typeof ann.messageHTML != 'undefined') {
- tip.innerHTML = ann.messageHTML;
- } else {
- tip.appendChild(document.createTextNode(ann.message));
- }
- return tip;
- }
- function lintAsync(cm, getAnnotations) {
- var state = cm.state.lint
- var id = ++state.waitingFor
- function abort() {
- id = -1
- cm.off("change", abort)
- }
- cm.on("change", abort)
- getAnnotations(cm.getValue(), function(annotations, arg2) {
- cm.off("change", abort)
- if (state.waitingFor != id) return
- if (arg2 && annotations instanceof CodeMirror) annotations = arg2
- cm.operation(function() {updateLinting(cm, annotations)})
- }, state.linterOptions, cm);
- }
- function startLinting(cm) {
- var state = cm.state.lint;
- if (!state) return;
- var options = state.options;
- /*
- * Passing rules in `options` property prevents JSHint (and other linters) from complaining
- * about unrecognized rules like `onUpdateLinting`, `delay`, `lintOnChange`, etc.
- */
- var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
- if (!getAnnotations) return;
- if (options.async || getAnnotations.async) {
- lintAsync(cm, getAnnotations)
- } else {
- var annotations = getAnnotations(cm.getValue(), state.linterOptions, cm);
- if (!annotations) return;
- if (annotations.then) annotations.then(function(issues) {
- cm.operation(function() {updateLinting(cm, issues)})
- });
- else cm.operation(function() {updateLinting(cm, annotations)})
- }
- }
- function updateLinting(cm, annotationsNotSorted) {
- var state = cm.state.lint;
- if (!state) return;
- var options = state.options;
- clearMarks(cm);
- var annotations = groupByLine(annotationsNotSorted);
- for (var line = 0; line < annotations.length; ++line) {
- var anns = annotations[line];
- if (!anns) continue;
- // filter out duplicate messages
- var message = [];
- anns = anns.filter(function(item) { return message.indexOf(item.message) > -1 ? false : message.push(item.message) });
- var maxSeverity = null;
- var tipLabel = state.hasGutter && document.createDocumentFragment();
- for (var i = 0; i < anns.length; ++i) {
- var ann = anns[i];
- var severity = ann.severity;
- if (!severity) severity = "error";
- maxSeverity = getMaxSeverity(maxSeverity, severity);
- if (options.formatAnnotation) ann = options.formatAnnotation(ann);
- if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));
- if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {
- className: "CodeMirror-lint-mark CodeMirror-lint-mark-" + severity,
- __annotation: ann
- }));
- }
- // use original annotations[line] to show multiple messages
- if (state.hasGutter)
- cm.setGutterMarker(line, GUTTER_ID, makeMarker(cm, tipLabel, maxSeverity, annotations[line].length > 1,
- options.tooltips));
- if (options.highlightLines)
- cm.addLineClass(line, "wrap", LINT_LINE_ID + maxSeverity);
- }
- if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);
- }
- function onChange(cm) {
- var state = cm.state.lint;
- if (!state) return;
- clearTimeout(state.timeout);
- state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay);
- }
- function popupTooltips(cm, annotations, e) {
- var target = e.target || e.srcElement;
- var tooltip = document.createDocumentFragment();
- for (var i = 0; i < annotations.length; i++) {
- var ann = annotations[i];
- tooltip.appendChild(annotationTooltip(ann));
- }
- showTooltipFor(cm, e, tooltip, target);
- }
- function onMouseOver(cm, e) {
- var target = e.target || e.srcElement;
- if (!/\bCodeMirror-lint-mark-/.test(target.className)) return;
- var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2;
- var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client"));
- var annotations = [];
- for (var i = 0; i < spans.length; ++i) {
- var ann = spans[i].__annotation;
- if (ann) annotations.push(ann);
- }
- if (annotations.length) popupTooltips(cm, annotations, e);
- }
- CodeMirror.defineOption("lint", false, function(cm, val, old) {
- if (old && old != CodeMirror.Init) {
- clearMarks(cm);
- if (cm.state.lint.options.lintOnChange !== false)
- cm.off("change", onChange);
- CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
- clearTimeout(cm.state.lint.timeout);
- delete cm.state.lint;
- }
- if (val) {
- var gutters = cm.getOption("gutters"), hasLintGutter = false;
- for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
- var state = cm.state.lint = new LintState(cm, val, hasLintGutter);
- if (state.options.lintOnChange)
- cm.on("change", onChange);
- if (state.options.tooltips != false && state.options.tooltips != "gutter")
- CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
- startLinting(cm);
- }
- });
- CodeMirror.defineExtension("performLint", function() {
- startLinting(this);
- });
- });
- /***/ }),
- /***/ 82783:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- // Depends on js-yaml.js from https://github.com/nodeca/js-yaml
- // declare global: jsyaml
- CodeMirror.registerHelper("lint", "yaml", function(text) {
- var found = [];
- if (!window.jsyaml) {
- if (window.console) {
- window.console.error("Error: window.jsyaml not defined, CodeMirror YAML linting cannot run.");
- }
- return found;
- }
- try { jsyaml.loadAll(text); }
- catch(e) {
- var loc = e.mark,
- // js-yaml YAMLException doesn't always provide an accurate lineno
- // e.g., when there are multiple yaml docs
- // ---
- // ---
- // foo:bar
- from = loc ? CodeMirror.Pos(loc.line, loc.column) : CodeMirror.Pos(0, 0),
- to = from;
- found.push({ from: from, to: to, message: e.message });
- }
- return found;
- });
- });
- /***/ }),
- /***/ 87093:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.multiplexingMode = function(outer /*, others */) {
- // Others should be {open, close, mode [, delimStyle] [, innerStyle] [, parseDelimiters]} objects
- var others = Array.prototype.slice.call(arguments, 1);
- function indexOf(string, pattern, from, returnEnd) {
- if (typeof pattern == "string") {
- var found = string.indexOf(pattern, from);
- return returnEnd && found > -1 ? found + pattern.length : found;
- }
- var m = pattern.exec(from ? string.slice(from) : string);
- return m ? m.index + from + (returnEnd ? m[0].length : 0) : -1;
- }
- return {
- startState: function() {
- return {
- outer: CodeMirror.startState(outer),
- innerActive: null,
- inner: null,
- startingInner: false
- };
- },
- copyState: function(state) {
- return {
- outer: CodeMirror.copyState(outer, state.outer),
- innerActive: state.innerActive,
- inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner),
- startingInner: state.startingInner
- };
- },
- token: function(stream, state) {
- if (!state.innerActive) {
- var cutOff = Infinity, oldContent = stream.string;
- for (var i = 0; i < others.length; ++i) {
- var other = others[i];
- var found = indexOf(oldContent, other.open, stream.pos);
- if (found == stream.pos) {
- if (!other.parseDelimiters) stream.match(other.open);
- state.startingInner = !!other.parseDelimiters
- state.innerActive = other;
- // Get the outer indent, making sure to handle CodeMirror.Pass
- var outerIndent = 0;
- if (outer.indent) {
- var possibleOuterIndent = outer.indent(state.outer, "", "");
- if (possibleOuterIndent !== CodeMirror.Pass) outerIndent = possibleOuterIndent;
- }
- state.inner = CodeMirror.startState(other.mode, outerIndent);
- return other.delimStyle && (other.delimStyle + " " + other.delimStyle + "-open");
- } else if (found != -1 && found < cutOff) {
- cutOff = found;
- }
- }
- if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff);
- var outerToken = outer.token(stream, state.outer);
- if (cutOff != Infinity) stream.string = oldContent;
- return outerToken;
- } else {
- var curInner = state.innerActive, oldContent = stream.string;
- if (!curInner.close && stream.sol()) {
- state.innerActive = state.inner = null;
- return this.token(stream, state);
- }
- var found = curInner.close && !state.startingInner ?
- indexOf(oldContent, curInner.close, stream.pos, curInner.parseDelimiters) : -1;
- if (found == stream.pos && !curInner.parseDelimiters) {
- stream.match(curInner.close);
- state.innerActive = state.inner = null;
- return curInner.delimStyle && (curInner.delimStyle + " " + curInner.delimStyle + "-close");
- }
- if (found > -1) stream.string = oldContent.slice(0, found);
- var innerToken = curInner.mode.token(stream, state.inner);
- if (found > -1) stream.string = oldContent;
- else if (stream.pos > stream.start) state.startingInner = false
- if (found == stream.pos && curInner.parseDelimiters)
- state.innerActive = state.inner = null;
- if (curInner.innerStyle) {
- if (innerToken) innerToken = innerToken + " " + curInner.innerStyle;
- else innerToken = curInner.innerStyle;
- }
- return innerToken;
- }
- },
- indent: function(state, textAfter, line) {
- var mode = state.innerActive ? state.innerActive.mode : outer;
- if (!mode.indent) return CodeMirror.Pass;
- return mode.indent(state.innerActive ? state.inner : state.outer, textAfter, line);
- },
- blankLine: function(state) {
- var mode = state.innerActive ? state.innerActive.mode : outer;
- if (mode.blankLine) {
- mode.blankLine(state.innerActive ? state.inner : state.outer);
- }
- if (!state.innerActive) {
- for (var i = 0; i < others.length; ++i) {
- var other = others[i];
- if (other.open === "\n") {
- state.innerActive = other;
- state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "", "") : 0);
- }
- }
- } else if (state.innerActive.close === "\n") {
- state.innerActive = state.inner = null;
- }
- },
- electricChars: outer.electricChars,
- innerMode: function(state) {
- return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer};
- }
- };
- };
- });
- /***/ }),
- /***/ 14146:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- // Utility function that allows modes to be combined. The mode given
- // as the base argument takes care of most of the normal mode
- // functionality, but a second (typically simple) mode is used, which
- // can override the style of text. Both modes get to parse all of the
- // text, but when both assign a non-null style to a piece of code, the
- // overlay wins, unless the combine argument was true and not overridden,
- // or state.overlay.combineTokens was true, in which case the styles are
- // combined.
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.overlayMode = function(base, overlay, combine) {
- return {
- startState: function() {
- return {
- base: CodeMirror.startState(base),
- overlay: CodeMirror.startState(overlay),
- basePos: 0, baseCur: null,
- overlayPos: 0, overlayCur: null,
- streamSeen: null
- };
- },
- copyState: function(state) {
- return {
- base: CodeMirror.copyState(base, state.base),
- overlay: CodeMirror.copyState(overlay, state.overlay),
- basePos: state.basePos, baseCur: null,
- overlayPos: state.overlayPos, overlayCur: null
- };
- },
- token: function(stream, state) {
- if (stream != state.streamSeen ||
- Math.min(state.basePos, state.overlayPos) < stream.start) {
- state.streamSeen = stream;
- state.basePos = state.overlayPos = stream.start;
- }
- if (stream.start == state.basePos) {
- state.baseCur = base.token(stream, state.base);
- state.basePos = stream.pos;
- }
- if (stream.start == state.overlayPos) {
- stream.pos = stream.start;
- state.overlayCur = overlay.token(stream, state.overlay);
- state.overlayPos = stream.pos;
- }
- stream.pos = Math.min(state.basePos, state.overlayPos);
- // state.overlay.combineTokens always takes precedence over combine,
- // unless set to null
- if (state.overlayCur == null) return state.baseCur;
- else if (state.baseCur != null &&
- state.overlay.combineTokens ||
- combine && state.overlay.combineTokens == null)
- return state.baseCur + " " + state.overlayCur;
- else return state.overlayCur;
- },
- indent: base.indent && function(state, textAfter, line) {
- return base.indent(state.base, textAfter, line);
- },
- electricChars: base.electricChars,
- innerMode: function(state) { return {state: state.base, mode: base}; },
- blankLine: function(state) {
- var baseToken, overlayToken;
- if (base.blankLine) baseToken = base.blankLine(state.base);
- if (overlay.blankLine) overlayToken = overlay.blankLine(state.overlay);
- return overlayToken == null ?
- baseToken :
- (combine && baseToken != null ? baseToken + " " + overlayToken : overlayToken);
- }
- };
- };
- });
- /***/ }),
- /***/ 20017:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- var WRAP_CLASS = "CodeMirror-activeline";
- var BACK_CLASS = "CodeMirror-activeline-background";
- var GUTT_CLASS = "CodeMirror-activeline-gutter";
- CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) {
- var prev = old == CodeMirror.Init ? false : old;
- if (val == prev) return
- if (prev) {
- cm.off("beforeSelectionChange", selectionChange);
- clearActiveLines(cm);
- delete cm.state.activeLines;
- }
- if (val) {
- cm.state.activeLines = [];
- updateActiveLines(cm, cm.listSelections());
- cm.on("beforeSelectionChange", selectionChange);
- }
- });
- function clearActiveLines(cm) {
- for (var i = 0; i < cm.state.activeLines.length; i++) {
- cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS);
- cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS);
- cm.removeLineClass(cm.state.activeLines[i], "gutter", GUTT_CLASS);
- }
- }
- function sameArray(a, b) {
- if (a.length != b.length) return false;
- for (var i = 0; i < a.length; i++)
- if (a[i] != b[i]) return false;
- return true;
- }
- function updateActiveLines(cm, ranges) {
- var active = [];
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i];
- var option = cm.getOption("styleActiveLine");
- if (typeof option == "object" && option.nonEmpty ? range.anchor.line != range.head.line : !range.empty())
- continue
- var line = cm.getLineHandleVisualStart(range.head.line);
- if (active[active.length - 1] != line) active.push(line);
- }
- if (sameArray(cm.state.activeLines, active)) return;
- cm.operation(function() {
- clearActiveLines(cm);
- for (var i = 0; i < active.length; i++) {
- cm.addLineClass(active[i], "wrap", WRAP_CLASS);
- cm.addLineClass(active[i], "background", BACK_CLASS);
- cm.addLineClass(active[i], "gutter", GUTT_CLASS);
- }
- cm.state.activeLines = active;
- });
- }
- function selectionChange(cm, sel) {
- updateActiveLines(cm, sel.ranges);
- }
- });
- /***/ }),
- /***/ 4631:
- /***/ (function(module) {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- // This is CodeMirror (https://codemirror.net), a code editor
- // implemented in JavaScript on top of the browser's DOM.
- //
- // You can find some technical background for some of the code below
- // at http://marijnhaverbeke.nl/blog/#cm-internals .
- (function (global, factory) {
- true ? module.exports = factory() :
- 0;
- }(this, (function () { 'use strict';
- // Kludges for bugs and behavior differences that can't be feature
- // detected are enabled based on userAgent etc sniffing.
- var userAgent = navigator.userAgent;
- var platform = navigator.platform;
- var gecko = /gecko\/\d/i.test(userAgent);
- var ie_upto10 = /MSIE \d/.test(userAgent);
- var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent);
- var edge = /Edge\/(\d+)/.exec(userAgent);
- var ie = ie_upto10 || ie_11up || edge;
- var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);
- var webkit = !edge && /WebKit\//.test(userAgent);
- var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent);
- var chrome = !edge && /Chrome\//.test(userAgent);
- var presto = /Opera\//.test(userAgent);
- var safari = /Apple Computer/.test(navigator.vendor);
- var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
- var phantom = /PhantomJS/.test(userAgent);
- var ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2);
- var android = /Android/.test(userAgent);
- // This is woefully incomplete. Suggestions for alternative methods welcome.
- var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);
- var mac = ios || /Mac/.test(platform);
- var chromeOS = /\bCrOS\b/.test(userAgent);
- var windows = /win/i.test(platform);
- var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/);
- if (presto_version) { presto_version = Number(presto_version[1]); }
- if (presto_version && presto_version >= 15) { presto = false; webkit = true; }
- // Some browsers use the wrong event properties to signal cmd/ctrl on OS X
- var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));
- var captureRightClick = gecko || (ie && ie_version >= 9);
- function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }
- var rmClass = function(node, cls) {
- var current = node.className;
- var match = classTest(cls).exec(current);
- if (match) {
- var after = current.slice(match.index + match[0].length);
- node.className = current.slice(0, match.index) + (after ? match[1] + after : "");
- }
- };
- function removeChildren(e) {
- for (var count = e.childNodes.length; count > 0; --count)
- { e.removeChild(e.firstChild); }
- return e
- }
- function removeChildrenAndAdd(parent, e) {
- return removeChildren(parent).appendChild(e)
- }
- function elt(tag, content, className, style) {
- var e = document.createElement(tag);
- if (className) { e.className = className; }
- if (style) { e.style.cssText = style; }
- if (typeof content == "string") { e.appendChild(document.createTextNode(content)); }
- else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }
- return e
- }
- // wrapper for elt, which removes the elt from the accessibility tree
- function eltP(tag, content, className, style) {
- var e = elt(tag, content, className, style);
- e.setAttribute("role", "presentation");
- return e
- }
- var range;
- if (document.createRange) { range = function(node, start, end, endNode) {
- var r = document.createRange();
- r.setEnd(endNode || node, end);
- r.setStart(node, start);
- return r
- }; }
- else { range = function(node, start, end) {
- var r = document.body.createTextRange();
- try { r.moveToElementText(node.parentNode); }
- catch(e) { return r }
- r.collapse(true);
- r.moveEnd("character", end);
- r.moveStart("character", start);
- return r
- }; }
- function contains(parent, child) {
- if (child.nodeType == 3) // Android browser always returns false when child is a textnode
- { child = child.parentNode; }
- if (parent.contains)
- { return parent.contains(child) }
- do {
- if (child.nodeType == 11) { child = child.host; }
- if (child == parent) { return true }
- } while (child = child.parentNode)
- }
- function activeElt() {
- // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.
- // IE < 10 will throw when accessed while the page is loading or in an iframe.
- // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.
- var activeElement;
- try {
- activeElement = document.activeElement;
- } catch(e) {
- activeElement = document.body || null;
- }
- while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
- { activeElement = activeElement.shadowRoot.activeElement; }
- return activeElement
- }
- function addClass(node, cls) {
- var current = node.className;
- if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls; }
- }
- function joinClasses(a, b) {
- var as = a.split(" ");
- for (var i = 0; i < as.length; i++)
- { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i]; } }
- return b
- }
- var selectInput = function(node) { node.select(); };
- if (ios) // Mobile Safari apparently has a bug where select() is broken.
- { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }
- else if (ie) // Suppress mysterious IE10 errors
- { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }
- function bind(f) {
- var args = Array.prototype.slice.call(arguments, 1);
- return function(){return f.apply(null, args)}
- }
- function copyObj(obj, target, overwrite) {
- if (!target) { target = {}; }
- for (var prop in obj)
- { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
- { target[prop] = obj[prop]; } }
- return target
- }
- // Counts the column offset in a string, taking tabs into account.
- // Used mostly to find indentation.
- function countColumn(string, end, tabSize, startIndex, startValue) {
- if (end == null) {
- end = string.search(/[^\s\u00a0]/);
- if (end == -1) { end = string.length; }
- }
- for (var i = startIndex || 0, n = startValue || 0;;) {
- var nextTab = string.indexOf("\t", i);
- if (nextTab < 0 || nextTab >= end)
- { return n + (end - i) }
- n += nextTab - i;
- n += tabSize - (n % tabSize);
- i = nextTab + 1;
- }
- }
- var Delayed = function() {
- this.id = null;
- this.f = null;
- this.time = 0;
- this.handler = bind(this.onTimeout, this);
- };
- Delayed.prototype.onTimeout = function (self) {
- self.id = 0;
- if (self.time <= +new Date) {
- self.f();
- } else {
- setTimeout(self.handler, self.time - +new Date);
- }
- };
- Delayed.prototype.set = function (ms, f) {
- this.f = f;
- var time = +new Date + ms;
- if (!this.id || time < this.time) {
- clearTimeout(this.id);
- this.id = setTimeout(this.handler, ms);
- this.time = time;
- }
- };
- function indexOf(array, elt) {
- for (var i = 0; i < array.length; ++i)
- { if (array[i] == elt) { return i } }
- return -1
- }
- // Number of pixels added to scroller and sizer to hide scrollbar
- var scrollerGap = 50;
- // Returned or thrown by various protocols to signal 'I'm not
- // handling this'.
- var Pass = {toString: function(){return "CodeMirror.Pass"}};
- // Reused option objects for setSelection & friends
- var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"};
- // The inverse of countColumn -- find the offset that corresponds to
- // a particular column.
- function findColumn(string, goal, tabSize) {
- for (var pos = 0, col = 0;;) {
- var nextTab = string.indexOf("\t", pos);
- if (nextTab == -1) { nextTab = string.length; }
- var skipped = nextTab - pos;
- if (nextTab == string.length || col + skipped >= goal)
- { return pos + Math.min(skipped, goal - col) }
- col += nextTab - pos;
- col += tabSize - (col % tabSize);
- pos = nextTab + 1;
- if (col >= goal) { return pos }
- }
- }
- var spaceStrs = [""];
- function spaceStr(n) {
- while (spaceStrs.length <= n)
- { spaceStrs.push(lst(spaceStrs) + " "); }
- return spaceStrs[n]
- }
- function lst(arr) { return arr[arr.length-1] }
- function map(array, f) {
- var out = [];
- for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }
- return out
- }
- function insertSorted(array, value, score) {
- var pos = 0, priority = score(value);
- while (pos < array.length && score(array[pos]) <= priority) { pos++; }
- array.splice(pos, 0, value);
- }
- function nothing() {}
- function createObj(base, props) {
- var inst;
- if (Object.create) {
- inst = Object.create(base);
- } else {
- nothing.prototype = base;
- inst = new nothing();
- }
- if (props) { copyObj(props, inst); }
- return inst
- }
- var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
- function isWordCharBasic(ch) {
- return /\w/.test(ch) || ch > "\x80" &&
- (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))
- }
- function isWordChar(ch, helper) {
- if (!helper) { return isWordCharBasic(ch) }
- if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true }
- return helper.test(ch)
- }
- function isEmpty(obj) {
- for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }
- return true
- }
- // Extending unicode characters. A series of a non-extending char +
- // any number of extending chars is treated as a single unit as far
- // as editing and measuring is concerned. This is not fully correct,
- // since some scripts/fonts/browsers also treat other configurations
- // of code points as a group.
- var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\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\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\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\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;
- function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }
- // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.
- function skipExtendingChars(str, pos, dir) {
- while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }
- return pos
- }
- // Returns the value from the range [`from`; `to`] that satisfies
- // `pred` and is closest to `from`. Assumes that at least `to`
- // satisfies `pred`. Supports `from` being greater than `to`.
- function findFirst(pred, from, to) {
- // At any point we are certain `to` satisfies `pred`, don't know
- // whether `from` does.
- var dir = from > to ? -1 : 1;
- for (;;) {
- if (from == to) { return from }
- var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);
- if (mid == from) { return pred(mid) ? from : to }
- if (pred(mid)) { to = mid; }
- else { from = mid + dir; }
- }
- }
- // BIDI HELPERS
- function iterateBidiSections(order, from, to, f) {
- if (!order) { return f(from, to, "ltr", 0) }
- var found = false;
- for (var i = 0; i < order.length; ++i) {
- var part = order[i];
- if (part.from < to && part.to > from || from == to && part.to == from) {
- f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i);
- found = true;
- }
- }
- if (!found) { f(from, to, "ltr"); }
- }
- var bidiOther = null;
- function getBidiPartAt(order, ch, sticky) {
- var found;
- bidiOther = null;
- for (var i = 0; i < order.length; ++i) {
- var cur = order[i];
- if (cur.from < ch && cur.to > ch) { return i }
- if (cur.to == ch) {
- if (cur.from != cur.to && sticky == "before") { found = i; }
- else { bidiOther = i; }
- }
- if (cur.from == ch) {
- if (cur.from != cur.to && sticky != "before") { found = i; }
- else { bidiOther = i; }
- }
- }
- return found != null ? found : bidiOther
- }
- // Bidirectional ordering algorithm
- // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm
- // that this (partially) implements.
- // One-char codes used for character types:
- // L (L): Left-to-Right
- // R (R): Right-to-Left
- // r (AL): Right-to-Left Arabic
- // 1 (EN): European Number
- // + (ES): European Number Separator
- // % (ET): European Number Terminator
- // n (AN): Arabic Number
- // , (CS): Common Number Separator
- // m (NSM): Non-Spacing Mark
- // b (BN): Boundary Neutral
- // s (B): Paragraph Separator
- // t (S): Segment Separator
- // w (WS): Whitespace
- // N (ON): Other Neutrals
- // Returns null if characters are ordered as they appear
- // (left-to-right), or an array of sections ({from, to, level}
- // objects) in the order in which they occur visually.
- var bidiOrdering = (function() {
- // Character types for codepoints 0 to 0xff
- var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";
- // Character types for codepoints 0x600 to 0x6f9
- var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";
- function charType(code) {
- if (code <= 0xf7) { return lowTypes.charAt(code) }
- else if (0x590 <= code && code <= 0x5f4) { return "R" }
- else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }
- else if (0x6ee <= code && code <= 0x8ac) { return "r" }
- else if (0x2000 <= code && code <= 0x200b) { return "w" }
- else if (code == 0x200c) { return "b" }
- else { return "L" }
- }
- var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
- var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;
- function BidiSpan(level, from, to) {
- this.level = level;
- this.from = from; this.to = to;
- }
- return function(str, direction) {
- var outerType = direction == "ltr" ? "L" : "R";
- if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false }
- var len = str.length, types = [];
- for (var i = 0; i < len; ++i)
- { types.push(charType(str.charCodeAt(i))); }
- // W1. Examine each non-spacing mark (NSM) in the level run, and
- // change the type of the NSM to the type of the previous
- // character. If the NSM is at the start of the level run, it will
- // get the type of sor.
- for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {
- var type = types[i$1];
- if (type == "m") { types[i$1] = prev; }
- else { prev = type; }
- }
- // W2. Search backwards from each instance of a European number
- // until the first strong type (R, L, AL, or sor) is found. If an
- // AL is found, change the type of the European number to Arabic
- // number.
- // W3. Change all ALs to R.
- for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {
- var type$1 = types[i$2];
- if (type$1 == "1" && cur == "r") { types[i$2] = "n"; }
- else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R"; } }
- }
- // W4. A single European separator between two European numbers
- // changes to a European number. A single common separator between
- // two numbers of the same type changes to that type.
- for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {
- var type$2 = types[i$3];
- if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1"; }
- else if (type$2 == "," && prev$1 == types[i$3+1] &&
- (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1; }
- prev$1 = type$2;
- }
- // W5. A sequence of European terminators adjacent to European
- // numbers changes to all European numbers.
- // W6. Otherwise, separators and terminators change to Other
- // Neutral.
- for (var i$4 = 0; i$4 < len; ++i$4) {
- var type$3 = types[i$4];
- if (type$3 == ",") { types[i$4] = "N"; }
- else if (type$3 == "%") {
- var end = (void 0);
- for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {}
- var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N";
- for (var j = i$4; j < end; ++j) { types[j] = replace; }
- i$4 = end - 1;
- }
- }
- // W7. Search backwards from each instance of a European number
- // until the first strong type (R, L, or sor) is found. If an L is
- // found, then change the type of the European number to L.
- for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {
- var type$4 = types[i$5];
- if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L"; }
- else if (isStrong.test(type$4)) { cur$1 = type$4; }
- }
- // N1. A sequence of neutrals takes the direction of the
- // surrounding strong text if the text on both sides has the same
- // direction. European and Arabic numbers act as if they were R in
- // terms of their influence on neutrals. Start-of-level-run (sor)
- // and end-of-level-run (eor) are used at level run boundaries.
- // N2. Any remaining neutrals take the embedding direction.
- for (var i$6 = 0; i$6 < len; ++i$6) {
- if (isNeutral.test(types[i$6])) {
- var end$1 = (void 0);
- for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}
- var before = (i$6 ? types[i$6-1] : outerType) == "L";
- var after = (end$1 < len ? types[end$1] : outerType) == "L";
- var replace$1 = before == after ? (before ? "L" : "R") : outerType;
- for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }
- i$6 = end$1 - 1;
- }
- }
- // Here we depart from the documented algorithm, in order to avoid
- // building up an actual levels array. Since there are only three
- // levels (0, 1, 2) in an implementation that doesn't take
- // explicit embedding into account, we can build up the order on
- // the fly, without following the level-based algorithm.
- var order = [], m;
- for (var i$7 = 0; i$7 < len;) {
- if (countsAsLeft.test(types[i$7])) {
- var start = i$7;
- for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
- order.push(new BidiSpan(0, start, i$7));
- } else {
- var pos = i$7, at = order.length, isRTL = direction == "rtl" ? 1 : 0;
- for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
- for (var j$2 = pos; j$2 < i$7;) {
- if (countsAsNum.test(types[j$2])) {
- if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }
- var nstart = j$2;
- for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
- order.splice(at, 0, new BidiSpan(2, nstart, j$2));
- at += isRTL;
- pos = j$2;
- } else { ++j$2; }
- }
- if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }
- }
- }
- if (direction == "ltr") {
- if (order[0].level == 1 && (m = str.match(/^\s+/))) {
- order[0].from = m[0].length;
- order.unshift(new BidiSpan(0, 0, m[0].length));
- }
- if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
- lst(order).to -= m[0].length;
- order.push(new BidiSpan(0, len - m[0].length, len));
- }
- }
- return direction == "rtl" ? order.reverse() : order
- }
- })();
- // Get the bidi ordering for the given line (and cache it). Returns
- // false for lines that are fully left-to-right, and an array of
- // BidiSpan objects otherwise.
- function getOrder(line, direction) {
- var order = line.order;
- if (order == null) { order = line.order = bidiOrdering(line.text, direction); }
- return order
- }
- // EVENT HANDLING
- // Lightweight event framework. on/off also work on DOM nodes,
- // registering native DOM handlers.
- var noHandlers = [];
- var on = function(emitter, type, f) {
- if (emitter.addEventListener) {
- emitter.addEventListener(type, f, false);
- } else if (emitter.attachEvent) {
- emitter.attachEvent("on" + type, f);
- } else {
- var map = emitter._handlers || (emitter._handlers = {});
- map[type] = (map[type] || noHandlers).concat(f);
- }
- };
- function getHandlers(emitter, type) {
- return emitter._handlers && emitter._handlers[type] || noHandlers
- }
- function off(emitter, type, f) {
- if (emitter.removeEventListener) {
- emitter.removeEventListener(type, f, false);
- } else if (emitter.detachEvent) {
- emitter.detachEvent("on" + type, f);
- } else {
- var map = emitter._handlers, arr = map && map[type];
- if (arr) {
- var index = indexOf(arr, f);
- if (index > -1)
- { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }
- }
- }
- }
- function signal(emitter, type /*, values...*/) {
- var handlers = getHandlers(emitter, type);
- if (!handlers.length) { return }
- var args = Array.prototype.slice.call(arguments, 2);
- for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }
- }
- // The DOM events that CodeMirror handles can be overridden by
- // registering a (non-DOM) handler on the editor for the event name,
- // and preventDefault-ing the event in that handler.
- function signalDOMEvent(cm, e, override) {
- if (typeof e == "string")
- { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }
- signal(cm, override || e.type, cm, e);
- return e_defaultPrevented(e) || e.codemirrorIgnore
- }
- function signalCursorActivity(cm) {
- var arr = cm._handlers && cm._handlers.cursorActivity;
- if (!arr) { return }
- var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);
- for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)
- { set.push(arr[i]); } }
- }
- function hasHandler(emitter, type) {
- return getHandlers(emitter, type).length > 0
- }
- // Add on and off methods to a constructor's prototype, to make
- // registering events on such objects more convenient.
- function eventMixin(ctor) {
- ctor.prototype.on = function(type, f) {on(this, type, f);};
- ctor.prototype.off = function(type, f) {off(this, type, f);};
- }
- // Due to the fact that we still support jurassic IE versions, some
- // compatibility wrappers are needed.
- function e_preventDefault(e) {
- if (e.preventDefault) { e.preventDefault(); }
- else { e.returnValue = false; }
- }
- function e_stopPropagation(e) {
- if (e.stopPropagation) { e.stopPropagation(); }
- else { e.cancelBubble = true; }
- }
- function e_defaultPrevented(e) {
- return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false
- }
- function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}
- function e_target(e) {return e.target || e.srcElement}
- function e_button(e) {
- var b = e.which;
- if (b == null) {
- if (e.button & 1) { b = 1; }
- else if (e.button & 2) { b = 3; }
- else if (e.button & 4) { b = 2; }
- }
- if (mac && e.ctrlKey && b == 1) { b = 3; }
- return b
- }
- // Detect drag-and-drop
- var dragAndDrop = function() {
- // There is *some* kind of drag-and-drop support in IE6-8, but I
- // couldn't get it to work yet.
- if (ie && ie_version < 9) { return false }
- var div = elt('div');
- return "draggable" in div || "dragDrop" in div
- }();
- var zwspSupported;
- function zeroWidthElement(measure) {
- if (zwspSupported == null) {
- var test = elt("span", "\u200b");
- removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]));
- if (measure.firstChild.offsetHeight != 0)
- { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }
- }
- var node = zwspSupported ? elt("span", "\u200b") :
- elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px");
- node.setAttribute("cm-text", "");
- return node
- }
- // Feature-detect IE's crummy client rect reporting for bidi text
- var badBidiRects;
- function hasBadBidiRects(measure) {
- if (badBidiRects != null) { return badBidiRects }
- var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA"));
- var r0 = range(txt, 0, 1).getBoundingClientRect();
- var r1 = range(txt, 1, 2).getBoundingClientRect();
- removeChildren(measure);
- if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)
- return badBidiRects = (r1.right - r0.right < 3)
- }
- // See if "".split is the broken IE version, if so, provide an
- // alternative way to split lines.
- var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) {
- var pos = 0, result = [], l = string.length;
- while (pos <= l) {
- var nl = string.indexOf("\n", pos);
- if (nl == -1) { nl = string.length; }
- var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl);
- var rt = line.indexOf("\r");
- if (rt != -1) {
- result.push(line.slice(0, rt));
- pos += rt + 1;
- } else {
- result.push(line);
- pos = nl + 1;
- }
- }
- return result
- } : function (string) { return string.split(/\r\n?|\n/); };
- var hasSelection = window.getSelection ? function (te) {
- try { return te.selectionStart != te.selectionEnd }
- catch(e) { return false }
- } : function (te) {
- var range;
- try {range = te.ownerDocument.selection.createRange();}
- catch(e) {}
- if (!range || range.parentElement() != te) { return false }
- return range.compareEndPoints("StartToEnd", range) != 0
- };
- var hasCopyEvent = (function () {
- var e = elt("div");
- if ("oncopy" in e) { return true }
- e.setAttribute("oncopy", "return;");
- return typeof e.oncopy == "function"
- })();
- var badZoomedRects = null;
- function hasBadZoomedRects(measure) {
- if (badZoomedRects != null) { return badZoomedRects }
- var node = removeChildrenAndAdd(measure, elt("span", "x"));
- var normal = node.getBoundingClientRect();
- var fromRange = range(node, 0, 1).getBoundingClientRect();
- return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1
- }
- // Known modes, by name and by MIME
- var modes = {}, mimeModes = {};
- // Extra arguments are stored as the mode's dependencies, which is
- // used by (legacy) mechanisms like loadmode.js to automatically
- // load a mode. (Preferred mechanism is the require/define calls.)
- function defineMode(name, mode) {
- if (arguments.length > 2)
- { mode.dependencies = Array.prototype.slice.call(arguments, 2); }
- modes[name] = mode;
- }
- function defineMIME(mime, spec) {
- mimeModes[mime] = spec;
- }
- // Given a MIME type, a {name, ...options} config object, or a name
- // string, return a mode config object.
- function resolveMode(spec) {
- if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
- spec = mimeModes[spec];
- } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
- var found = mimeModes[spec.name];
- if (typeof found == "string") { found = {name: found}; }
- spec = createObj(found, spec);
- spec.name = found.name;
- } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
- return resolveMode("application/xml")
- } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) {
- return resolveMode("application/json")
- }
- if (typeof spec == "string") { return {name: spec} }
- else { return spec || {name: "null"} }
- }
- // Given a mode spec (anything that resolveMode accepts), find and
- // initialize an actual mode object.
- function getMode(options, spec) {
- spec = resolveMode(spec);
- var mfactory = modes[spec.name];
- if (!mfactory) { return getMode(options, "text/plain") }
- var modeObj = mfactory(options, spec);
- if (modeExtensions.hasOwnProperty(spec.name)) {
- var exts = modeExtensions[spec.name];
- for (var prop in exts) {
- if (!exts.hasOwnProperty(prop)) { continue }
- if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop]; }
- modeObj[prop] = exts[prop];
- }
- }
- modeObj.name = spec.name;
- if (spec.helperType) { modeObj.helperType = spec.helperType; }
- if (spec.modeProps) { for (var prop$1 in spec.modeProps)
- { modeObj[prop$1] = spec.modeProps[prop$1]; } }
- return modeObj
- }
- // This can be used to attach properties to mode objects from
- // outside the actual mode definition.
- var modeExtensions = {};
- function extendMode(mode, properties) {
- var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});
- copyObj(properties, exts);
- }
- function copyState(mode, state) {
- if (state === true) { return state }
- if (mode.copyState) { return mode.copyState(state) }
- var nstate = {};
- for (var n in state) {
- var val = state[n];
- if (val instanceof Array) { val = val.concat([]); }
- nstate[n] = val;
- }
- return nstate
- }
- // Given a mode and a state (for that mode), find the inner mode and
- // state at the position that the state refers to.
- function innerMode(mode, state) {
- var info;
- while (mode.innerMode) {
- info = mode.innerMode(state);
- if (!info || info.mode == mode) { break }
- state = info.state;
- mode = info.mode;
- }
- return info || {mode: mode, state: state}
- }
- function startState(mode, a1, a2) {
- return mode.startState ? mode.startState(a1, a2) : true
- }
- // STRING STREAM
- // Fed to the mode parsers, provides helper functions to make
- // parsers more succinct.
- var StringStream = function(string, tabSize, lineOracle) {
- this.pos = this.start = 0;
- this.string = string;
- this.tabSize = tabSize || 8;
- this.lastColumnPos = this.lastColumnValue = 0;
- this.lineStart = 0;
- this.lineOracle = lineOracle;
- };
- StringStream.prototype.eol = function () {return this.pos >= this.string.length};
- StringStream.prototype.sol = function () {return this.pos == this.lineStart};
- StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};
- StringStream.prototype.next = function () {
- if (this.pos < this.string.length)
- { return this.string.charAt(this.pos++) }
- };
- StringStream.prototype.eat = function (match) {
- var ch = this.string.charAt(this.pos);
- var ok;
- if (typeof match == "string") { ok = ch == match; }
- else { ok = ch && (match.test ? match.test(ch) : match(ch)); }
- if (ok) {++this.pos; return ch}
- };
- StringStream.prototype.eatWhile = function (match) {
- var start = this.pos;
- while (this.eat(match)){}
- return this.pos > start
- };
- StringStream.prototype.eatSpace = function () {
- var start = this.pos;
- while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }
- return this.pos > start
- };
- StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};
- StringStream.prototype.skipTo = function (ch) {
- var found = this.string.indexOf(ch, this.pos);
- if (found > -1) {this.pos = found; return true}
- };
- StringStream.prototype.backUp = function (n) {this.pos -= n;};
- StringStream.prototype.column = function () {
- if (this.lastColumnPos < this.start) {
- this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);
- this.lastColumnPos = this.start;
- }
- return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
- };
- StringStream.prototype.indentation = function () {
- return countColumn(this.string, null, this.tabSize) -
- (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
- };
- StringStream.prototype.match = function (pattern, consume, caseInsensitive) {
- if (typeof pattern == "string") {
- var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };
- var substr = this.string.substr(this.pos, pattern.length);
- if (cased(substr) == cased(pattern)) {
- if (consume !== false) { this.pos += pattern.length; }
- return true
- }
- } else {
- var match = this.string.slice(this.pos).match(pattern);
- if (match && match.index > 0) { return null }
- if (match && consume !== false) { this.pos += match[0].length; }
- return match
- }
- };
- StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};
- StringStream.prototype.hideFirstChars = function (n, inner) {
- this.lineStart += n;
- try { return inner() }
- finally { this.lineStart -= n; }
- };
- StringStream.prototype.lookAhead = function (n) {
- var oracle = this.lineOracle;
- return oracle && oracle.lookAhead(n)
- };
- StringStream.prototype.baseToken = function () {
- var oracle = this.lineOracle;
- return oracle && oracle.baseToken(this.pos)
- };
- // Find the line object corresponding to the given line number.
- function getLine(doc, n) {
- n -= doc.first;
- if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") }
- var chunk = doc;
- while (!chunk.lines) {
- for (var i = 0;; ++i) {
- var child = chunk.children[i], sz = child.chunkSize();
- if (n < sz) { chunk = child; break }
- n -= sz;
- }
- }
- return chunk.lines[n]
- }
- // Get the part of a document between two positions, as an array of
- // strings.
- function getBetween(doc, start, end) {
- var out = [], n = start.line;
- doc.iter(start.line, end.line + 1, function (line) {
- var text = line.text;
- if (n == end.line) { text = text.slice(0, end.ch); }
- if (n == start.line) { text = text.slice(start.ch); }
- out.push(text);
- ++n;
- });
- return out
- }
- // Get the lines between from and to, as array of strings.
- function getLines(doc, from, to) {
- var out = [];
- doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value
- return out
- }
- // Update the height of a line, propagating the height change
- // upwards to parent nodes.
- function updateLineHeight(line, height) {
- var diff = height - line.height;
- if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }
- }
- // Given a line object, find its line number by walking up through
- // its parent links.
- function lineNo(line) {
- if (line.parent == null) { return null }
- var cur = line.parent, no = indexOf(cur.lines, line);
- for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
- for (var i = 0;; ++i) {
- if (chunk.children[i] == cur) { break }
- no += chunk.children[i].chunkSize();
- }
- }
- return no + cur.first
- }
- // Find the line at the given vertical position, using the height
- // information in the document tree.
- function lineAtHeight(chunk, h) {
- var n = chunk.first;
- outer: do {
- for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {
- var child = chunk.children[i$1], ch = child.height;
- if (h < ch) { chunk = child; continue outer }
- h -= ch;
- n += child.chunkSize();
- }
- return n
- } while (!chunk.lines)
- var i = 0;
- for (; i < chunk.lines.length; ++i) {
- var line = chunk.lines[i], lh = line.height;
- if (h < lh) { break }
- h -= lh;
- }
- return n + i
- }
- function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}
- function lineNumberFor(options, i) {
- return String(options.lineNumberFormatter(i + options.firstLineNumber))
- }
- // A Pos instance represents a position within the text.
- function Pos(line, ch, sticky) {
- if ( sticky === void 0 ) sticky = null;
- if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }
- this.line = line;
- this.ch = ch;
- this.sticky = sticky;
- }
- // Compare two positions, return 0 if they are the same, a negative
- // number when a is less, and a positive number otherwise.
- function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
- function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }
- function copyPos(x) {return Pos(x.line, x.ch)}
- function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }
- function minPos(a, b) { return cmp(a, b) < 0 ? a : b }
- // Most of the external API clips given positions to make sure they
- // actually exist within the document.
- function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}
- function clipPos(doc, pos) {
- if (pos.line < doc.first) { return Pos(doc.first, 0) }
- var last = doc.first + doc.size - 1;
- if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }
- return clipToLen(pos, getLine(doc, pos.line).text.length)
- }
- function clipToLen(pos, linelen) {
- var ch = pos.ch;
- if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }
- else if (ch < 0) { return Pos(pos.line, 0) }
- else { return pos }
- }
- function clipPosArray(doc, array) {
- var out = [];
- for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }
- return out
- }
- var SavedContext = function(state, lookAhead) {
- this.state = state;
- this.lookAhead = lookAhead;
- };
- var Context = function(doc, state, line, lookAhead) {
- this.state = state;
- this.doc = doc;
- this.line = line;
- this.maxLookAhead = lookAhead || 0;
- this.baseTokens = null;
- this.baseTokenPos = 1;
- };
- Context.prototype.lookAhead = function (n) {
- var line = this.doc.getLine(this.line + n);
- if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }
- return line
- };
- Context.prototype.baseToken = function (n) {
- if (!this.baseTokens) { return null }
- while (this.baseTokens[this.baseTokenPos] <= n)
- { this.baseTokenPos += 2; }
- var type = this.baseTokens[this.baseTokenPos + 1];
- return {type: type && type.replace(/( |^)overlay .*/, ""),
- size: this.baseTokens[this.baseTokenPos] - n}
- };
- Context.prototype.nextLine = function () {
- this.line++;
- if (this.maxLookAhead > 0) { this.maxLookAhead--; }
- };
- Context.fromSaved = function (doc, saved, line) {
- if (saved instanceof SavedContext)
- { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }
- else
- { return new Context(doc, copyState(doc.mode, saved), line) }
- };
- Context.prototype.save = function (copy) {
- var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;
- return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state
- };
- // Compute a style array (an array starting with a mode generation
- // -- for invalidation -- followed by pairs of end positions and
- // style strings), which is used to highlight the tokens on the
- // line.
- function highlightLine(cm, line, context, forceToEnd) {
- // A styles array always starts with a number identifying the
- // mode/overlays that it is based on (for easy invalidation).
- var st = [cm.state.modeGen], lineClasses = {};
- // Compute the base array of styles
- runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },
- lineClasses, forceToEnd);
- var state = context.state;
- // Run overlays, adjust style array.
- var loop = function ( o ) {
- context.baseTokens = st;
- var overlay = cm.state.overlays[o], i = 1, at = 0;
- context.state = true;
- runMode(cm, line.text, overlay.mode, context, function (end, style) {
- var start = i;
- // Ensure there's a token end at the current position, and that i points at it
- while (at < end) {
- var i_end = st[i];
- if (i_end > end)
- { st.splice(i, 1, end, st[i+1], i_end); }
- i += 2;
- at = Math.min(end, i_end);
- }
- if (!style) { return }
- if (overlay.opaque) {
- st.splice(start, i - start, end, "overlay " + style);
- i = start + 2;
- } else {
- for (; start < i; start += 2) {
- var cur = st[start+1];
- st[start+1] = (cur ? cur + " " : "") + "overlay " + style;
- }
- }
- }, lineClasses);
- context.state = state;
- context.baseTokens = null;
- context.baseTokenPos = 1;
- };
- for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
- return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}
- }
- function getLineStyles(cm, line, updateFrontier) {
- if (!line.styles || line.styles[0] != cm.state.modeGen) {
- var context = getContextBefore(cm, lineNo(line));
- var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);
- var result = highlightLine(cm, line, context);
- if (resetState) { context.state = resetState; }
- line.stateAfter = context.save(!resetState);
- line.styles = result.styles;
- if (result.classes) { line.styleClasses = result.classes; }
- else if (line.styleClasses) { line.styleClasses = null; }
- if (updateFrontier === cm.doc.highlightFrontier)
- { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }
- }
- return line.styles
- }
- function getContextBefore(cm, n, precise) {
- var doc = cm.doc, display = cm.display;
- if (!doc.mode.startState) { return new Context(doc, true, n) }
- var start = findStartLine(cm, n, precise);
- var saved = start > doc.first && getLine(doc, start - 1).stateAfter;
- var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);
- doc.iter(start, n, function (line) {
- processLine(cm, line.text, context);
- var pos = context.line;
- line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;
- context.nextLine();
- });
- if (precise) { doc.modeFrontier = context.line; }
- return context
- }
- // Lightweight form of highlight -- proceed over this line and
- // update state, but don't save a style array. Used for lines that
- // aren't currently visible.
- function processLine(cm, text, context, startAt) {
- var mode = cm.doc.mode;
- var stream = new StringStream(text, cm.options.tabSize, context);
- stream.start = stream.pos = startAt || 0;
- if (text == "") { callBlankLine(mode, context.state); }
- while (!stream.eol()) {
- readToken(mode, stream, context.state);
- stream.start = stream.pos;
- }
- }
- function callBlankLine(mode, state) {
- if (mode.blankLine) { return mode.blankLine(state) }
- if (!mode.innerMode) { return }
- var inner = innerMode(mode, state);
- if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }
- }
- function readToken(mode, stream, state, inner) {
- for (var i = 0; i < 10; i++) {
- if (inner) { inner[0] = innerMode(mode, state).mode; }
- var style = mode.token(stream, state);
- if (stream.pos > stream.start) { return style }
- }
- throw new Error("Mode " + mode.name + " failed to advance stream.")
- }
- var Token = function(stream, type, state) {
- this.start = stream.start; this.end = stream.pos;
- this.string = stream.current();
- this.type = type || null;
- this.state = state;
- };
- // Utility for getTokenAt and getLineTokens
- function takeToken(cm, pos, precise, asArray) {
- var doc = cm.doc, mode = doc.mode, style;
- pos = clipPos(doc, pos);
- var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);
- var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;
- if (asArray) { tokens = []; }
- while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
- stream.start = stream.pos;
- style = readToken(mode, stream, context.state);
- if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }
- }
- return asArray ? tokens : new Token(stream, style, context.state)
- }
- function extractLineClasses(type, output) {
- if (type) { for (;;) {
- var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/);
- if (!lineClass) { break }
- type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);
- var prop = lineClass[1] ? "bgClass" : "textClass";
- if (output[prop] == null)
- { output[prop] = lineClass[2]; }
- else if (!(new RegExp("(?:^|\\s)" + lineClass[2] + "(?:$|\\s)")).test(output[prop]))
- { output[prop] += " " + lineClass[2]; }
- } }
- return type
- }
- // Run the given mode's parser over a line, calling f for each token.
- function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
- var flattenSpans = mode.flattenSpans;
- if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }
- var curStart = 0, curStyle = null;
- var stream = new StringStream(text, cm.options.tabSize, context), style;
- var inner = cm.options.addModeClass && [null];
- if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }
- while (!stream.eol()) {
- if (stream.pos > cm.options.maxHighlightLength) {
- flattenSpans = false;
- if (forceToEnd) { processLine(cm, text, context, stream.pos); }
- stream.pos = text.length;
- style = null;
- } else {
- style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);
- }
- if (inner) {
- var mName = inner[0].name;
- if (mName) { style = "m-" + (style ? mName + " " + style : mName); }
- }
- if (!flattenSpans || curStyle != style) {
- while (curStart < stream.start) {
- curStart = Math.min(stream.start, curStart + 5000);
- f(curStart, curStyle);
- }
- curStyle = style;
- }
- stream.start = stream.pos;
- }
- while (curStart < stream.pos) {
- // Webkit seems to refuse to render text nodes longer than 57444
- // characters, and returns inaccurate measurements in nodes
- // starting around 5000 chars.
- var pos = Math.min(stream.pos, curStart + 5000);
- f(pos, curStyle);
- curStart = pos;
- }
- }
- // Finds the line to start with when starting a parse. Tries to
- // find a line with a stateAfter, so that it can start with a
- // valid state. If that fails, it returns the line with the
- // smallest indentation, which tends to need the least context to
- // parse correctly.
- function findStartLine(cm, n, precise) {
- var minindent, minline, doc = cm.doc;
- var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);
- for (var search = n; search > lim; --search) {
- if (search <= doc.first) { return doc.first }
- var line = getLine(doc, search - 1), after = line.stateAfter;
- if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))
- { return search }
- var indented = countColumn(line.text, null, cm.options.tabSize);
- if (minline == null || minindent > indented) {
- minline = search - 1;
- minindent = indented;
- }
- }
- return minline
- }
- function retreatFrontier(doc, n) {
- doc.modeFrontier = Math.min(doc.modeFrontier, n);
- if (doc.highlightFrontier < n - 10) { return }
- var start = doc.first;
- for (var line = n - 1; line > start; line--) {
- var saved = getLine(doc, line).stateAfter;
- // change is on 3
- // state on line 1 looked ahead 2 -- so saw 3
- // test 1 + 2 < 3 should cover this
- if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {
- start = line + 1;
- break
- }
- }
- doc.highlightFrontier = Math.min(doc.highlightFrontier, start);
- }
- // Optimize some code when these features are not used.
- var sawReadOnlySpans = false, sawCollapsedSpans = false;
- function seeReadOnlySpans() {
- sawReadOnlySpans = true;
- }
- function seeCollapsedSpans() {
- sawCollapsedSpans = true;
- }
- // TEXTMARKER SPANS
- function MarkedSpan(marker, from, to) {
- this.marker = marker;
- this.from = from; this.to = to;
- }
- // Search an array of spans for a span matching the given marker.
- function getMarkedSpanFor(spans, marker) {
- if (spans) { for (var i = 0; i < spans.length; ++i) {
- var span = spans[i];
- if (span.marker == marker) { return span }
- } }
- }
- // Remove a span from an array, returning undefined if no spans are
- // left (we don't store arrays for lines without spans).
- function removeMarkedSpan(spans, span) {
- var r;
- for (var i = 0; i < spans.length; ++i)
- { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }
- return r
- }
- // Add a span to a line.
- function addMarkedSpan(line, span, op) {
- var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));
- if (inThisOp && inThisOp.has(line.markedSpans)) {
- line.markedSpans.push(span);
- } else {
- line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
- if (inThisOp) { inThisOp.add(line.markedSpans); }
- }
- span.marker.attachLine(line);
- }
- // Used for the algorithm that adjusts markers for a change in the
- // document. These functions cut an array of spans at a given
- // character position, returning an array of remaining chunks (or
- // undefined if nothing remains).
- function markedSpansBefore(old, startCh, isInsert) {
- var nw;
- if (old) { for (var i = 0; i < old.length; ++i) {
- var span = old[i], marker = span.marker;
- var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);
- if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
- var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)
- ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));
- }
- } }
- return nw
- }
- function markedSpansAfter(old, endCh, isInsert) {
- var nw;
- if (old) { for (var i = 0; i < old.length; ++i) {
- var span = old[i], marker = span.marker;
- var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);
- if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
- var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)
- ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
- span.to == null ? null : span.to - endCh));
- }
- } }
- return nw
- }
- // Given a change object, compute the new set of marker spans that
- // cover the line in which the change took place. Removes spans
- // entirely within the change, reconnects spans belonging to the
- // same marker that appear on both sides of the change, and cuts off
- // spans partially within the change. Returns an array of span
- // arrays with one element for each line in (after) the change.
- function stretchSpansOverChange(doc, change) {
- if (change.full) { return null }
- var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;
- var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;
- if (!oldFirst && !oldLast) { return null }
- var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;
- // Get the spans that 'stick out' on both sides
- var first = markedSpansBefore(oldFirst, startCh, isInsert);
- var last = markedSpansAfter(oldLast, endCh, isInsert);
- // Next, merge those two ends
- var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);
- if (first) {
- // Fix up .to properties of first
- for (var i = 0; i < first.length; ++i) {
- var span = first[i];
- if (span.to == null) {
- var found = getMarkedSpanFor(last, span.marker);
- if (!found) { span.to = startCh; }
- else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }
- }
- }
- }
- if (last) {
- // Fix up .from in last (or move them into first in case of sameLine)
- for (var i$1 = 0; i$1 < last.length; ++i$1) {
- var span$1 = last[i$1];
- if (span$1.to != null) { span$1.to += offset; }
- if (span$1.from == null) {
- var found$1 = getMarkedSpanFor(first, span$1.marker);
- if (!found$1) {
- span$1.from = offset;
- if (sameLine) { (first || (first = [])).push(span$1); }
- }
- } else {
- span$1.from += offset;
- if (sameLine) { (first || (first = [])).push(span$1); }
- }
- }
- }
- // Make sure we didn't create any zero-length spans
- if (first) { first = clearEmptySpans(first); }
- if (last && last != first) { last = clearEmptySpans(last); }
- var newMarkers = [first];
- if (!sameLine) {
- // Fill gap with whole-line-spans
- var gap = change.text.length - 2, gapMarkers;
- if (gap > 0 && first)
- { for (var i$2 = 0; i$2 < first.length; ++i$2)
- { if (first[i$2].to == null)
- { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }
- for (var i$3 = 0; i$3 < gap; ++i$3)
- { newMarkers.push(gapMarkers); }
- newMarkers.push(last);
- }
- return newMarkers
- }
- // Remove spans that are empty and don't have a clearWhenEmpty
- // option of false.
- function clearEmptySpans(spans) {
- for (var i = 0; i < spans.length; ++i) {
- var span = spans[i];
- if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
- { spans.splice(i--, 1); }
- }
- if (!spans.length) { return null }
- return spans
- }
- // Used to 'clip' out readOnly ranges when making a change.
- function removeReadOnlyRanges(doc, from, to) {
- var markers = null;
- doc.iter(from.line, to.line + 1, function (line) {
- if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
- var mark = line.markedSpans[i].marker;
- if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))
- { (markers || (markers = [])).push(mark); }
- } }
- });
- if (!markers) { return null }
- var parts = [{from: from, to: to}];
- for (var i = 0; i < markers.length; ++i) {
- var mk = markers[i], m = mk.find(0);
- for (var j = 0; j < parts.length; ++j) {
- var p = parts[j];
- if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }
- var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);
- if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)
- { newParts.push({from: p.from, to: m.from}); }
- if (dto > 0 || !mk.inclusiveRight && !dto)
- { newParts.push({from: m.to, to: p.to}); }
- parts.splice.apply(parts, newParts);
- j += newParts.length - 3;
- }
- }
- return parts
- }
- // Connect or disconnect spans from a line.
- function detachMarkedSpans(line) {
- var spans = line.markedSpans;
- if (!spans) { return }
- for (var i = 0; i < spans.length; ++i)
- { spans[i].marker.detachLine(line); }
- line.markedSpans = null;
- }
- function attachMarkedSpans(line, spans) {
- if (!spans) { return }
- for (var i = 0; i < spans.length; ++i)
- { spans[i].marker.attachLine(line); }
- line.markedSpans = spans;
- }
- // Helpers used when computing which overlapping collapsed span
- // counts as the larger one.
- function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
- function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }
- // Returns a number indicating which of two overlapping collapsed
- // spans is larger (and thus includes the other). Falls back to
- // comparing ids when the spans cover exactly the same range.
- function compareCollapsedMarkers(a, b) {
- var lenDiff = a.lines.length - b.lines.length;
- if (lenDiff != 0) { return lenDiff }
- var aPos = a.find(), bPos = b.find();
- var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);
- if (fromCmp) { return -fromCmp }
- var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);
- if (toCmp) { return toCmp }
- return b.id - a.id
- }
- // Find out whether a line ends or starts in a collapsed span. If
- // so, return the marker for that span.
- function collapsedSpanAtSide(line, start) {
- var sps = sawCollapsedSpans && line.markedSpans, found;
- if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
- sp = sps[i];
- if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
- (!found || compareCollapsedMarkers(found, sp.marker) < 0))
- { found = sp.marker; }
- } }
- return found
- }
- function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }
- function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }
- function collapsedSpanAround(line, ch) {
- var sps = sawCollapsedSpans && line.markedSpans, found;
- if (sps) { for (var i = 0; i < sps.length; ++i) {
- var sp = sps[i];
- if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&
- (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }
- } }
- return found
- }
- // Test whether there exists a collapsed span that partially
- // overlaps (covers the start or end, but not both) of a new span.
- // Such overlap is not allowed.
- function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
- var line = getLine(doc, lineNo);
- var sps = sawCollapsedSpans && line.markedSpans;
- if (sps) { for (var i = 0; i < sps.length; ++i) {
- var sp = sps[i];
- if (!sp.marker.collapsed) { continue }
- var found = sp.marker.find(0);
- var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);
- var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);
- if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }
- if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||
- fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))
- { return true }
- } }
- }
- // A visual line is a line as drawn on the screen. Folding, for
- // example, can cause multiple logical lines to appear on the same
- // visual line. This finds the start of the visual line that the
- // given line is part of (usually that is the line itself).
- function visualLine(line) {
- var merged;
- while (merged = collapsedSpanAtStart(line))
- { line = merged.find(-1, true).line; }
- return line
- }
- function visualLineEnd(line) {
- var merged;
- while (merged = collapsedSpanAtEnd(line))
- { line = merged.find(1, true).line; }
- return line
- }
- // Returns an array of logical lines that continue the visual line
- // started by the argument, or undefined if there are no such lines.
- function visualLineContinued(line) {
- var merged, lines;
- while (merged = collapsedSpanAtEnd(line)) {
- line = merged.find(1, true).line
- ;(lines || (lines = [])).push(line);
- }
- return lines
- }
- // Get the line number of the start of the visual line that the
- // given line number is part of.
- function visualLineNo(doc, lineN) {
- var line = getLine(doc, lineN), vis = visualLine(line);
- if (line == vis) { return lineN }
- return lineNo(vis)
- }
- // Get the line number of the start of the next visual line after
- // the given line.
- function visualLineEndNo(doc, lineN) {
- if (lineN > doc.lastLine()) { return lineN }
- var line = getLine(doc, lineN), merged;
- if (!lineIsHidden(doc, line)) { return lineN }
- while (merged = collapsedSpanAtEnd(line))
- { line = merged.find(1, true).line; }
- return lineNo(line) + 1
- }
- // Compute whether a line is hidden. Lines count as hidden when they
- // are part of a visual line that starts with another line, or when
- // they are entirely covered by collapsed, non-widget span.
- function lineIsHidden(doc, line) {
- var sps = sawCollapsedSpans && line.markedSpans;
- if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
- sp = sps[i];
- if (!sp.marker.collapsed) { continue }
- if (sp.from == null) { return true }
- if (sp.marker.widgetNode) { continue }
- if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))
- { return true }
- } }
- }
- function lineIsHiddenInner(doc, line, span) {
- if (span.to == null) {
- var end = span.marker.find(1, true);
- return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))
- }
- if (span.marker.inclusiveRight && span.to == line.text.length)
- { return true }
- for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {
- sp = line.markedSpans[i];
- if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
- (sp.to == null || sp.to != span.from) &&
- (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
- lineIsHiddenInner(doc, line, sp)) { return true }
- }
- }
- // Find the height above the given line.
- function heightAtLine(lineObj) {
- lineObj = visualLine(lineObj);
- var h = 0, chunk = lineObj.parent;
- for (var i = 0; i < chunk.lines.length; ++i) {
- var line = chunk.lines[i];
- if (line == lineObj) { break }
- else { h += line.height; }
- }
- for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
- for (var i$1 = 0; i$1 < p.children.length; ++i$1) {
- var cur = p.children[i$1];
- if (cur == chunk) { break }
- else { h += cur.height; }
- }
- }
- return h
- }
- // Compute the character length of a line, taking into account
- // collapsed ranges (see markText) that might hide parts, and join
- // other lines onto it.
- function lineLength(line) {
- if (line.height == 0) { return 0 }
- var len = line.text.length, merged, cur = line;
- while (merged = collapsedSpanAtStart(cur)) {
- var found = merged.find(0, true);
- cur = found.from.line;
- len += found.from.ch - found.to.ch;
- }
- cur = line;
- while (merged = collapsedSpanAtEnd(cur)) {
- var found$1 = merged.find(0, true);
- len -= cur.text.length - found$1.from.ch;
- cur = found$1.to.line;
- len += cur.text.length - found$1.to.ch;
- }
- return len
- }
- // Find the longest line in the document.
- function findMaxLine(cm) {
- var d = cm.display, doc = cm.doc;
- d.maxLine = getLine(doc, doc.first);
- d.maxLineLength = lineLength(d.maxLine);
- d.maxLineChanged = true;
- doc.iter(function (line) {
- var len = lineLength(line);
- if (len > d.maxLineLength) {
- d.maxLineLength = len;
- d.maxLine = line;
- }
- });
- }
- // LINE DATA STRUCTURE
- // Line objects. These hold state related to a line, including
- // highlighting info (the styles array).
- var Line = function(text, markedSpans, estimateHeight) {
- this.text = text;
- attachMarkedSpans(this, markedSpans);
- this.height = estimateHeight ? estimateHeight(this) : 1;
- };
- Line.prototype.lineNo = function () { return lineNo(this) };
- eventMixin(Line);
- // Change the content (text, markers) of a line. Automatically
- // invalidates cached information and tries to re-estimate the
- // line's height.
- function updateLine(line, text, markedSpans, estimateHeight) {
- line.text = text;
- if (line.stateAfter) { line.stateAfter = null; }
- if (line.styles) { line.styles = null; }
- if (line.order != null) { line.order = null; }
- detachMarkedSpans(line);
- attachMarkedSpans(line, markedSpans);
- var estHeight = estimateHeight ? estimateHeight(line) : 1;
- if (estHeight != line.height) { updateLineHeight(line, estHeight); }
- }
- // Detach a line from the document tree and its markers.
- function cleanUpLine(line) {
- line.parent = null;
- detachMarkedSpans(line);
- }
- // Convert a style as returned by a mode (either null, or a string
- // containing one or more styles) to a CSS style. This is cached,
- // and also looks for line-wide styles.
- var styleToClassCache = {}, styleToClassCacheWithMode = {};
- function interpretTokenStyle(style, options) {
- if (!style || /^\s*$/.test(style)) { return null }
- var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;
- return cache[style] ||
- (cache[style] = style.replace(/\S+/g, "cm-$&"))
- }
- // Render the DOM representation of the text of a line. Also builds
- // up a 'line map', which points at the DOM nodes that represent
- // specific stretches of text, and is used by the measuring code.
- // The returned object contains the DOM node, this map, and
- // information about line-wide styles that were set by the mode.
- function buildLineContent(cm, lineView) {
- // The padding-right forces the element to have a 'border', which
- // is needed on Webkit to be able to get line-level bounding
- // rectangles for it (in measureChar).
- var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null);
- var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content,
- col: 0, pos: 0, cm: cm,
- trailingSpace: false,
- splitSpaces: cm.getOption("lineWrapping")};
- lineView.measure = {};
- // Iterate over the logical lines that make up this visual line.
- for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {
- var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);
- builder.pos = 0;
- builder.addToken = buildToken;
- // Optionally wire in some hacks into the token-rendering
- // algorithm, to deal with browser quirks.
- if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))
- { builder.addToken = buildTokenBadBidi(builder.addToken, order); }
- builder.map = [];
- var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);
- insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));
- if (line.styleClasses) {
- if (line.styleClasses.bgClass)
- { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); }
- if (line.styleClasses.textClass)
- { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); }
- }
- // Ensure at least a single node is present, for measuring.
- if (builder.map.length == 0)
- { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }
- // Store the map and a cache object for the current logical line
- if (i == 0) {
- lineView.measure.map = builder.map;
- lineView.measure.cache = {};
- } else {
- (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)
- ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});
- }
- }
- // See issue #2901
- if (webkit) {
- var last = builder.content.lastChild;
- if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab")))
- { builder.content.className = "cm-tab-wrap-hack"; }
- }
- signal(cm, "renderLine", cm, lineView.line, builder.pre);
- if (builder.pre.className)
- { builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); }
- return builder
- }
- function defaultSpecialCharPlaceholder(ch) {
- var token = elt("span", "\u2022", "cm-invalidchar");
- token.title = "\\u" + ch.charCodeAt(0).toString(16);
- token.setAttribute("aria-label", token.title);
- return token
- }
- // Build up the DOM representation for a single token, and add it to
- // the line map. Takes care to render special characters separately.
- function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {
- if (!text) { return }
- var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;
- var special = builder.cm.state.specialChars, mustWrap = false;
- var content;
- if (!special.test(text)) {
- builder.col += text.length;
- content = document.createTextNode(displayText);
- builder.map.push(builder.pos, builder.pos + text.length, content);
- if (ie && ie_version < 9) { mustWrap = true; }
- builder.pos += text.length;
- } else {
- content = document.createDocumentFragment();
- var pos = 0;
- while (true) {
- special.lastIndex = pos;
- var m = special.exec(text);
- var skipped = m ? m.index - pos : text.length - pos;
- if (skipped) {
- var txt = document.createTextNode(displayText.slice(pos, pos + skipped));
- if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])); }
- else { content.appendChild(txt); }
- builder.map.push(builder.pos, builder.pos + skipped, txt);
- builder.col += skipped;
- builder.pos += skipped;
- }
- if (!m) { break }
- pos += skipped + 1;
- var txt$1 = (void 0);
- if (m[0] == "\t") {
- var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;
- txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"));
- txt$1.setAttribute("role", "presentation");
- txt$1.setAttribute("cm-text", "\t");
- builder.col += tabWidth;
- } else if (m[0] == "\r" || m[0] == "\n") {
- txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar"));
- txt$1.setAttribute("cm-text", m[0]);
- builder.col += 1;
- } else {
- txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);
- txt$1.setAttribute("cm-text", m[0]);
- if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])); }
- else { content.appendChild(txt$1); }
- builder.col += 1;
- }
- builder.map.push(builder.pos, builder.pos + 1, txt$1);
- builder.pos++;
- }
- }
- builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;
- if (style || startStyle || endStyle || mustWrap || css || attributes) {
- var fullStyle = style || "";
- if (startStyle) { fullStyle += startStyle; }
- if (endStyle) { fullStyle += endStyle; }
- var token = elt("span", [content], fullStyle, css);
- if (attributes) {
- for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class")
- { token.setAttribute(attr, attributes[attr]); } }
- }
- return builder.content.appendChild(token)
- }
- builder.content.appendChild(content);
- }
- // Change some spaces to NBSP to prevent the browser from collapsing
- // trailing spaces at the end of a line when rendering text (issue #1362).
- function splitSpaces(text, trailingBefore) {
- if (text.length > 1 && !/ /.test(text)) { return text }
- var spaceBefore = trailingBefore, result = "";
- for (var i = 0; i < text.length; i++) {
- var ch = text.charAt(i);
- if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))
- { ch = "\u00a0"; }
- result += ch;
- spaceBefore = ch == " ";
- }
- return result
- }
- // Work around nonsense dimensions being reported for stretches of
- // right-to-left text.
- function buildTokenBadBidi(inner, order) {
- return function (builder, text, style, startStyle, endStyle, css, attributes) {
- style = style ? style + " cm-force-border" : "cm-force-border";
- var start = builder.pos, end = start + text.length;
- for (;;) {
- // Find the part that overlaps with the start of this text
- var part = (void 0);
- for (var i = 0; i < order.length; i++) {
- part = order[i];
- if (part.to > start && part.from <= start) { break }
- }
- if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }
- inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);
- startStyle = null;
- text = text.slice(part.to - start);
- start = part.to;
- }
- }
- }
- function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
- var widget = !ignoreWidget && marker.widgetNode;
- if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }
- if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
- if (!widget)
- { widget = builder.content.appendChild(document.createElement("span")); }
- widget.setAttribute("cm-marker", marker.id);
- }
- if (widget) {
- builder.cm.display.input.setUneditable(widget);
- builder.content.appendChild(widget);
- }
- builder.pos += size;
- builder.trailingSpace = false;
- }
- // Outputs a number of spans to make up a line, taking highlighting
- // and marked text into account.
- function insertLineContent(line, builder, styles) {
- var spans = line.markedSpans, allText = line.text, at = 0;
- if (!spans) {
- for (var i$1 = 1; i$1 < styles.length; i$1+=2)
- { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }
- return
- }
- var len = allText.length, pos = 0, i = 1, text = "", style, css;
- var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;
- for (;;) {
- if (nextChange == pos) { // Update current marker set
- spanStyle = spanEndStyle = spanStartStyle = css = "";
- attributes = null;
- collapsed = null; nextChange = Infinity;
- var foundBookmarks = [], endStyles = (void 0);
- for (var j = 0; j < spans.length; ++j) {
- var sp = spans[j], m = sp.marker;
- if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
- foundBookmarks.push(m);
- } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {
- if (sp.to != null && sp.to != pos && nextChange > sp.to) {
- nextChange = sp.to;
- spanEndStyle = "";
- }
- if (m.className) { spanStyle += " " + m.className; }
- if (m.css) { css = (css ? css + ";" : "") + m.css; }
- if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; }
- if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }
- // support for the old title property
- // https://github.com/codemirror/CodeMirror/pull/5673
- if (m.title) { (attributes || (attributes = {})).title = m.title; }
- if (m.attributes) {
- for (var attr in m.attributes)
- { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }
- }
- if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
- { collapsed = sp; }
- } else if (sp.from > pos && nextChange > sp.from) {
- nextChange = sp.from;
- }
- }
- if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)
- { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1]; } } }
- if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)
- { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }
- if (collapsed && (collapsed.from || 0) == pos) {
- buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
- collapsed.marker, collapsed.from == null);
- if (collapsed.to == null) { return }
- if (collapsed.to == pos) { collapsed = false; }
- }
- }
- if (pos >= len) { break }
- var upto = Math.min(len, nextChange);
- while (true) {
- if (text) {
- var end = pos + text.length;
- if (!collapsed) {
- var tokenText = end > upto ? text.slice(0, upto - pos) : text;
- builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
- spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes);
- }
- if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}
- pos = end;
- spanStartStyle = "";
- }
- text = allText.slice(at, at = styles[i++]);
- style = interpretTokenStyle(styles[i++], builder.cm.options);
- }
- }
- }
- // These objects are used to represent the visible (currently drawn)
- // part of the document. A LineView may correspond to multiple
- // logical lines, if those are connected by collapsed ranges.
- function LineView(doc, line, lineN) {
- // The starting line
- this.line = line;
- // Continuing lines, if any
- this.rest = visualLineContinued(line);
- // Number of logical lines in this visual line
- this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;
- this.node = this.text = null;
- this.hidden = lineIsHidden(doc, line);
- }
- // Create a range of LineView objects for the given lines.
- function buildViewArray(cm, from, to) {
- var array = [], nextPos;
- for (var pos = from; pos < to; pos = nextPos) {
- var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);
- nextPos = pos + view.size;
- array.push(view);
- }
- return array
- }
- var operationGroup = null;
- function pushOperation(op) {
- if (operationGroup) {
- operationGroup.ops.push(op);
- } else {
- op.ownsGroup = operationGroup = {
- ops: [op],
- delayedCallbacks: []
- };
- }
- }
- function fireCallbacksForOps(group) {
- // Calls delayed callbacks and cursorActivity handlers until no
- // new ones appear
- var callbacks = group.delayedCallbacks, i = 0;
- do {
- for (; i < callbacks.length; i++)
- { callbacks[i].call(null); }
- for (var j = 0; j < group.ops.length; j++) {
- var op = group.ops[j];
- if (op.cursorActivityHandlers)
- { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)
- { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }
- }
- } while (i < callbacks.length)
- }
- function finishOperation(op, endCb) {
- var group = op.ownsGroup;
- if (!group) { return }
- try { fireCallbacksForOps(group); }
- finally {
- operationGroup = null;
- endCb(group);
- }
- }
- var orphanDelayedCallbacks = null;
- // Often, we want to signal events at a point where we are in the
- // middle of some work, but don't want the handler to start calling
- // other methods on the editor, which might be in an inconsistent
- // state or simply not expect any other events to happen.
- // signalLater looks whether there are any handlers, and schedules
- // them to be executed when the last operation ends, or, if no
- // operation is active, when a timeout fires.
- function signalLater(emitter, type /*, values...*/) {
- var arr = getHandlers(emitter, type);
- if (!arr.length) { return }
- var args = Array.prototype.slice.call(arguments, 2), list;
- if (operationGroup) {
- list = operationGroup.delayedCallbacks;
- } else if (orphanDelayedCallbacks) {
- list = orphanDelayedCallbacks;
- } else {
- list = orphanDelayedCallbacks = [];
- setTimeout(fireOrphanDelayed, 0);
- }
- var loop = function ( i ) {
- list.push(function () { return arr[i].apply(null, args); });
- };
- for (var i = 0; i < arr.length; ++i)
- loop( i );
- }
- function fireOrphanDelayed() {
- var delayed = orphanDelayedCallbacks;
- orphanDelayedCallbacks = null;
- for (var i = 0; i < delayed.length; ++i) { delayed[i](); }
- }
- // When an aspect of a line changes, a string is added to
- // lineView.changes. This updates the relevant part of the line's
- // DOM structure.
- function updateLineForChanges(cm, lineView, lineN, dims) {
- for (var j = 0; j < lineView.changes.length; j++) {
- var type = lineView.changes[j];
- if (type == "text") { updateLineText(cm, lineView); }
- else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims); }
- else if (type == "class") { updateLineClasses(cm, lineView); }
- else if (type == "widget") { updateLineWidgets(cm, lineView, dims); }
- }
- lineView.changes = null;
- }
- // Lines with gutter elements, widgets or a background class need to
- // be wrapped, and have the extra elements added to the wrapper div
- function ensureLineWrapped(lineView) {
- if (lineView.node == lineView.text) {
- lineView.node = elt("div", null, null, "position: relative");
- if (lineView.text.parentNode)
- { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }
- lineView.node.appendChild(lineView.text);
- if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }
- }
- return lineView.node
- }
- function updateLineBackground(cm, lineView) {
- var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass;
- if (cls) { cls += " CodeMirror-linebackground"; }
- if (lineView.background) {
- if (cls) { lineView.background.className = cls; }
- else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }
- } else if (cls) {
- var wrap = ensureLineWrapped(lineView);
- lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild);
- cm.display.input.setUneditable(lineView.background);
- }
- }
- // Wrapper around buildLineContent which will reuse the structure
- // in display.externalMeasured when possible.
- function getLineContent(cm, lineView) {
- var ext = cm.display.externalMeasured;
- if (ext && ext.line == lineView.line) {
- cm.display.externalMeasured = null;
- lineView.measure = ext.measure;
- return ext.built
- }
- return buildLineContent(cm, lineView)
- }
- // Redraw the line's text. Interacts with the background and text
- // classes because the mode may output tokens that influence these
- // classes.
- function updateLineText(cm, lineView) {
- var cls = lineView.text.className;
- var built = getLineContent(cm, lineView);
- if (lineView.text == lineView.node) { lineView.node = built.pre; }
- lineView.text.parentNode.replaceChild(built.pre, lineView.text);
- lineView.text = built.pre;
- if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {
- lineView.bgClass = built.bgClass;
- lineView.textClass = built.textClass;
- updateLineClasses(cm, lineView);
- } else if (cls) {
- lineView.text.className = cls;
- }
- }
- function updateLineClasses(cm, lineView) {
- updateLineBackground(cm, lineView);
- if (lineView.line.wrapClass)
- { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }
- else if (lineView.node != lineView.text)
- { lineView.node.className = ""; }
- var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass;
- lineView.text.className = textClass || "";
- }
- function updateLineGutter(cm, lineView, lineN, dims) {
- if (lineView.gutter) {
- lineView.node.removeChild(lineView.gutter);
- lineView.gutter = null;
- }
- if (lineView.gutterBackground) {
- lineView.node.removeChild(lineView.gutterBackground);
- lineView.gutterBackground = null;
- }
- if (lineView.line.gutterClass) {
- var wrap = ensureLineWrapped(lineView);
- lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
- ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px"));
- cm.display.input.setUneditable(lineView.gutterBackground);
- wrap.insertBefore(lineView.gutterBackground, lineView.text);
- }
- var markers = lineView.line.gutterMarkers;
- if (cm.options.lineNumbers || markers) {
- var wrap$1 = ensureLineWrapped(lineView);
- var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"));
- gutterWrap.setAttribute("aria-hidden", "true");
- cm.display.input.setUneditable(gutterWrap);
- wrap$1.insertBefore(gutterWrap, lineView.text);
- if (lineView.line.gutterClass)
- { gutterWrap.className += " " + lineView.line.gutterClass; }
- if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
- { lineView.lineNumber = gutterWrap.appendChild(
- elt("div", lineNumberFor(cm.options, lineN),
- "CodeMirror-linenumber CodeMirror-gutter-elt",
- ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))); }
- if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {
- var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];
- if (found)
- { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt",
- ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))); }
- } }
- }
- }
- function updateLineWidgets(cm, lineView, dims) {
- if (lineView.alignable) { lineView.alignable = null; }
- var isWidget = classTest("CodeMirror-linewidget");
- for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {
- next = node.nextSibling;
- if (isWidget.test(node.className)) { lineView.node.removeChild(node); }
- }
- insertLineWidgets(cm, lineView, dims);
- }
- // Build a line's DOM representation from scratch
- function buildLineElement(cm, lineView, lineN, dims) {
- var built = getLineContent(cm, lineView);
- lineView.text = lineView.node = built.pre;
- if (built.bgClass) { lineView.bgClass = built.bgClass; }
- if (built.textClass) { lineView.textClass = built.textClass; }
- updateLineClasses(cm, lineView);
- updateLineGutter(cm, lineView, lineN, dims);
- insertLineWidgets(cm, lineView, dims);
- return lineView.node
- }
- // A lineView may contain multiple logical lines (when merged by
- // collapsed spans). The widgets for all of them need to be drawn.
- function insertLineWidgets(cm, lineView, dims) {
- insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);
- if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
- { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }
- }
- function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
- if (!line.widgets) { return }
- var wrap = ensureLineWrapped(lineView);
- for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
- var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget" + (widget.className ? " " + widget.className : ""));
- if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true"); }
- positionLineWidget(widget, node, lineView, dims);
- cm.display.input.setUneditable(node);
- if (allowAbove && widget.above)
- { wrap.insertBefore(node, lineView.gutter || lineView.text); }
- else
- { wrap.appendChild(node); }
- signalLater(widget, "redraw");
- }
- }
- function positionLineWidget(widget, node, lineView, dims) {
- if (widget.noHScroll) {
- (lineView.alignable || (lineView.alignable = [])).push(node);
- var width = dims.wrapperWidth;
- node.style.left = dims.fixedPos + "px";
- if (!widget.coverGutter) {
- width -= dims.gutterTotalWidth;
- node.style.paddingLeft = dims.gutterTotalWidth + "px";
- }
- node.style.width = width + "px";
- }
- if (widget.coverGutter) {
- node.style.zIndex = 5;
- node.style.position = "relative";
- if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px"; }
- }
- }
- function widgetHeight(widget) {
- if (widget.height != null) { return widget.height }
- var cm = widget.doc.cm;
- if (!cm) { return 0 }
- if (!contains(document.body, widget.node)) {
- var parentStyle = "position: relative;";
- if (widget.coverGutter)
- { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; }
- if (widget.noHScroll)
- { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; }
- removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle));
- }
- return widget.height = widget.node.parentNode.offsetHeight
- }
- // Return true when the given mouse event happened in a widget
- function eventInWidget(display, e) {
- for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
- if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") ||
- (n.parentNode == display.sizer && n != display.mover))
- { return true }
- }
- }
- // POSITION MEASUREMENT
- function paddingTop(display) {return display.lineSpace.offsetTop}
- function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}
- function paddingH(display) {
- if (display.cachedPaddingH) { return display.cachedPaddingH }
- var e = removeChildrenAndAdd(display.measure, elt("pre", "x", "CodeMirror-line-like"));
- var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;
- var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};
- if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }
- return data
- }
- function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }
- function displayWidth(cm) {
- return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth
- }
- function displayHeight(cm) {
- return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight
- }
- // Ensure the lineView.wrapping.heights array is populated. This is
- // an array of bottom offsets for the lines that make up a drawn
- // line. When lineWrapping is on, there might be more than one
- // height.
- function ensureLineHeights(cm, lineView, rect) {
- var wrapping = cm.options.lineWrapping;
- var curWidth = wrapping && displayWidth(cm);
- if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {
- var heights = lineView.measure.heights = [];
- if (wrapping) {
- lineView.measure.width = curWidth;
- var rects = lineView.text.firstChild.getClientRects();
- for (var i = 0; i < rects.length - 1; i++) {
- var cur = rects[i], next = rects[i + 1];
- if (Math.abs(cur.bottom - next.bottom) > 2)
- { heights.push((cur.bottom + next.top) / 2 - rect.top); }
- }
- }
- heights.push(rect.bottom - rect.top);
- }
- }
- // Find a line map (mapping character offsets to text nodes) and a
- // measurement cache for the given line number. (A line view might
- // contain multiple lines when collapsed ranges are present.)
- function mapFromLineView(lineView, line, lineN) {
- if (lineView.line == line)
- { return {map: lineView.measure.map, cache: lineView.measure.cache} }
- if (lineView.rest) {
- for (var i = 0; i < lineView.rest.length; i++)
- { if (lineView.rest[i] == line)
- { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
- for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
- { if (lineNo(lineView.rest[i$1]) > lineN)
- { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
- }
- }
- // Render a line into the hidden node display.externalMeasured. Used
- // when measurement is needed for a line that's not in the viewport.
- function updateExternalMeasurement(cm, line) {
- line = visualLine(line);
- var lineN = lineNo(line);
- var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);
- view.lineN = lineN;
- var built = view.built = buildLineContent(cm, view);
- view.text = built.pre;
- removeChildrenAndAdd(cm.display.lineMeasure, built.pre);
- return view
- }
- // Get a {top, bottom, left, right} box (in line-local coordinates)
- // for a given character.
- function measureChar(cm, line, ch, bias) {
- return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)
- }
- // Find a line view that corresponds to the given line number.
- function findViewForLine(cm, lineN) {
- if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)
- { return cm.display.view[findViewIndex(cm, lineN)] }
- var ext = cm.display.externalMeasured;
- if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)
- { return ext }
- }
- // Measurement can be split in two steps, the set-up work that
- // applies to the whole line, and the measurement of the actual
- // character. Functions like coordsChar, that need to do a lot of
- // measurements in a row, can thus ensure that the set-up work is
- // only done once.
- function prepareMeasureForLine(cm, line) {
- var lineN = lineNo(line);
- var view = findViewForLine(cm, lineN);
- if (view && !view.text) {
- view = null;
- } else if (view && view.changes) {
- updateLineForChanges(cm, view, lineN, getDimensions(cm));
- cm.curOp.forceUpdate = true;
- }
- if (!view)
- { view = updateExternalMeasurement(cm, line); }
- var info = mapFromLineView(view, line, lineN);
- return {
- line: line, view: view, rect: null,
- map: info.map, cache: info.cache, before: info.before,
- hasHeights: false
- }
- }
- // Given a prepared measurement object, measures the position of an
- // actual character (or fetches it from the cache).
- function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
- if (prepared.before) { ch = -1; }
- var key = ch + (bias || ""), found;
- if (prepared.cache.hasOwnProperty(key)) {
- found = prepared.cache[key];
- } else {
- if (!prepared.rect)
- { prepared.rect = prepared.view.text.getBoundingClientRect(); }
- if (!prepared.hasHeights) {
- ensureLineHeights(cm, prepared.view, prepared.rect);
- prepared.hasHeights = true;
- }
- found = measureCharInner(cm, prepared, ch, bias);
- if (!found.bogus) { prepared.cache[key] = found; }
- }
- return {left: found.left, right: found.right,
- top: varHeight ? found.rtop : found.top,
- bottom: varHeight ? found.rbottom : found.bottom}
- }
- var nullRect = {left: 0, right: 0, top: 0, bottom: 0};
- function nodeAndOffsetInLineMap(map, ch, bias) {
- var node, start, end, collapse, mStart, mEnd;
- // First, search the line map for the text node corresponding to,
- // or closest to, the target character.
- for (var i = 0; i < map.length; i += 3) {
- mStart = map[i];
- mEnd = map[i + 1];
- if (ch < mStart) {
- start = 0; end = 1;
- collapse = "left";
- } else if (ch < mEnd) {
- start = ch - mStart;
- end = start + 1;
- } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {
- end = mEnd - mStart;
- start = end - 1;
- if (ch >= mEnd) { collapse = "right"; }
- }
- if (start != null) {
- node = map[i + 2];
- if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right"))
- { collapse = bias; }
- if (bias == "left" && start == 0)
- { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {
- node = map[(i -= 3) + 2];
- collapse = "left";
- } }
- if (bias == "right" && start == mEnd - mStart)
- { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {
- node = map[(i += 3) + 2];
- collapse = "right";
- } }
- break
- }
- }
- return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}
- }
- function getUsefulRect(rects, bias) {
- var rect = nullRect;
- if (bias == "left") { for (var i = 0; i < rects.length; i++) {
- if ((rect = rects[i]).left != rect.right) { break }
- } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {
- if ((rect = rects[i$1]).left != rect.right) { break }
- } }
- return rect
- }
- function measureCharInner(cm, prepared, ch, bias) {
- var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);
- var node = place.node, start = place.start, end = place.end, collapse = place.collapse;
- var rect;
- if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.
- for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned
- while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }
- while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }
- if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)
- { rect = node.parentNode.getBoundingClientRect(); }
- else
- { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }
- if (rect.left || rect.right || start == 0) { break }
- end = start;
- start = start - 1;
- collapse = "right";
- }
- if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }
- } else { // If it is a widget, simply get the box for the whole widget.
- if (start > 0) { collapse = bias = "right"; }
- var rects;
- if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)
- { rect = rects[bias == "right" ? rects.length - 1 : 0]; }
- else
- { rect = node.getBoundingClientRect(); }
- }
- if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {
- var rSpan = node.parentNode.getClientRects()[0];
- if (rSpan)
- { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }
- else
- { rect = nullRect; }
- }
- var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;
- var mid = (rtop + rbot) / 2;
- var heights = prepared.view.measure.heights;
- var i = 0;
- for (; i < heights.length - 1; i++)
- { if (mid < heights[i]) { break } }
- var top = i ? heights[i - 1] : 0, bot = heights[i];
- var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left,
- right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left,
- top: top, bottom: bot};
- if (!rect.left && !rect.right) { result.bogus = true; }
- if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }
- return result
- }
- // Work around problem with bounding client rects on ranges being
- // returned incorrectly when zoomed on IE10 and below.
- function maybeUpdateRectForZooming(measure, rect) {
- if (!window.screen || screen.logicalXDPI == null ||
- screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))
- { return rect }
- var scaleX = screen.logicalXDPI / screen.deviceXDPI;
- var scaleY = screen.logicalYDPI / screen.deviceYDPI;
- return {left: rect.left * scaleX, right: rect.right * scaleX,
- top: rect.top * scaleY, bottom: rect.bottom * scaleY}
- }
- function clearLineMeasurementCacheFor(lineView) {
- if (lineView.measure) {
- lineView.measure.cache = {};
- lineView.measure.heights = null;
- if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
- { lineView.measure.caches[i] = {}; } }
- }
- }
- function clearLineMeasurementCache(cm) {
- cm.display.externalMeasure = null;
- removeChildren(cm.display.lineMeasure);
- for (var i = 0; i < cm.display.view.length; i++)
- { clearLineMeasurementCacheFor(cm.display.view[i]); }
- }
- function clearCaches(cm) {
- clearLineMeasurementCache(cm);
- cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;
- if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }
- cm.display.lineNumChars = null;
- }
- function pageScrollX() {
- // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206
- // which causes page_Offset and bounding client rects to use
- // different reference viewports and invalidate our calculations.
- if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }
- return window.pageXOffset || (document.documentElement || document.body).scrollLeft
- }
- function pageScrollY() {
- if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }
- return window.pageYOffset || (document.documentElement || document.body).scrollTop
- }
- function widgetTopHeight(lineObj) {
- var ref = visualLine(lineObj);
- var widgets = ref.widgets;
- var height = 0;
- if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)
- { height += widgetHeight(widgets[i]); } } }
- return height
- }
- // Converts a {top, bottom, left, right} box from line-local
- // coordinates into another coordinate system. Context may be one of
- // "line", "div" (display.lineDiv), "local"./null (editor), "window",
- // or "page".
- function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {
- if (!includeWidgets) {
- var height = widgetTopHeight(lineObj);
- rect.top += height; rect.bottom += height;
- }
- if (context == "line") { return rect }
- if (!context) { context = "local"; }
- var yOff = heightAtLine(lineObj);
- if (context == "local") { yOff += paddingTop(cm.display); }
- else { yOff -= cm.display.viewOffset; }
- if (context == "page" || context == "window") {
- var lOff = cm.display.lineSpace.getBoundingClientRect();
- yOff += lOff.top + (context == "window" ? 0 : pageScrollY());
- var xOff = lOff.left + (context == "window" ? 0 : pageScrollX());
- rect.left += xOff; rect.right += xOff;
- }
- rect.top += yOff; rect.bottom += yOff;
- return rect
- }
- // Coverts a box from "div" coords to another coordinate system.
- // Context may be "window", "page", "div", or "local"./null.
- function fromCoordSystem(cm, coords, context) {
- if (context == "div") { return coords }
- var left = coords.left, top = coords.top;
- // First move into "page" coordinate system
- if (context == "page") {
- left -= pageScrollX();
- top -= pageScrollY();
- } else if (context == "local" || !context) {
- var localBox = cm.display.sizer.getBoundingClientRect();
- left += localBox.left;
- top += localBox.top;
- }
- var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();
- return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}
- }
- function charCoords(cm, pos, context, lineObj, bias) {
- if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }
- return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)
- }
- // Returns a box for a given cursor position, which may have an
- // 'other' property containing the position of the secondary cursor
- // on a bidi boundary.
- // A cursor Pos(line, char, "before") is on the same visual line as `char - 1`
- // and after `char - 1` in writing order of `char - 1`
- // A cursor Pos(line, char, "after") is on the same visual line as `char`
- // and before `char` in writing order of `char`
- // Examples (upper-case letters are RTL, lower-case are LTR):
- // Pos(0, 1, ...)
- // before after
- // ab a|b a|b
- // aB a|B aB|
- // Ab |Ab A|b
- // AB B|A B|A
- // Every position after the last character on a line is considered to stick
- // to the last character on the line.
- function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
- lineObj = lineObj || getLine(cm.doc, pos.line);
- if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }
- function get(ch, right) {
- var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight);
- if (right) { m.left = m.right; } else { m.right = m.left; }
- return intoCoordSystem(cm, lineObj, m, context)
- }
- var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;
- if (ch >= lineObj.text.length) {
- ch = lineObj.text.length;
- sticky = "before";
- } else if (ch <= 0) {
- ch = 0;
- sticky = "after";
- }
- if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") }
- function getBidi(ch, partPos, invert) {
- var part = order[partPos], right = part.level == 1;
- return get(invert ? ch - 1 : ch, right != invert)
- }
- var partPos = getBidiPartAt(order, ch, sticky);
- var other = bidiOther;
- var val = getBidi(ch, partPos, sticky == "before");
- if (other != null) { val.other = getBidi(ch, other, sticky != "before"); }
- return val
- }
- // Used to cheaply estimate the coordinates for a position. Used for
- // intermediate scroll updates.
- function estimateCoords(cm, pos) {
- var left = 0;
- pos = clipPos(cm.doc, pos);
- if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }
- var lineObj = getLine(cm.doc, pos.line);
- var top = heightAtLine(lineObj) + paddingTop(cm.display);
- return {left: left, right: left, top: top, bottom: top + lineObj.height}
- }
- // Positions returned by coordsChar contain some extra information.
- // xRel is the relative x position of the input coordinates compared
- // to the found position (so xRel > 0 means the coordinates are to
- // the right of the character position, for example). When outside
- // is true, that means the coordinates lie outside the line's
- // vertical range.
- function PosWithInfo(line, ch, sticky, outside, xRel) {
- var pos = Pos(line, ch, sticky);
- pos.xRel = xRel;
- if (outside) { pos.outside = outside; }
- return pos
- }
- // Compute the character position closest to the given coordinates.
- // Input must be lineSpace-local ("div" coordinate system).
- function coordsChar(cm, x, y) {
- var doc = cm.doc;
- y += cm.display.viewOffset;
- if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }
- var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;
- if (lineN > last)
- { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }
- if (x < 0) { x = 0; }
- var lineObj = getLine(doc, lineN);
- for (;;) {
- var found = coordsCharInner(cm, lineObj, lineN, x, y);
- var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));
- if (!collapsed) { return found }
- var rangeEnd = collapsed.find(1);
- if (rangeEnd.line == lineN) { return rangeEnd }
- lineObj = getLine(doc, lineN = rangeEnd.line);
- }
- }
- function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
- y -= widgetTopHeight(lineObj);
- var end = lineObj.text.length;
- var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);
- end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);
- return {begin: begin, end: end}
- }
- function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
- if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }
- var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top;
- return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)
- }
- // Returns true if the given side of a box is after the given
- // coordinates, in top-to-bottom, left-to-right order.
- function boxIsAfter(box, x, y, left) {
- return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x
- }
- function coordsCharInner(cm, lineObj, lineNo, x, y) {
- // Move y into line-local coordinate space
- y -= heightAtLine(lineObj);
- var preparedMeasure = prepareMeasureForLine(cm, lineObj);
- // When directly calling `measureCharPrepared`, we have to adjust
- // for the widgets at this line.
- var widgetHeight = widgetTopHeight(lineObj);
- var begin = 0, end = lineObj.text.length, ltr = true;
- var order = getOrder(lineObj, cm.doc.direction);
- // If the line isn't plain left-to-right text, first figure out
- // which bidi section the coordinates fall into.
- if (order) {
- var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)
- (cm, lineObj, lineNo, preparedMeasure, order, x, y);
- ltr = part.level != 1;
- // The awkward -1 offsets are needed because findFirst (called
- // on these below) will treat its first bound as inclusive,
- // second as exclusive, but we want to actually address the
- // characters in the part's range
- begin = ltr ? part.from : part.to - 1;
- end = ltr ? part.to : part.from - 1;
- }
- // A binary search to find the first character whose bounding box
- // starts after the coordinates. If we run across any whose box wrap
- // the coordinates, store that.
- var chAround = null, boxAround = null;
- var ch = findFirst(function (ch) {
- var box = measureCharPrepared(cm, preparedMeasure, ch);
- box.top += widgetHeight; box.bottom += widgetHeight;
- if (!boxIsAfter(box, x, y, false)) { return false }
- if (box.top <= y && box.left <= x) {
- chAround = ch;
- boxAround = box;
- }
- return true
- }, begin, end);
- var baseX, sticky, outside = false;
- // If a box around the coordinates was found, use that
- if (boxAround) {
- // Distinguish coordinates nearer to the left or right side of the box
- var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;
- ch = chAround + (atStart ? 0 : 1);
- sticky = atStart ? "after" : "before";
- baseX = atLeft ? boxAround.left : boxAround.right;
- } else {
- // (Adjust for extended bound, if necessary.)
- if (!ltr && (ch == end || ch == begin)) { ch++; }
- // To determine which side to associate with, get the box to the
- // left of the character and compare it's vertical position to the
- // coordinates
- sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" :
- (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?
- "after" : "before";
- // Now get accurate coordinates for this place, in order to get a
- // base X position
- var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), "line", lineObj, preparedMeasure);
- baseX = coords.left;
- outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;
- }
- ch = skipExtendingChars(lineObj.text, ch, 1);
- return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)
- }
- function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {
- // Bidi parts are sorted left-to-right, and in a non-line-wrapping
- // situation, we can take this ordering to correspond to the visual
- // ordering. This finds the first part whose end is after the given
- // coordinates.
- var index = findFirst(function (i) {
- var part = order[i], ltr = part.level != 1;
- return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"),
- "line", lineObj, preparedMeasure), x, y, true)
- }, 0, order.length - 1);
- var part = order[index];
- // If this isn't the first part, the part's start is also after
- // the coordinates, and the coordinates aren't on the same line as
- // that start, move one part back.
- if (index > 0) {
- var ltr = part.level != 1;
- var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"),
- "line", lineObj, preparedMeasure);
- if (boxIsAfter(start, x, y, true) && start.top > y)
- { part = order[index - 1]; }
- }
- return part
- }
- function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {
- // In a wrapped line, rtl text on wrapping boundaries can do things
- // that don't correspond to the ordering in our `order` array at
- // all, so a binary search doesn't work, and we want to return a
- // part that only spans one line so that the binary search in
- // coordsCharInner is safe. As such, we first find the extent of the
- // wrapped line, and then do a flat search in which we discard any
- // spans that aren't on the line.
- var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);
- var begin = ref.begin;
- var end = ref.end;
- if (/\s/.test(lineObj.text.charAt(end - 1))) { end--; }
- var part = null, closestDist = null;
- for (var i = 0; i < order.length; i++) {
- var p = order[i];
- if (p.from >= end || p.to <= begin) { continue }
- var ltr = p.level != 1;
- var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;
- // Weigh against spans ending before this, so that they are only
- // picked if nothing ends after
- var dist = endX < x ? x - endX + 1e9 : endX - x;
- if (!part || closestDist > dist) {
- part = p;
- closestDist = dist;
- }
- }
- if (!part) { part = order[order.length - 1]; }
- // Clip the part to the wrapped line.
- if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }
- if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }
- return part
- }
- var measureText;
- // Compute the default text height.
- function textHeight(display) {
- if (display.cachedTextHeight != null) { return display.cachedTextHeight }
- if (measureText == null) {
- measureText = elt("pre", null, "CodeMirror-line-like");
- // Measure a bunch of lines, for browsers that compute
- // fractional heights.
- for (var i = 0; i < 49; ++i) {
- measureText.appendChild(document.createTextNode("x"));
- measureText.appendChild(elt("br"));
- }
- measureText.appendChild(document.createTextNode("x"));
- }
- removeChildrenAndAdd(display.measure, measureText);
- var height = measureText.offsetHeight / 50;
- if (height > 3) { display.cachedTextHeight = height; }
- removeChildren(display.measure);
- return height || 1
- }
- // Compute the default character width.
- function charWidth(display) {
- if (display.cachedCharWidth != null) { return display.cachedCharWidth }
- var anchor = elt("span", "xxxxxxxxxx");
- var pre = elt("pre", [anchor], "CodeMirror-line-like");
- removeChildrenAndAdd(display.measure, pre);
- var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;
- if (width > 2) { display.cachedCharWidth = width; }
- return width || 10
- }
- // Do a bulk-read of the DOM positions and sizes needed to draw the
- // view, so that we don't interleave reading and writing to the DOM.
- function getDimensions(cm) {
- var d = cm.display, left = {}, width = {};
- var gutterLeft = d.gutters.clientLeft;
- for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
- var id = cm.display.gutterSpecs[i].className;
- left[id] = n.offsetLeft + n.clientLeft + gutterLeft;
- width[id] = n.clientWidth;
- }
- return {fixedPos: compensateForHScroll(d),
- gutterTotalWidth: d.gutters.offsetWidth,
- gutterLeft: left,
- gutterWidth: width,
- wrapperWidth: d.wrapper.clientWidth}
- }
- // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,
- // but using getBoundingClientRect to get a sub-pixel-accurate
- // result.
- function compensateForHScroll(display) {
- return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left
- }
- // Returns a function that estimates the height of a line, to use as
- // first approximation until the line becomes visible (and is thus
- // properly measurable).
- function estimateHeight(cm) {
- var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;
- var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);
- return function (line) {
- if (lineIsHidden(cm.doc, line)) { return 0 }
- var widgetsHeight = 0;
- if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {
- if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }
- } }
- if (wrapping)
- { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }
- else
- { return widgetsHeight + th }
- }
- }
- function estimateLineHeights(cm) {
- var doc = cm.doc, est = estimateHeight(cm);
- doc.iter(function (line) {
- var estHeight = est(line);
- if (estHeight != line.height) { updateLineHeight(line, estHeight); }
- });
- }
- // Given a mouse event, find the corresponding position. If liberal
- // is false, it checks whether a gutter or scrollbar was clicked,
- // and returns null if it was. forRect is used by rectangular
- // selections, and tries to estimate a character position even for
- // coordinates beyond the right of the text.
- function posFromMouse(cm, e, liberal, forRect) {
- var display = cm.display;
- if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null }
- var x, y, space = display.lineSpace.getBoundingClientRect();
- // Fails unpredictably on IE[67] when mouse is dragged around quickly.
- try { x = e.clientX - space.left; y = e.clientY - space.top; }
- catch (e$1) { return null }
- var coords = coordsChar(cm, x, y), line;
- if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
- var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;
- coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));
- }
- return coords
- }
- // Find the view element corresponding to a given line. Return null
- // when the line isn't visible.
- function findViewIndex(cm, n) {
- if (n >= cm.display.viewTo) { return null }
- n -= cm.display.viewFrom;
- if (n < 0) { return null }
- var view = cm.display.view;
- for (var i = 0; i < view.length; i++) {
- n -= view[i].size;
- if (n < 0) { return i }
- }
- }
- // Updates the display.view data structure for a given change to the
- // document. From and to are in pre-change coordinates. Lendiff is
- // the amount of lines added or subtracted by the change. This is
- // used for changes that span multiple lines, or change the way
- // lines are divided into visual lines. regLineChange (below)
- // registers single-line changes.
- function regChange(cm, from, to, lendiff) {
- if (from == null) { from = cm.doc.first; }
- if (to == null) { to = cm.doc.first + cm.doc.size; }
- if (!lendiff) { lendiff = 0; }
- var display = cm.display;
- if (lendiff && to < display.viewTo &&
- (display.updateLineNumbers == null || display.updateLineNumbers > from))
- { display.updateLineNumbers = from; }
- cm.curOp.viewChanged = true;
- if (from >= display.viewTo) { // Change after
- if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)
- { resetView(cm); }
- } else if (to <= display.viewFrom) { // Change before
- if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {
- resetView(cm);
- } else {
- display.viewFrom += lendiff;
- display.viewTo += lendiff;
- }
- } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap
- resetView(cm);
- } else if (from <= display.viewFrom) { // Top overlap
- var cut = viewCuttingPoint(cm, to, to + lendiff, 1);
- if (cut) {
- display.view = display.view.slice(cut.index);
- display.viewFrom = cut.lineN;
- display.viewTo += lendiff;
- } else {
- resetView(cm);
- }
- } else if (to >= display.viewTo) { // Bottom overlap
- var cut$1 = viewCuttingPoint(cm, from, from, -1);
- if (cut$1) {
- display.view = display.view.slice(0, cut$1.index);
- display.viewTo = cut$1.lineN;
- } else {
- resetView(cm);
- }
- } else { // Gap in the middle
- var cutTop = viewCuttingPoint(cm, from, from, -1);
- var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);
- if (cutTop && cutBot) {
- display.view = display.view.slice(0, cutTop.index)
- .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))
- .concat(display.view.slice(cutBot.index));
- display.viewTo += lendiff;
- } else {
- resetView(cm);
- }
- }
- var ext = display.externalMeasured;
- if (ext) {
- if (to < ext.lineN)
- { ext.lineN += lendiff; }
- else if (from < ext.lineN + ext.size)
- { display.externalMeasured = null; }
- }
- }
- // Register a change to a single line. Type must be one of "text",
- // "gutter", "class", "widget"
- function regLineChange(cm, line, type) {
- cm.curOp.viewChanged = true;
- var display = cm.display, ext = cm.display.externalMeasured;
- if (ext && line >= ext.lineN && line < ext.lineN + ext.size)
- { display.externalMeasured = null; }
- if (line < display.viewFrom || line >= display.viewTo) { return }
- var lineView = display.view[findViewIndex(cm, line)];
- if (lineView.node == null) { return }
- var arr = lineView.changes || (lineView.changes = []);
- if (indexOf(arr, type) == -1) { arr.push(type); }
- }
- // Clear the view.
- function resetView(cm) {
- cm.display.viewFrom = cm.display.viewTo = cm.doc.first;
- cm.display.view = [];
- cm.display.viewOffset = 0;
- }
- function viewCuttingPoint(cm, oldN, newN, dir) {
- var index = findViewIndex(cm, oldN), diff, view = cm.display.view;
- if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)
- { return {index: index, lineN: newN} }
- var n = cm.display.viewFrom;
- for (var i = 0; i < index; i++)
- { n += view[i].size; }
- if (n != oldN) {
- if (dir > 0) {
- if (index == view.length - 1) { return null }
- diff = (n + view[index].size) - oldN;
- index++;
- } else {
- diff = n - oldN;
- }
- oldN += diff; newN += diff;
- }
- while (visualLineNo(cm.doc, newN) != newN) {
- if (index == (dir < 0 ? 0 : view.length - 1)) { return null }
- newN += dir * view[index - (dir < 0 ? 1 : 0)].size;
- index += dir;
- }
- return {index: index, lineN: newN}
- }
- // Force the view to cover a given range, adding empty view element
- // or clipping off existing ones as needed.
- function adjustView(cm, from, to) {
- var display = cm.display, view = display.view;
- if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {
- display.view = buildViewArray(cm, from, to);
- display.viewFrom = from;
- } else {
- if (display.viewFrom > from)
- { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }
- else if (display.viewFrom < from)
- { display.view = display.view.slice(findViewIndex(cm, from)); }
- display.viewFrom = from;
- if (display.viewTo < to)
- { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }
- else if (display.viewTo > to)
- { display.view = display.view.slice(0, findViewIndex(cm, to)); }
- }
- display.viewTo = to;
- }
- // Count the number of lines in the view whose DOM representation is
- // out of date (or nonexistent).
- function countDirtyView(cm) {
- var view = cm.display.view, dirty = 0;
- for (var i = 0; i < view.length; i++) {
- var lineView = view[i];
- if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }
- }
- return dirty
- }
- function updateSelection(cm) {
- cm.display.input.showSelection(cm.display.input.prepareSelection());
- }
- function prepareSelection(cm, primary) {
- if ( primary === void 0 ) primary = true;
- var doc = cm.doc, result = {};
- var curFragment = result.cursors = document.createDocumentFragment();
- var selFragment = result.selection = document.createDocumentFragment();
- var customCursor = cm.options.$customCursor;
- if (customCursor) { primary = true; }
- for (var i = 0; i < doc.sel.ranges.length; i++) {
- if (!primary && i == doc.sel.primIndex) { continue }
- var range = doc.sel.ranges[i];
- if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }
- var collapsed = range.empty();
- if (customCursor) {
- var head = customCursor(cm, range);
- if (head) { drawSelectionCursor(cm, head, curFragment); }
- } else if (collapsed || cm.options.showCursorWhenSelecting) {
- drawSelectionCursor(cm, range.head, curFragment);
- }
- if (!collapsed)
- { drawSelectionRange(cm, range, selFragment); }
- }
- return result
- }
- // Draws a cursor for the given range
- function drawSelectionCursor(cm, head, output) {
- var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine);
- var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"));
- cursor.style.left = pos.left + "px";
- cursor.style.top = pos.top + "px";
- cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
- if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) {
- var charPos = charCoords(cm, head, "div", null, null);
- var width = charPos.right - charPos.left;
- cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px";
- }
- if (pos.other) {
- // Secondary cursor, shown when on a 'jump' in bi-directional text
- var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
- otherCursor.style.display = "";
- otherCursor.style.left = pos.other.left + "px";
- otherCursor.style.top = pos.other.top + "px";
- otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
- }
- }
- function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }
- // Draws the given range as a highlighted selection
- function drawSelectionRange(cm, range, output) {
- var display = cm.display, doc = cm.doc;
- var fragment = document.createDocumentFragment();
- var padding = paddingH(cm.display), leftSide = padding.left;
- var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;
- var docLTR = doc.direction == "ltr";
- function add(left, top, width, bottom) {
- if (top < 0) { top = 0; }
- top = Math.round(top);
- bottom = Math.round(bottom);
- fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")));
- }
- function drawForLine(line, fromArg, toArg) {
- var lineObj = getLine(doc, line);
- var lineLen = lineObj.text.length;
- var start, end;
- function coords(ch, bias) {
- return charCoords(cm, Pos(line, ch), "div", lineObj, bias)
- }
- function wrapX(pos, dir, side) {
- var extent = wrappedLineExtentChar(cm, lineObj, null, pos);
- var prop = (dir == "ltr") == (side == "after") ? "left" : "right";
- var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);
- return coords(ch, prop)[prop]
- }
- var order = getOrder(lineObj, doc.direction);
- iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {
- var ltr = dir == "ltr";
- var fromPos = coords(from, ltr ? "left" : "right");
- var toPos = coords(to - 1, ltr ? "right" : "left");
- var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;
- var first = i == 0, last = !order || i == order.length - 1;
- if (toPos.top - fromPos.top <= 3) { // Single line
- var openLeft = (docLTR ? openStart : openEnd) && first;
- var openRight = (docLTR ? openEnd : openStart) && last;
- var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;
- var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;
- add(left, fromPos.top, right - left, fromPos.bottom);
- } else { // Multiple lines
- var topLeft, topRight, botLeft, botRight;
- if (ltr) {
- topLeft = docLTR && openStart && first ? leftSide : fromPos.left;
- topRight = docLTR ? rightSide : wrapX(from, dir, "before");
- botLeft = docLTR ? leftSide : wrapX(to, dir, "after");
- botRight = docLTR && openEnd && last ? rightSide : toPos.right;
- } else {
- topLeft = !docLTR ? leftSide : wrapX(from, dir, "before");
- topRight = !docLTR && openStart && first ? rightSide : fromPos.right;
- botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;
- botRight = !docLTR ? rightSide : wrapX(to, dir, "after");
- }
- add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);
- if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }
- add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);
- }
- if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }
- if (cmpCoords(toPos, start) < 0) { start = toPos; }
- if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }
- if (cmpCoords(toPos, end) < 0) { end = toPos; }
- });
- return {start: start, end: end}
- }
- var sFrom = range.from(), sTo = range.to();
- if (sFrom.line == sTo.line) {
- drawForLine(sFrom.line, sFrom.ch, sTo.ch);
- } else {
- var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);
- var singleVLine = visualLine(fromLine) == visualLine(toLine);
- var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;
- var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;
- if (singleVLine) {
- if (leftEnd.top < rightStart.top - 2) {
- add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);
- add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);
- } else {
- add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);
- }
- }
- if (leftEnd.bottom < rightStart.top)
- { add(leftSide, leftEnd.bottom, null, rightStart.top); }
- }
- output.appendChild(fragment);
- }
- // Cursor-blinking
- function restartBlink(cm) {
- if (!cm.state.focused) { return }
- var display = cm.display;
- clearInterval(display.blinker);
- var on = true;
- display.cursorDiv.style.visibility = "";
- if (cm.options.cursorBlinkRate > 0)
- { display.blinker = setInterval(function () {
- if (!cm.hasFocus()) { onBlur(cm); }
- display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden";
- }, cm.options.cursorBlinkRate); }
- else if (cm.options.cursorBlinkRate < 0)
- { display.cursorDiv.style.visibility = "hidden"; }
- }
- function ensureFocus(cm) {
- if (!cm.hasFocus()) {
- cm.display.input.focus();
- if (!cm.state.focused) { onFocus(cm); }
- }
- }
- function delayBlurEvent(cm) {
- cm.state.delayingBlurEvent = true;
- setTimeout(function () { if (cm.state.delayingBlurEvent) {
- cm.state.delayingBlurEvent = false;
- if (cm.state.focused) { onBlur(cm); }
- } }, 100);
- }
- function onFocus(cm, e) {
- if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }
- if (cm.options.readOnly == "nocursor") { return }
- if (!cm.state.focused) {
- signal(cm, "focus", cm, e);
- cm.state.focused = true;
- addClass(cm.display.wrapper, "CodeMirror-focused");
- // This test prevents this from firing when a context
- // menu is closed (since the input reset would kill the
- // select-all detection hack)
- if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
- cm.display.input.reset();
- if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730
- }
- cm.display.input.receivedFocus();
- }
- restartBlink(cm);
- }
- function onBlur(cm, e) {
- if (cm.state.delayingBlurEvent) { return }
- if (cm.state.focused) {
- signal(cm, "blur", cm, e);
- cm.state.focused = false;
- rmClass(cm.display.wrapper, "CodeMirror-focused");
- }
- clearInterval(cm.display.blinker);
- setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);
- }
- // Read the actual heights of the rendered lines, and update their
- // stored heights to match.
- function updateHeightsInViewport(cm) {
- var display = cm.display;
- var prevBottom = display.lineDiv.offsetTop;
- var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);
- var oldHeight = display.lineDiv.getBoundingClientRect().top;
- var mustScroll = 0;
- for (var i = 0; i < display.view.length; i++) {
- var cur = display.view[i], wrapping = cm.options.lineWrapping;
- var height = (void 0), width = 0;
- if (cur.hidden) { continue }
- oldHeight += cur.line.height;
- if (ie && ie_version < 8) {
- var bot = cur.node.offsetTop + cur.node.offsetHeight;
- height = bot - prevBottom;
- prevBottom = bot;
- } else {
- var box = cur.node.getBoundingClientRect();
- height = box.bottom - box.top;
- // Check that lines don't extend past the right of the current
- // editor width
- if (!wrapping && cur.text.firstChild)
- { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }
- }
- var diff = cur.line.height - height;
- if (diff > .005 || diff < -.005) {
- if (oldHeight < viewTop) { mustScroll -= diff; }
- updateLineHeight(cur.line, height);
- updateWidgetHeight(cur.line);
- if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
- { updateWidgetHeight(cur.rest[j]); } }
- }
- if (width > cm.display.sizerWidth) {
- var chWidth = Math.ceil(width / charWidth(cm.display));
- if (chWidth > cm.display.maxLineLength) {
- cm.display.maxLineLength = chWidth;
- cm.display.maxLine = cur.line;
- cm.display.maxLineChanged = true;
- }
- }
- }
- if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }
- }
- // Read and store the height of line widgets associated with the
- // given line.
- function updateWidgetHeight(line) {
- if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {
- var w = line.widgets[i], parent = w.node.parentNode;
- if (parent) { w.height = parent.offsetHeight; }
- } }
- }
- // Compute the lines that are visible in a given viewport (defaults
- // the the current scroll position). viewport may contain top,
- // height, and ensure (see op.scrollToPos) properties.
- function visibleLines(display, doc, viewport) {
- var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;
- top = Math.floor(top - paddingTop(display));
- var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;
- var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);
- // Ensure is a {from: {line, ch}, to: {line, ch}} object, and
- // forces those lines into the viewport (if possible).
- if (viewport && viewport.ensure) {
- var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;
- if (ensureFrom < from) {
- from = ensureFrom;
- to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);
- } else if (Math.min(ensureTo, doc.lastLine()) >= to) {
- from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);
- to = ensureTo;
- }
- }
- return {from: from, to: Math.max(to, from + 1)}
- }
- // SCROLLING THINGS INTO VIEW
- // If an editor sits on the top or bottom of the window, partially
- // scrolled out of view, this ensures that the cursor is visible.
- function maybeScrollWindow(cm, rect) {
- if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
- var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;
- if (rect.top + box.top < 0) { doScroll = true; }
- else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }
- if (doScroll != null && !phantom) {
- var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;"));
- cm.display.lineSpace.appendChild(scrollNode);
- scrollNode.scrollIntoView(doScroll);
- cm.display.lineSpace.removeChild(scrollNode);
- }
- }
- // Scroll a given position into view (immediately), verifying that
- // it actually became visible (as line heights are accurately
- // measured, the position of something may 'drift' during drawing).
- function scrollPosIntoView(cm, pos, end, margin) {
- if (margin == null) { margin = 0; }
- var rect;
- if (!cm.options.lineWrapping && pos == end) {
- // Set pos and end to the cursor positions around the character pos sticks to
- // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
- // If pos == Pos(_, 0, "before"), pos and end are unchanged
- end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos;
- pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos;
- }
- for (var limit = 0; limit < 5; limit++) {
- var changed = false;
- var coords = cursorCoords(cm, pos);
- var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);
- rect = {left: Math.min(coords.left, endCoords.left),
- top: Math.min(coords.top, endCoords.top) - margin,
- right: Math.max(coords.left, endCoords.left),
- bottom: Math.max(coords.bottom, endCoords.bottom) + margin};
- var scrollPos = calculateScrollPos(cm, rect);
- var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;
- if (scrollPos.scrollTop != null) {
- updateScrollTop(cm, scrollPos.scrollTop);
- if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }
- }
- if (scrollPos.scrollLeft != null) {
- setScrollLeft(cm, scrollPos.scrollLeft);
- if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }
- }
- if (!changed) { break }
- }
- return rect
- }
- // Scroll a given set of coordinates into view (immediately).
- function scrollIntoView(cm, rect) {
- var scrollPos = calculateScrollPos(cm, rect);
- if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }
- if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }
- }
- // Calculate a new scroll position needed to scroll the given
- // rectangle into view. Returns an object with scrollTop and
- // scrollLeft properties. When these are undefined, the
- // vertical/horizontal position does not need to be adjusted.
- function calculateScrollPos(cm, rect) {
- var display = cm.display, snapMargin = textHeight(cm.display);
- if (rect.top < 0) { rect.top = 0; }
- var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;
- var screen = displayHeight(cm), result = {};
- if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }
- var docBottom = cm.doc.height + paddingVert(display);
- var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;
- if (rect.top < screentop) {
- result.scrollTop = atTop ? 0 : rect.top;
- } else if (rect.bottom > screentop + screen) {
- var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);
- if (newTop != screentop) { result.scrollTop = newTop; }
- }
- var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;
- var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;
- var screenw = displayWidth(cm) - display.gutters.offsetWidth;
- var tooWide = rect.right - rect.left > screenw;
- if (tooWide) { rect.right = rect.left + screenw; }
- if (rect.left < 10)
- { result.scrollLeft = 0; }
- else if (rect.left < screenleft)
- { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }
- else if (rect.right > screenw + screenleft - 3)
- { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }
- return result
- }
- // Store a relative adjustment to the scroll position in the current
- // operation (to be applied when the operation finishes).
- function addToScrollTop(cm, top) {
- if (top == null) { return }
- resolveScrollToPos(cm);
- cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;
- }
- // Make sure that at the end of the operation the current cursor is
- // shown.
- function ensureCursorVisible(cm) {
- resolveScrollToPos(cm);
- var cur = cm.getCursor();
- cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};
- }
- function scrollToCoords(cm, x, y) {
- if (x != null || y != null) { resolveScrollToPos(cm); }
- if (x != null) { cm.curOp.scrollLeft = x; }
- if (y != null) { cm.curOp.scrollTop = y; }
- }
- function scrollToRange(cm, range) {
- resolveScrollToPos(cm);
- cm.curOp.scrollToPos = range;
- }
- // When an operation has its scrollToPos property set, and another
- // scroll action is applied before the end of the operation, this
- // 'simulates' scrolling that position into view in a cheap way, so
- // that the effect of intermediate scroll commands is not ignored.
- function resolveScrollToPos(cm) {
- var range = cm.curOp.scrollToPos;
- if (range) {
- cm.curOp.scrollToPos = null;
- var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);
- scrollToCoordsRange(cm, from, to, range.margin);
- }
- }
- function scrollToCoordsRange(cm, from, to, margin) {
- var sPos = calculateScrollPos(cm, {
- left: Math.min(from.left, to.left),
- top: Math.min(from.top, to.top) - margin,
- right: Math.max(from.right, to.right),
- bottom: Math.max(from.bottom, to.bottom) + margin
- });
- scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);
- }
- // Sync the scrollable area and scrollbars, ensure the viewport
- // covers the visible area.
- function updateScrollTop(cm, val) {
- if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
- if (!gecko) { updateDisplaySimple(cm, {top: val}); }
- setScrollTop(cm, val, true);
- if (gecko) { updateDisplaySimple(cm); }
- startWorker(cm, 100);
- }
- function setScrollTop(cm, val, forceScroll) {
- val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));
- if (cm.display.scroller.scrollTop == val && !forceScroll) { return }
- cm.doc.scrollTop = val;
- cm.display.scrollbars.setScrollTop(val);
- if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }
- }
- // Sync scroller and scrollbar, ensure the gutter elements are
- // aligned.
- function setScrollLeft(cm, val, isScroller, forceScroll) {
- val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));
- if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
- cm.doc.scrollLeft = val;
- alignHorizontally(cm);
- if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }
- cm.display.scrollbars.setScrollLeft(val);
- }
- // SCROLLBARS
- // Prepare DOM reads needed to update the scrollbars. Done in one
- // shot to minimize update/measure roundtrips.
- function measureForScrollbars(cm) {
- var d = cm.display, gutterW = d.gutters.offsetWidth;
- var docH = Math.round(cm.doc.height + paddingVert(cm.display));
- return {
- clientHeight: d.scroller.clientHeight,
- viewHeight: d.wrapper.clientHeight,
- scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,
- viewWidth: d.wrapper.clientWidth,
- barLeft: cm.options.fixedGutter ? gutterW : 0,
- docHeight: docH,
- scrollHeight: docH + scrollGap(cm) + d.barHeight,
- nativeBarWidth: d.nativeBarWidth,
- gutterWidth: gutterW
- }
- }
- var NativeScrollbars = function(place, scroll, cm) {
- this.cm = cm;
- var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar");
- var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar");
- vert.tabIndex = horiz.tabIndex = -1;
- place(vert); place(horiz);
- on(vert, "scroll", function () {
- if (vert.clientHeight) { scroll(vert.scrollTop, "vertical"); }
- });
- on(horiz, "scroll", function () {
- if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal"); }
- });
- this.checkedZeroWidth = false;
- // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
- if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; }
- };
- NativeScrollbars.prototype.update = function (measure) {
- var needsH = measure.scrollWidth > measure.clientWidth + 1;
- var needsV = measure.scrollHeight > measure.clientHeight + 1;
- var sWidth = measure.nativeBarWidth;
- if (needsV) {
- this.vert.style.display = "block";
- this.vert.style.bottom = needsH ? sWidth + "px" : "0";
- var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);
- // A bug in IE8 can cause this value to be negative, so guard it.
- this.vert.firstChild.style.height =
- Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px";
- } else {
- this.vert.scrollTop = 0;
- this.vert.style.display = "";
- this.vert.firstChild.style.height = "0";
- }
- if (needsH) {
- this.horiz.style.display = "block";
- this.horiz.style.right = needsV ? sWidth + "px" : "0";
- this.horiz.style.left = measure.barLeft + "px";
- var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);
- this.horiz.firstChild.style.width =
- Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px";
- } else {
- this.horiz.style.display = "";
- this.horiz.firstChild.style.width = "0";
- }
- if (!this.checkedZeroWidth && measure.clientHeight > 0) {
- if (sWidth == 0) { this.zeroWidthHack(); }
- this.checkedZeroWidth = true;
- }
- return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}
- };
- NativeScrollbars.prototype.setScrollLeft = function (pos) {
- if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }
- if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); }
- };
- NativeScrollbars.prototype.setScrollTop = function (pos) {
- if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }
- if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); }
- };
- NativeScrollbars.prototype.zeroWidthHack = function () {
- var w = mac && !mac_geMountainLion ? "12px" : "18px";
- this.horiz.style.height = this.vert.style.width = w;
- this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none";
- this.disableHoriz = new Delayed;
- this.disableVert = new Delayed;
- };
- NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {
- bar.style.pointerEvents = "auto";
- function maybeDisable() {
- // To find out whether the scrollbar is still visible, we
- // check whether the element under the pixel in the bottom
- // right corner of the scrollbar box is the scrollbar box
- // itself (when the bar is still visible) or its filler child
- // (when the bar is hidden). If it is still visible, we keep
- // it enabled, if it's hidden, we disable pointer events.
- var box = bar.getBoundingClientRect();
- var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)
- : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);
- if (elt != bar) { bar.style.pointerEvents = "none"; }
- else { delay.set(1000, maybeDisable); }
- }
- delay.set(1000, maybeDisable);
- };
- NativeScrollbars.prototype.clear = function () {
- var parent = this.horiz.parentNode;
- parent.removeChild(this.horiz);
- parent.removeChild(this.vert);
- };
- var NullScrollbars = function () {};
- NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };
- NullScrollbars.prototype.setScrollLeft = function () {};
- NullScrollbars.prototype.setScrollTop = function () {};
- NullScrollbars.prototype.clear = function () {};
- function updateScrollbars(cm, measure) {
- if (!measure) { measure = measureForScrollbars(cm); }
- var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;
- updateScrollbarsInner(cm, measure);
- for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {
- if (startWidth != cm.display.barWidth && cm.options.lineWrapping)
- { updateHeightsInViewport(cm); }
- updateScrollbarsInner(cm, measureForScrollbars(cm));
- startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;
- }
- }
- // Re-synchronize the fake scrollbars with the actual size of the
- // content.
- function updateScrollbarsInner(cm, measure) {
- var d = cm.display;
- var sizes = d.scrollbars.update(measure);
- d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px";
- d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px";
- d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent";
- if (sizes.right && sizes.bottom) {
- d.scrollbarFiller.style.display = "block";
- d.scrollbarFiller.style.height = sizes.bottom + "px";
- d.scrollbarFiller.style.width = sizes.right + "px";
- } else { d.scrollbarFiller.style.display = ""; }
- if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
- d.gutterFiller.style.display = "block";
- d.gutterFiller.style.height = sizes.bottom + "px";
- d.gutterFiller.style.width = measure.gutterWidth + "px";
- } else { d.gutterFiller.style.display = ""; }
- }
- var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars};
- function initScrollbars(cm) {
- if (cm.display.scrollbars) {
- cm.display.scrollbars.clear();
- if (cm.display.scrollbars.addClass)
- { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }
- }
- cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {
- cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);
- // Prevent clicks in the scrollbars from killing focus
- on(node, "mousedown", function () {
- if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }
- });
- node.setAttribute("cm-not-content", "true");
- }, function (pos, axis) {
- if (axis == "horizontal") { setScrollLeft(cm, pos); }
- else { updateScrollTop(cm, pos); }
- }, cm);
- if (cm.display.scrollbars.addClass)
- { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }
- }
- // Operations are used to wrap a series of changes to the editor
- // state in such a way that each change won't have to update the
- // cursor and display (which would be awkward, slow, and
- // error-prone). Instead, display updates are batched and then all
- // combined and executed at once.
- var nextOpId = 0;
- // Start a new operation.
- function startOperation(cm) {
- cm.curOp = {
- cm: cm,
- viewChanged: false, // Flag that indicates that lines might need to be redrawn
- startHeight: cm.doc.height, // Used to detect need to update scrollbar
- forceUpdate: false, // Used to force a redraw
- updateInput: 0, // Whether to reset the input textarea
- typing: false, // Whether this reset should be careful to leave existing text (for compositing)
- changeObjs: null, // Accumulated changes, for firing change events
- cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on
- cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already
- selectionChanged: false, // Whether the selection needs to be redrawn
- updateMaxLine: false, // Set when the widest line needs to be determined anew
- scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
- scrollToPos: null, // Used to scroll to a specific position
- focus: false,
- id: ++nextOpId, // Unique ID
- markArrays: null // Used by addMarkedSpan
- };
- pushOperation(cm.curOp);
- }
- // Finish an operation, updating the display and signalling delayed events
- function endOperation(cm) {
- var op = cm.curOp;
- if (op) { finishOperation(op, function (group) {
- for (var i = 0; i < group.ops.length; i++)
- { group.ops[i].cm.curOp = null; }
- endOperations(group);
- }); }
- }
- // The DOM updates done when an operation finishes are batched so
- // that the minimum number of relayouts are required.
- function endOperations(group) {
- var ops = group.ops;
- for (var i = 0; i < ops.length; i++) // Read DOM
- { endOperation_R1(ops[i]); }
- for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)
- { endOperation_W1(ops[i$1]); }
- for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM
- { endOperation_R2(ops[i$2]); }
- for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)
- { endOperation_W2(ops[i$3]); }
- for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM
- { endOperation_finish(ops[i$4]); }
- }
- function endOperation_R1(op) {
- var cm = op.cm, display = cm.display;
- maybeClipScrollbars(cm);
- if (op.updateMaxLine) { findMaxLine(cm); }
- op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||
- op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||
- op.scrollToPos.to.line >= display.viewTo) ||
- display.maxLineChanged && cm.options.lineWrapping;
- op.update = op.mustUpdate &&
- new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);
- }
- function endOperation_W1(op) {
- op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);
- }
- function endOperation_R2(op) {
- var cm = op.cm, display = cm.display;
- if (op.updatedDisplay) { updateHeightsInViewport(cm); }
- op.barMeasure = measureForScrollbars(cm);
- // If the max line changed since it was last measured, measure it,
- // and ensure the document's width matches it.
- // updateDisplay_W2 will use these properties to do the actual resizing
- if (display.maxLineChanged && !cm.options.lineWrapping) {
- op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;
- cm.display.sizerWidth = op.adjustWidthTo;
- op.barMeasure.scrollWidth =
- Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);
- op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));
- }
- if (op.updatedDisplay || op.selectionChanged)
- { op.preparedSelection = display.input.prepareSelection(); }
- }
- function endOperation_W2(op) {
- var cm = op.cm;
- if (op.adjustWidthTo != null) {
- cm.display.sizer.style.minWidth = op.adjustWidthTo + "px";
- if (op.maxScrollLeft < cm.doc.scrollLeft)
- { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }
- cm.display.maxLineChanged = false;
- }
- var takeFocus = op.focus && op.focus == activeElt();
- if (op.preparedSelection)
- { cm.display.input.showSelection(op.preparedSelection, takeFocus); }
- if (op.updatedDisplay || op.startHeight != cm.doc.height)
- { updateScrollbars(cm, op.barMeasure); }
- if (op.updatedDisplay)
- { setDocumentHeight(cm, op.barMeasure); }
- if (op.selectionChanged) { restartBlink(cm); }
- if (cm.state.focused && op.updateInput)
- { cm.display.input.reset(op.typing); }
- if (takeFocus) { ensureFocus(op.cm); }
- }
- function endOperation_finish(op) {
- var cm = op.cm, display = cm.display, doc = cm.doc;
- if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }
- // Abort mouse wheel delta measurement, when scrolling explicitly
- if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))
- { display.wheelStartX = display.wheelStartY = null; }
- // Propagate the scroll position to the actual DOM scroller
- if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }
- if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }
- // If we need to scroll a specific position into view, do so.
- if (op.scrollToPos) {
- var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
- clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);
- maybeScrollWindow(cm, rect);
- }
- // Fire events for markers that are hidden/unidden by editing or
- // undoing
- var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;
- if (hidden) { for (var i = 0; i < hidden.length; ++i)
- { if (!hidden[i].lines.length) { signal(hidden[i], "hide"); } } }
- if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)
- { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide"); } } }
- if (display.wrapper.offsetHeight)
- { doc.scrollTop = cm.display.scroller.scrollTop; }
- // Fire change events, and delayed event handlers
- if (op.changeObjs)
- { signal(cm, "changes", cm, op.changeObjs); }
- if (op.update)
- { op.update.finish(); }
- }
- // Run the given function in an operation
- function runInOp(cm, f) {
- if (cm.curOp) { return f() }
- startOperation(cm);
- try { return f() }
- finally { endOperation(cm); }
- }
- // Wraps a function in an operation. Returns the wrapped function.
- function operation(cm, f) {
- return function() {
- if (cm.curOp) { return f.apply(cm, arguments) }
- startOperation(cm);
- try { return f.apply(cm, arguments) }
- finally { endOperation(cm); }
- }
- }
- // Used to add methods to editor and doc instances, wrapping them in
- // operations.
- function methodOp(f) {
- return function() {
- if (this.curOp) { return f.apply(this, arguments) }
- startOperation(this);
- try { return f.apply(this, arguments) }
- finally { endOperation(this); }
- }
- }
- function docMethodOp(f) {
- return function() {
- var cm = this.cm;
- if (!cm || cm.curOp) { return f.apply(this, arguments) }
- startOperation(cm);
- try { return f.apply(this, arguments) }
- finally { endOperation(cm); }
- }
- }
- // HIGHLIGHT WORKER
- function startWorker(cm, time) {
- if (cm.doc.highlightFrontier < cm.display.viewTo)
- { cm.state.highlight.set(time, bind(highlightWorker, cm)); }
- }
- function highlightWorker(cm) {
- var doc = cm.doc;
- if (doc.highlightFrontier >= cm.display.viewTo) { return }
- var end = +new Date + cm.options.workTime;
- var context = getContextBefore(cm, doc.highlightFrontier);
- var changedLines = [];
- doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {
- if (context.line >= cm.display.viewFrom) { // Visible
- var oldStyles = line.styles;
- var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;
- var highlighted = highlightLine(cm, line, context, true);
- if (resetState) { context.state = resetState; }
- line.styles = highlighted.styles;
- var oldCls = line.styleClasses, newCls = highlighted.classes;
- if (newCls) { line.styleClasses = newCls; }
- else if (oldCls) { line.styleClasses = null; }
- var ischange = !oldStyles || oldStyles.length != line.styles.length ||
- oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);
- for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }
- if (ischange) { changedLines.push(context.line); }
- line.stateAfter = context.save();
- context.nextLine();
- } else {
- if (line.text.length <= cm.options.maxHighlightLength)
- { processLine(cm, line.text, context); }
- line.stateAfter = context.line % 5 == 0 ? context.save() : null;
- context.nextLine();
- }
- if (+new Date > end) {
- startWorker(cm, cm.options.workDelay);
- return true
- }
- });
- doc.highlightFrontier = context.line;
- doc.modeFrontier = Math.max(doc.modeFrontier, context.line);
- if (changedLines.length) { runInOp(cm, function () {
- for (var i = 0; i < changedLines.length; i++)
- { regLineChange(cm, changedLines[i], "text"); }
- }); }
- }
- // DISPLAY DRAWING
- var DisplayUpdate = function(cm, viewport, force) {
- var display = cm.display;
- this.viewport = viewport;
- // Store some values that we'll need later (but don't want to force a relayout for)
- this.visible = visibleLines(display, cm.doc, viewport);
- this.editorIsHidden = !display.wrapper.offsetWidth;
- this.wrapperHeight = display.wrapper.clientHeight;
- this.wrapperWidth = display.wrapper.clientWidth;
- this.oldDisplayWidth = displayWidth(cm);
- this.force = force;
- this.dims = getDimensions(cm);
- this.events = [];
- };
- DisplayUpdate.prototype.signal = function (emitter, type) {
- if (hasHandler(emitter, type))
- { this.events.push(arguments); }
- };
- DisplayUpdate.prototype.finish = function () {
- for (var i = 0; i < this.events.length; i++)
- { signal.apply(null, this.events[i]); }
- };
- function maybeClipScrollbars(cm) {
- var display = cm.display;
- if (!display.scrollbarsClipped && display.scroller.offsetWidth) {
- display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;
- display.heightForcer.style.height = scrollGap(cm) + "px";
- display.sizer.style.marginBottom = -display.nativeBarWidth + "px";
- display.sizer.style.borderRightWidth = scrollGap(cm) + "px";
- display.scrollbarsClipped = true;
- }
- }
- function selectionSnapshot(cm) {
- if (cm.hasFocus()) { return null }
- var active = activeElt();
- if (!active || !contains(cm.display.lineDiv, active)) { return null }
- var result = {activeElt: active};
- if (window.getSelection) {
- var sel = window.getSelection();
- if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {
- result.anchorNode = sel.anchorNode;
- result.anchorOffset = sel.anchorOffset;
- result.focusNode = sel.focusNode;
- result.focusOffset = sel.focusOffset;
- }
- }
- return result
- }
- function restoreSelection(snapshot) {
- if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }
- snapshot.activeElt.focus();
- if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&
- snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
- var sel = window.getSelection(), range = document.createRange();
- range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);
- range.collapse(false);
- sel.removeAllRanges();
- sel.addRange(range);
- sel.extend(snapshot.focusNode, snapshot.focusOffset);
- }
- }
- // Does the actual updating of the line display. Bails out
- // (returning false) when there is nothing to be done and forced is
- // false.
- function updateDisplayIfNeeded(cm, update) {
- var display = cm.display, doc = cm.doc;
- if (update.editorIsHidden) {
- resetView(cm);
- return false
- }
- // Bail out if the visible area is already rendered and nothing changed.
- if (!update.force &&
- update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&
- (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&
- display.renderedView == display.view && countDirtyView(cm) == 0)
- { return false }
- if (maybeUpdateLineNumberWidth(cm)) {
- resetView(cm);
- update.dims = getDimensions(cm);
- }
- // Compute a suitable new viewport (from & to)
- var end = doc.first + doc.size;
- var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);
- var to = Math.min(end, update.visible.to + cm.options.viewportMargin);
- if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }
- if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }
- if (sawCollapsedSpans) {
- from = visualLineNo(cm.doc, from);
- to = visualLineEndNo(cm.doc, to);
- }
- var different = from != display.viewFrom || to != display.viewTo ||
- display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;
- adjustView(cm, from, to);
- display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));
- // Position the mover div to align with the current scroll position
- cm.display.mover.style.top = display.viewOffset + "px";
- var toUpdate = countDirtyView(cm);
- if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&
- (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))
- { return false }
- // For big changes, we hide the enclosing element during the
- // update, since that speeds up the operations on most browsers.
- var selSnapshot = selectionSnapshot(cm);
- if (toUpdate > 4) { display.lineDiv.style.display = "none"; }
- patchDisplay(cm, display.updateLineNumbers, update.dims);
- if (toUpdate > 4) { display.lineDiv.style.display = ""; }
- display.renderedView = display.view;
- // There might have been a widget with a focused element that got
- // hidden or updated, if so re-focus it.
- restoreSelection(selSnapshot);
- // Prevent selection and cursors from interfering with the scroll
- // width and height.
- removeChildren(display.cursorDiv);
- removeChildren(display.selectionDiv);
- display.gutters.style.height = display.sizer.style.minHeight = 0;
- if (different) {
- display.lastWrapHeight = update.wrapperHeight;
- display.lastWrapWidth = update.wrapperWidth;
- startWorker(cm, 400);
- }
- display.updateLineNumbers = null;
- return true
- }
- function postUpdateDisplay(cm, update) {
- var viewport = update.viewport;
- for (var first = true;; first = false) {
- if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
- // Clip forced viewport to actual scrollable area.
- if (viewport && viewport.top != null)
- { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }
- // Updated line heights might result in the drawn area not
- // actually covering the viewport. Keep looping until it does.
- update.visible = visibleLines(cm.display, cm.doc, viewport);
- if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
- { break }
- } else if (first) {
- update.visible = visibleLines(cm.display, cm.doc, viewport);
- }
- if (!updateDisplayIfNeeded(cm, update)) { break }
- updateHeightsInViewport(cm);
- var barMeasure = measureForScrollbars(cm);
- updateSelection(cm);
- updateScrollbars(cm, barMeasure);
- setDocumentHeight(cm, barMeasure);
- update.force = false;
- }
- update.signal(cm, "update", cm);
- if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {
- update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo);
- cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;
- }
- }
- function updateDisplaySimple(cm, viewport) {
- var update = new DisplayUpdate(cm, viewport);
- if (updateDisplayIfNeeded(cm, update)) {
- updateHeightsInViewport(cm);
- postUpdateDisplay(cm, update);
- var barMeasure = measureForScrollbars(cm);
- updateSelection(cm);
- updateScrollbars(cm, barMeasure);
- setDocumentHeight(cm, barMeasure);
- update.finish();
- }
- }
- // Sync the actual display DOM structure with display.view, removing
- // nodes for lines that are no longer in view, and creating the ones
- // that are not there yet, and updating the ones that are out of
- // date.
- function patchDisplay(cm, updateNumbersFrom, dims) {
- var display = cm.display, lineNumbers = cm.options.lineNumbers;
- var container = display.lineDiv, cur = container.firstChild;
- function rm(node) {
- var next = node.nextSibling;
- // Works around a throw-scroll bug in OS X Webkit
- if (webkit && mac && cm.display.currentWheelTarget == node)
- { node.style.display = "none"; }
- else
- { node.parentNode.removeChild(node); }
- return next
- }
- var view = display.view, lineN = display.viewFrom;
- // Loop over the elements in the view, syncing cur (the DOM nodes
- // in display.lineDiv) with the view as we go.
- for (var i = 0; i < view.length; i++) {
- var lineView = view[i];
- if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet
- var node = buildLineElement(cm, lineView, lineN, dims);
- container.insertBefore(node, cur);
- } else { // Already drawn
- while (cur != lineView.node) { cur = rm(cur); }
- var updateNumber = lineNumbers && updateNumbersFrom != null &&
- updateNumbersFrom <= lineN && lineView.lineNumber;
- if (lineView.changes) {
- if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false; }
- updateLineForChanges(cm, lineView, lineN, dims);
- }
- if (updateNumber) {
- removeChildren(lineView.lineNumber);
- lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));
- }
- cur = lineView.node.nextSibling;
- }
- lineN += lineView.size;
- }
- while (cur) { cur = rm(cur); }
- }
- function updateGutterSpace(display) {
- var width = display.gutters.offsetWidth;
- display.sizer.style.marginLeft = width + "px";
- // Send an event to consumers responding to changes in gutter width.
- signalLater(display, "gutterChanged", display);
- }
- function setDocumentHeight(cm, measure) {
- cm.display.sizer.style.minHeight = measure.docHeight + "px";
- cm.display.heightForcer.style.top = measure.docHeight + "px";
- cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px";
- }
- // Re-align line numbers and gutter marks to compensate for
- // horizontal scrolling.
- function alignHorizontally(cm) {
- var display = cm.display, view = display.view;
- if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }
- var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
- var gutterW = display.gutters.offsetWidth, left = comp + "px";
- for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {
- if (cm.options.fixedGutter) {
- if (view[i].gutter)
- { view[i].gutter.style.left = left; }
- if (view[i].gutterBackground)
- { view[i].gutterBackground.style.left = left; }
- }
- var align = view[i].alignable;
- if (align) { for (var j = 0; j < align.length; j++)
- { align[j].style.left = left; } }
- } }
- if (cm.options.fixedGutter)
- { display.gutters.style.left = (comp + gutterW) + "px"; }
- }
- // Used to ensure that the line number gutter is still the right
- // size for the current document size. Returns true when an update
- // is needed.
- function maybeUpdateLineNumberWidth(cm) {
- if (!cm.options.lineNumbers) { return false }
- var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
- if (last.length != display.lineNumChars) {
- var test = display.measure.appendChild(elt("div", [elt("div", last)],
- "CodeMirror-linenumber CodeMirror-gutter-elt"));
- var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;
- display.lineGutter.style.width = "";
- display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;
- display.lineNumWidth = display.lineNumInnerWidth + padding;
- display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;
- display.lineGutter.style.width = display.lineNumWidth + "px";
- updateGutterSpace(cm.display);
- return true
- }
- return false
- }
- function getGutters(gutters, lineNumbers) {
- var result = [], sawLineNumbers = false;
- for (var i = 0; i < gutters.length; i++) {
- var name = gutters[i], style = null;
- if (typeof name != "string") { style = name.style; name = name.className; }
- if (name == "CodeMirror-linenumbers") {
- if (!lineNumbers) { continue }
- else { sawLineNumbers = true; }
- }
- result.push({className: name, style: style});
- }
- if (lineNumbers && !sawLineNumbers) { result.push({className: "CodeMirror-linenumbers", style: null}); }
- return result
- }
- // Rebuild the gutter elements, ensure the margin to the left of the
- // code matches their width.
- function renderGutters(display) {
- var gutters = display.gutters, specs = display.gutterSpecs;
- removeChildren(gutters);
- display.lineGutter = null;
- for (var i = 0; i < specs.length; ++i) {
- var ref = specs[i];
- var className = ref.className;
- var style = ref.style;
- var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + className));
- if (style) { gElt.style.cssText = style; }
- if (className == "CodeMirror-linenumbers") {
- display.lineGutter = gElt;
- gElt.style.width = (display.lineNumWidth || 1) + "px";
- }
- }
- gutters.style.display = specs.length ? "" : "none";
- updateGutterSpace(display);
- }
- function updateGutters(cm) {
- renderGutters(cm.display);
- regChange(cm);
- alignHorizontally(cm);
- }
- // The display handles the DOM integration, both for input reading
- // and content drawing. It holds references to DOM nodes and
- // display-related state.
- function Display(place, doc, input, options) {
- var d = this;
- this.input = input;
- // Covers bottom-right square when both scrollbars are present.
- d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler");
- d.scrollbarFiller.setAttribute("cm-not-content", "true");
- // Covers bottom of gutter when coverGutterNextToScrollbar is on
- // and h scrollbar is present.
- d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler");
- d.gutterFiller.setAttribute("cm-not-content", "true");
- // Will contain the actual code, positioned to cover the viewport.
- d.lineDiv = eltP("div", null, "CodeMirror-code");
- // Elements are added to these to represent selection and cursors.
- d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1");
- d.cursorDiv = elt("div", null, "CodeMirror-cursors");
- // A visibility: hidden element used to find the size of things.
- d.measure = elt("div", null, "CodeMirror-measure");
- // When lines outside of the viewport are measured, they are drawn in this.
- d.lineMeasure = elt("div", null, "CodeMirror-measure");
- // Wraps everything that needs to exist inside the vertically-padded coordinate system
- d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
- null, "position: relative; outline: none");
- var lines = eltP("div", [d.lineSpace], "CodeMirror-lines");
- // Moved around its parent to cover visible view.
- d.mover = elt("div", [lines], null, "position: relative");
- // Set to the height of the document, allowing scrolling.
- d.sizer = elt("div", [d.mover], "CodeMirror-sizer");
- d.sizerWidth = null;
- // Behavior of elts with overflow: auto and padding is
- // inconsistent across browsers. This is used to ensure the
- // scrollable area is big enough.
- d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;");
- // Will contain the gutters, if any.
- d.gutters = elt("div", null, "CodeMirror-gutters");
- d.lineGutter = null;
- // Actual scrollable element.
- d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll");
- d.scroller.setAttribute("tabIndex", "-1");
- // The element in which the editor lives.
- d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
- // This attribute is respected by automatic translation systems such as Google Translate,
- // and may also be respected by tools used by human translators.
- d.wrapper.setAttribute('translate', 'no');
- // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
- if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
- if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }
- if (place) {
- if (place.appendChild) { place.appendChild(d.wrapper); }
- else { place(d.wrapper); }
- }
- // Current rendered range (may be bigger than the view window).
- d.viewFrom = d.viewTo = doc.first;
- d.reportedViewFrom = d.reportedViewTo = doc.first;
- // Information about the rendered lines.
- d.view = [];
- d.renderedView = null;
- // Holds info about a single rendered line when it was rendered
- // for measurement, while not in view.
- d.externalMeasured = null;
- // Empty space (in pixels) above the view
- d.viewOffset = 0;
- d.lastWrapHeight = d.lastWrapWidth = 0;
- d.updateLineNumbers = null;
- d.nativeBarWidth = d.barHeight = d.barWidth = 0;
- d.scrollbarsClipped = false;
- // Used to only resize the line number gutter when necessary (when
- // the amount of lines crosses a boundary that makes its width change)
- d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;
- // Set to true when a non-horizontal-scrolling line widget is
- // added. As an optimization, line widget aligning is skipped when
- // this is false.
- d.alignWidgets = false;
- d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;
- // Tracks the maximum line length so that the horizontal scrollbar
- // can be kept static when scrolling.
- d.maxLine = null;
- d.maxLineLength = 0;
- d.maxLineChanged = false;
- // Used for measuring wheel scrolling granularity
- d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;
- // True when shift is held down.
- d.shift = false;
- // Used to track whether anything happened since the context menu
- // was opened.
- d.selForContextMenu = null;
- d.activeTouch = null;
- d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);
- renderGutters(d);
- input.init(d);
- }
- // Since the delta values reported on mouse wheel events are
- // unstandardized between browsers and even browser versions, and
- // generally horribly unpredictable, this code starts by measuring
- // the scroll effect that the first few mouse wheel events have,
- // and, from that, detects the way it can convert deltas to pixel
- // offsets afterwards.
- //
- // The reason we want to know the amount a wheel event will scroll
- // is that it gives us a chance to update the display before the
- // actual scrolling happens, reducing flickering.
- var wheelSamples = 0, wheelPixelsPerUnit = null;
- // Fill in a browser-detected starting value on browsers where we
- // know one. These don't have to be accurate -- the result of them
- // being wrong would just be a slight flicker on the first wheel
- // scroll (if it is large enough).
- if (ie) { wheelPixelsPerUnit = -.53; }
- else if (gecko) { wheelPixelsPerUnit = 15; }
- else if (chrome) { wheelPixelsPerUnit = -.7; }
- else if (safari) { wheelPixelsPerUnit = -1/3; }
- function wheelEventDelta(e) {
- var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
- if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }
- if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }
- else if (dy == null) { dy = e.wheelDelta; }
- return {x: dx, y: dy}
- }
- function wheelEventPixels(e) {
- var delta = wheelEventDelta(e);
- delta.x *= wheelPixelsPerUnit;
- delta.y *= wheelPixelsPerUnit;
- return delta
- }
- function onScrollWheel(cm, e) {
- var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
- var pixelsPerUnit = wheelPixelsPerUnit;
- if (e.deltaMode === 0) {
- dx = e.deltaX;
- dy = e.deltaY;
- pixelsPerUnit = 1;
- }
- var display = cm.display, scroll = display.scroller;
- // Quit if there's nothing to scroll here
- var canScrollX = scroll.scrollWidth > scroll.clientWidth;
- var canScrollY = scroll.scrollHeight > scroll.clientHeight;
- if (!(dx && canScrollX || dy && canScrollY)) { return }
- // Webkit browsers on OS X abort momentum scrolls when the target
- // of the scroll event is removed from the scrollable element.
- // This hack (see related code in patchDisplay) makes sure the
- // element is kept around.
- if (dy && mac && webkit) {
- outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
- for (var i = 0; i < view.length; i++) {
- if (view[i].node == cur) {
- cm.display.currentWheelTarget = cur;
- break outer
- }
- }
- }
- }
- // On some browsers, horizontal scrolling will cause redraws to
- // happen before the gutter has been realigned, causing it to
- // wriggle around in a most unseemly way. When we have an
- // estimated pixels/delta value, we just handle horizontal
- // scrolling entirely here. It'll be slightly off from native, but
- // better than glitching out.
- if (dx && !gecko && !presto && pixelsPerUnit != null) {
- if (dy && canScrollY)
- { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }
- setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));
- // Only prevent default scrolling if vertical scrolling is
- // actually possible. Otherwise, it causes vertical scroll
- // jitter on OSX trackpads when deltaX is small and deltaY
- // is large (issue #3579)
- if (!dy || (dy && canScrollY))
- { e_preventDefault(e); }
- display.wheelStartX = null; // Abort measurement, if in progress
- return
- }
- // 'Project' the visible viewport to cover the area that is being
- // scrolled into view (if we know enough to estimate it).
- if (dy && pixelsPerUnit != null) {
- var pixels = dy * pixelsPerUnit;
- var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
- if (pixels < 0) { top = Math.max(0, top + pixels - 50); }
- else { bot = Math.min(cm.doc.height, bot + pixels + 50); }
- updateDisplaySimple(cm, {top: top, bottom: bot});
- }
- if (wheelSamples < 20 && e.deltaMode !== 0) {
- if (display.wheelStartX == null) {
- display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
- display.wheelDX = dx; display.wheelDY = dy;
- setTimeout(function () {
- if (display.wheelStartX == null) { return }
- var movedX = scroll.scrollLeft - display.wheelStartX;
- var movedY = scroll.scrollTop - display.wheelStartY;
- var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
- (movedX && display.wheelDX && movedX / display.wheelDX);
- display.wheelStartX = display.wheelStartY = null;
- if (!sample) { return }
- wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);
- ++wheelSamples;
- }, 200);
- } else {
- display.wheelDX += dx; display.wheelDY += dy;
- }
- }
- }
- // Selection objects are immutable. A new one is created every time
- // the selection changes. A selection is one or more non-overlapping
- // (and non-touching) ranges, sorted, and an integer that indicates
- // which one is the primary selection (the one that's scrolled into
- // view, that getCursor returns, etc).
- var Selection = function(ranges, primIndex) {
- this.ranges = ranges;
- this.primIndex = primIndex;
- };
- Selection.prototype.primary = function () { return this.ranges[this.primIndex] };
- Selection.prototype.equals = function (other) {
- if (other == this) { return true }
- if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }
- for (var i = 0; i < this.ranges.length; i++) {
- var here = this.ranges[i], there = other.ranges[i];
- if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }
- }
- return true
- };
- Selection.prototype.deepCopy = function () {
- var out = [];
- for (var i = 0; i < this.ranges.length; i++)
- { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }
- return new Selection(out, this.primIndex)
- };
- Selection.prototype.somethingSelected = function () {
- for (var i = 0; i < this.ranges.length; i++)
- { if (!this.ranges[i].empty()) { return true } }
- return false
- };
- Selection.prototype.contains = function (pos, end) {
- if (!end) { end = pos; }
- for (var i = 0; i < this.ranges.length; i++) {
- var range = this.ranges[i];
- if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)
- { return i }
- }
- return -1
- };
- var Range = function(anchor, head) {
- this.anchor = anchor; this.head = head;
- };
- Range.prototype.from = function () { return minPos(this.anchor, this.head) };
- Range.prototype.to = function () { return maxPos(this.anchor, this.head) };
- Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };
- // Take an unsorted, potentially overlapping set of ranges, and
- // build a selection out of it. 'Consumes' ranges array (modifying
- // it).
- function normalizeSelection(cm, ranges, primIndex) {
- var mayTouch = cm && cm.options.selectionsMayTouch;
- var prim = ranges[primIndex];
- ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });
- primIndex = indexOf(ranges, prim);
- for (var i = 1; i < ranges.length; i++) {
- var cur = ranges[i], prev = ranges[i - 1];
- var diff = cmp(prev.to(), cur.from());
- if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {
- var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());
- var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;
- if (i <= primIndex) { --primIndex; }
- ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));
- }
- }
- return new Selection(ranges, primIndex)
- }
- function simpleSelection(anchor, head) {
- return new Selection([new Range(anchor, head || anchor)], 0)
- }
- // Compute the position of the end of a change (its 'to' property
- // refers to the pre-change end).
- function changeEnd(change) {
- if (!change.text) { return change.to }
- return Pos(change.from.line + change.text.length - 1,
- lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))
- }
- // Adjust a position to refer to the post-change position of the
- // same text, or the end of the change if the change covers it.
- function adjustForChange(pos, change) {
- if (cmp(pos, change.from) < 0) { return pos }
- if (cmp(pos, change.to) <= 0) { return changeEnd(change) }
- var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;
- if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }
- return Pos(line, ch)
- }
- function computeSelAfterChange(doc, change) {
- var out = [];
- for (var i = 0; i < doc.sel.ranges.length; i++) {
- var range = doc.sel.ranges[i];
- out.push(new Range(adjustForChange(range.anchor, change),
- adjustForChange(range.head, change)));
- }
- return normalizeSelection(doc.cm, out, doc.sel.primIndex)
- }
- function offsetPos(pos, old, nw) {
- if (pos.line == old.line)
- { return Pos(nw.line, pos.ch - old.ch + nw.ch) }
- else
- { return Pos(nw.line + (pos.line - old.line), pos.ch) }
- }
- // Used by replaceSelections to allow moving the selection to the
- // start or around the replaced test. Hint may be "start" or "around".
- function computeReplacedSel(doc, changes, hint) {
- var out = [];
- var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;
- for (var i = 0; i < changes.length; i++) {
- var change = changes[i];
- var from = offsetPos(change.from, oldPrev, newPrev);
- var to = offsetPos(changeEnd(change), oldPrev, newPrev);
- oldPrev = change.to;
- newPrev = to;
- if (hint == "around") {
- var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;
- out[i] = new Range(inv ? to : from, inv ? from : to);
- } else {
- out[i] = new Range(from, from);
- }
- }
- return new Selection(out, doc.sel.primIndex)
- }
- // Used to get the editor into a consistent state again when options change.
- function loadMode(cm) {
- cm.doc.mode = getMode(cm.options, cm.doc.modeOption);
- resetModeState(cm);
- }
- function resetModeState(cm) {
- cm.doc.iter(function (line) {
- if (line.stateAfter) { line.stateAfter = null; }
- if (line.styles) { line.styles = null; }
- });
- cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;
- startWorker(cm, 100);
- cm.state.modeGen++;
- if (cm.curOp) { regChange(cm); }
- }
- // DOCUMENT DATA STRUCTURE
- // By default, updates that start and end at the beginning of a line
- // are treated specially, in order to make the association of line
- // widgets and marker elements with the text behave more intuitive.
- function isWholeLineUpdate(doc, change) {
- return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" &&
- (!doc.cm || doc.cm.options.wholeLineUpdateBefore)
- }
- // Perform a change on the document data structure.
- function updateDoc(doc, change, markedSpans, estimateHeight) {
- function spansFor(n) {return markedSpans ? markedSpans[n] : null}
- function update(line, text, spans) {
- updateLine(line, text, spans, estimateHeight);
- signalLater(line, "change", line, change);
- }
- function linesFor(start, end) {
- var result = [];
- for (var i = start; i < end; ++i)
- { result.push(new Line(text[i], spansFor(i), estimateHeight)); }
- return result
- }
- var from = change.from, to = change.to, text = change.text;
- var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);
- var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;
- // Adjust the line structure
- if (change.full) {
- doc.insert(0, linesFor(0, text.length));
- doc.remove(text.length, doc.size - text.length);
- } else if (isWholeLineUpdate(doc, change)) {
- // This is a whole-line replace. Treated specially to make
- // sure line objects move the way they are supposed to.
- var added = linesFor(0, text.length - 1);
- update(lastLine, lastLine.text, lastSpans);
- if (nlines) { doc.remove(from.line, nlines); }
- if (added.length) { doc.insert(from.line, added); }
- } else if (firstLine == lastLine) {
- if (text.length == 1) {
- update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);
- } else {
- var added$1 = linesFor(1, text.length - 1);
- added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));
- update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
- doc.insert(from.line + 1, added$1);
- }
- } else if (text.length == 1) {
- update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));
- doc.remove(from.line + 1, nlines);
- } else {
- update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
- update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);
- var added$2 = linesFor(1, text.length - 1);
- if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }
- doc.insert(from.line + 1, added$2);
- }
- signalLater(doc, "change", doc, change);
- }
- // Call f for all linked documents.
- function linkedDocs(doc, f, sharedHistOnly) {
- function propagate(doc, skip, sharedHist) {
- if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {
- var rel = doc.linked[i];
- if (rel.doc == skip) { continue }
- var shared = sharedHist && rel.sharedHist;
- if (sharedHistOnly && !shared) { continue }
- f(rel.doc, shared);
- propagate(rel.doc, doc, shared);
- } }
- }
- propagate(doc, null, true);
- }
- // Attach a document to an editor.
- function attachDoc(cm, doc) {
- if (doc.cm) { throw new Error("This document is already in use.") }
- cm.doc = doc;
- doc.cm = cm;
- estimateLineHeights(cm);
- loadMode(cm);
- setDirectionClass(cm);
- cm.options.direction = doc.direction;
- if (!cm.options.lineWrapping) { findMaxLine(cm); }
- cm.options.mode = doc.modeOption;
- regChange(cm);
- }
- function setDirectionClass(cm) {
- (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl");
- }
- function directionChanged(cm) {
- runInOp(cm, function () {
- setDirectionClass(cm);
- regChange(cm);
- });
- }
- function History(prev) {
- // Arrays of change events and selections. Doing something adds an
- // event to done and clears undo. Undoing moves events from done
- // to undone, redoing moves them in the other direction.
- this.done = []; this.undone = [];
- this.undoDepth = prev ? prev.undoDepth : Infinity;
- // Used to track when changes can be merged into a single undo
- // event
- this.lastModTime = this.lastSelTime = 0;
- this.lastOp = this.lastSelOp = null;
- this.lastOrigin = this.lastSelOrigin = null;
- // Used by the isClean() method
- this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;
- }
- // Create a history change event from an updateDoc-style change
- // object.
- function historyChangeFromChange(doc, change) {
- var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};
- attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);
- linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);
- return histChange
- }
- // Pop all selection events off the end of a history array. Stop at
- // a change event.
- function clearSelectionEvents(array) {
- while (array.length) {
- var last = lst(array);
- if (last.ranges) { array.pop(); }
- else { break }
- }
- }
- // Find the top change event in the history. Pop off selection
- // events that are in the way.
- function lastChangeEvent(hist, force) {
- if (force) {
- clearSelectionEvents(hist.done);
- return lst(hist.done)
- } else if (hist.done.length && !lst(hist.done).ranges) {
- return lst(hist.done)
- } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {
- hist.done.pop();
- return lst(hist.done)
- }
- }
- // Register a change in the history. Merges changes that are within
- // a single operation, or are close together with an origin that
- // allows merging (starting with "+") into a single event.
- function addChangeToHistory(doc, change, selAfter, opId) {
- var hist = doc.history;
- hist.undone.length = 0;
- var time = +new Date, cur;
- var last;
- if ((hist.lastOp == opId ||
- hist.lastOrigin == change.origin && change.origin &&
- ((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||
- change.origin.charAt(0) == "*")) &&
- (cur = lastChangeEvent(hist, hist.lastOp == opId))) {
- // Merge this change into the last event
- last = lst(cur.changes);
- if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {
- // Optimized case for simple insertion -- don't want to add
- // new changesets for every character typed
- last.to = changeEnd(change);
- } else {
- // Add new sub-event
- cur.changes.push(historyChangeFromChange(doc, change));
- }
- } else {
- // Can not be merged, start a new event.
- var before = lst(hist.done);
- if (!before || !before.ranges)
- { pushSelectionToHistory(doc.sel, hist.done); }
- cur = {changes: [historyChangeFromChange(doc, change)],
- generation: hist.generation};
- hist.done.push(cur);
- while (hist.done.length > hist.undoDepth) {
- hist.done.shift();
- if (!hist.done[0].ranges) { hist.done.shift(); }
- }
- }
- hist.done.push(selAfter);
- hist.generation = ++hist.maxGeneration;
- hist.lastModTime = hist.lastSelTime = time;
- hist.lastOp = hist.lastSelOp = opId;
- hist.lastOrigin = hist.lastSelOrigin = change.origin;
- if (!last) { signal(doc, "historyAdded"); }
- }
- function selectionEventCanBeMerged(doc, origin, prev, sel) {
- var ch = origin.charAt(0);
- return ch == "*" ||
- ch == "+" &&
- prev.ranges.length == sel.ranges.length &&
- prev.somethingSelected() == sel.somethingSelected() &&
- new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)
- }
- // Called whenever the selection changes, sets the new selection as
- // the pending selection in the history, and pushes the old pending
- // selection into the 'done' array when it was significantly
- // different (in number of selected ranges, emptiness, or time).
- function addSelectionToHistory(doc, sel, opId, options) {
- var hist = doc.history, origin = options && options.origin;
- // A new event is started when the previous origin does not match
- // the current, or the origins don't allow matching. Origins
- // starting with * are always merged, those starting with + are
- // merged when similar and close together in time.
- if (opId == hist.lastSelOp ||
- (origin && hist.lastSelOrigin == origin &&
- (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||
- selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))
- { hist.done[hist.done.length - 1] = sel; }
- else
- { pushSelectionToHistory(sel, hist.done); }
- hist.lastSelTime = +new Date;
- hist.lastSelOrigin = origin;
- hist.lastSelOp = opId;
- if (options && options.clearRedo !== false)
- { clearSelectionEvents(hist.undone); }
- }
- function pushSelectionToHistory(sel, dest) {
- var top = lst(dest);
- if (!(top && top.ranges && top.equals(sel)))
- { dest.push(sel); }
- }
- // Used to store marked span information in the history.
- function attachLocalSpans(doc, change, from, to) {
- var existing = change["spans_" + doc.id], n = 0;
- doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {
- if (line.markedSpans)
- { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; }
- ++n;
- });
- }
- // When un/re-doing restores text containing marked spans, those
- // that have been explicitly cleared should not be restored.
- function removeClearedSpans(spans) {
- if (!spans) { return null }
- var out;
- for (var i = 0; i < spans.length; ++i) {
- if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }
- else if (out) { out.push(spans[i]); }
- }
- return !out ? spans : out.length ? out : null
- }
- // Retrieve and filter the old marked spans stored in a change event.
- function getOldSpans(doc, change) {
- var found = change["spans_" + doc.id];
- if (!found) { return null }
- var nw = [];
- for (var i = 0; i < change.text.length; ++i)
- { nw.push(removeClearedSpans(found[i])); }
- return nw
- }
- // Used for un/re-doing changes from the history. Combines the
- // result of computing the existing spans with the set of spans that
- // existed in the history (so that deleting around a span and then
- // undoing brings back the span).
- function mergeOldSpans(doc, change) {
- var old = getOldSpans(doc, change);
- var stretched = stretchSpansOverChange(doc, change);
- if (!old) { return stretched }
- if (!stretched) { return old }
- for (var i = 0; i < old.length; ++i) {
- var oldCur = old[i], stretchCur = stretched[i];
- if (oldCur && stretchCur) {
- spans: for (var j = 0; j < stretchCur.length; ++j) {
- var span = stretchCur[j];
- for (var k = 0; k < oldCur.length; ++k)
- { if (oldCur[k].marker == span.marker) { continue spans } }
- oldCur.push(span);
- }
- } else if (stretchCur) {
- old[i] = stretchCur;
- }
- }
- return old
- }
- // Used both to provide a JSON-safe object in .getHistory, and, when
- // detaching a document, to split the history in two
- function copyHistoryArray(events, newGroup, instantiateSel) {
- var copy = [];
- for (var i = 0; i < events.length; ++i) {
- var event = events[i];
- if (event.ranges) {
- copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);
- continue
- }
- var changes = event.changes, newChanges = [];
- copy.push({changes: newChanges});
- for (var j = 0; j < changes.length; ++j) {
- var change = changes[j], m = (void 0);
- newChanges.push({from: change.from, to: change.to, text: change.text});
- if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) {
- if (indexOf(newGroup, Number(m[1])) > -1) {
- lst(newChanges)[prop] = change[prop];
- delete change[prop];
- }
- } } }
- }
- }
- return copy
- }
- // The 'scroll' parameter given to many of these indicated whether
- // the new cursor position should be scrolled into view after
- // modifying the selection.
- // If shift is held or the extend flag is set, extends a range to
- // include a given position (and optionally a second position).
- // Otherwise, simply returns the range between the given positions.
- // Used for cursor motion and such.
- function extendRange(range, head, other, extend) {
- if (extend) {
- var anchor = range.anchor;
- if (other) {
- var posBefore = cmp(head, anchor) < 0;
- if (posBefore != (cmp(other, anchor) < 0)) {
- anchor = head;
- head = other;
- } else if (posBefore != (cmp(head, other) < 0)) {
- head = other;
- }
- }
- return new Range(anchor, head)
- } else {
- return new Range(other || head, head)
- }
- }
- // Extend the primary selection range, discard the rest.
- function extendSelection(doc, head, other, options, extend) {
- if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }
- setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);
- }
- // Extend all selections (pos is an array of selections with length
- // equal the number of selections)
- function extendSelections(doc, heads, options) {
- var out = [];
- var extend = doc.cm && (doc.cm.display.shift || doc.extend);
- for (var i = 0; i < doc.sel.ranges.length; i++)
- { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }
- var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);
- setSelection(doc, newSel, options);
- }
- // Updates a single range in the selection.
- function replaceOneSelection(doc, i, range, options) {
- var ranges = doc.sel.ranges.slice(0);
- ranges[i] = range;
- setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);
- }
- // Reset the selection to a single range.
- function setSimpleSelection(doc, anchor, head, options) {
- setSelection(doc, simpleSelection(anchor, head), options);
- }
- // Give beforeSelectionChange handlers a change to influence a
- // selection update.
- function filterSelectionChange(doc, sel, options) {
- var obj = {
- ranges: sel.ranges,
- update: function(ranges) {
- this.ranges = [];
- for (var i = 0; i < ranges.length; i++)
- { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
- clipPos(doc, ranges[i].head)); }
- },
- origin: options && options.origin
- };
- signal(doc, "beforeSelectionChange", doc, obj);
- if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj); }
- if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }
- else { return sel }
- }
- function setSelectionReplaceHistory(doc, sel, options) {
- var done = doc.history.done, last = lst(done);
- if (last && last.ranges) {
- done[done.length - 1] = sel;
- setSelectionNoUndo(doc, sel, options);
- } else {
- setSelection(doc, sel, options);
- }
- }
- // Set a new selection.
- function setSelection(doc, sel, options) {
- setSelectionNoUndo(doc, sel, options);
- addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);
- }
- function setSelectionNoUndo(doc, sel, options) {
- if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
- { sel = filterSelectionChange(doc, sel, options); }
- var bias = options && options.bias ||
- (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);
- setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));
- if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor")
- { ensureCursorVisible(doc.cm); }
- }
- function setSelectionInner(doc, sel) {
- if (sel.equals(doc.sel)) { return }
- doc.sel = sel;
- if (doc.cm) {
- doc.cm.curOp.updateInput = 1;
- doc.cm.curOp.selectionChanged = true;
- signalCursorActivity(doc.cm);
- }
- signalLater(doc, "cursorActivity", doc);
- }
- // Verify that the selection does not partially select any atomic
- // marked ranges.
- function reCheckSelection(doc) {
- setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));
- }
- // Return a selection that does not partially select any atomic
- // ranges.
- function skipAtomicInSelection(doc, sel, bias, mayClear) {
- var out;
- for (var i = 0; i < sel.ranges.length; i++) {
- var range = sel.ranges[i];
- var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];
- var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);
- var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);
- if (out || newAnchor != range.anchor || newHead != range.head) {
- if (!out) { out = sel.ranges.slice(0, i); }
- out[i] = new Range(newAnchor, newHead);
- }
- }
- return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel
- }
- function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
- var line = getLine(doc, pos.line);
- if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
- var sp = line.markedSpans[i], m = sp.marker;
- // Determine if we should prevent the cursor being placed to the left/right of an atomic marker
- // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it
- // is with selectLeft/Right
- var preventCursorLeft = ("selectLeft" in m) ? !m.selectLeft : m.inclusiveLeft;
- var preventCursorRight = ("selectRight" in m) ? !m.selectRight : m.inclusiveRight;
- if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&
- (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {
- if (mayClear) {
- signal(m, "beforeCursorEnter");
- if (m.explicitlyCleared) {
- if (!line.markedSpans) { break }
- else {--i; continue}
- }
- }
- if (!m.atomic) { continue }
- if (oldPos) {
- var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);
- if (dir < 0 ? preventCursorRight : preventCursorLeft)
- { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }
- if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
- { return skipAtomicInner(doc, near, pos, dir, mayClear) }
- }
- var far = m.find(dir < 0 ? -1 : 1);
- if (dir < 0 ? preventCursorLeft : preventCursorRight)
- { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }
- return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null
- }
- } }
- return pos
- }
- // Ensure a given position is not inside an atomic range.
- function skipAtomic(doc, pos, oldPos, bias, mayClear) {
- var dir = bias || 1;
- var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||
- (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||
- skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||
- (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));
- if (!found) {
- doc.cantEdit = true;
- return Pos(doc.first, 0)
- }
- return found
- }
- function movePos(doc, pos, dir, line) {
- if (dir < 0 && pos.ch == 0) {
- if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }
- else { return null }
- } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {
- if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }
- else { return null }
- } else {
- return new Pos(pos.line, pos.ch + dir)
- }
- }
- function selectAll(cm) {
- cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);
- }
- // UPDATING
- // Allow "beforeChange" event handlers to influence a change
- function filterChange(doc, change, update) {
- var obj = {
- canceled: false,
- from: change.from,
- to: change.to,
- text: change.text,
- origin: change.origin,
- cancel: function () { return obj.canceled = true; }
- };
- if (update) { obj.update = function (from, to, text, origin) {
- if (from) { obj.from = clipPos(doc, from); }
- if (to) { obj.to = clipPos(doc, to); }
- if (text) { obj.text = text; }
- if (origin !== undefined) { obj.origin = origin; }
- }; }
- signal(doc, "beforeChange", doc, obj);
- if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj); }
- if (obj.canceled) {
- if (doc.cm) { doc.cm.curOp.updateInput = 2; }
- return null
- }
- return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}
- }
- // Apply a change to a document, and add it to the document's
- // history, and propagating it to all linked documents.
- function makeChange(doc, change, ignoreReadOnly) {
- if (doc.cm) {
- if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }
- if (doc.cm.state.suppressEdits) { return }
- }
- if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
- change = filterChange(doc, change, true);
- if (!change) { return }
- }
- // Possibly split or suppress the update based on the presence
- // of read-only spans in its range.
- var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);
- if (split) {
- for (var i = split.length - 1; i >= 0; --i)
- { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}); }
- } else {
- makeChangeInner(doc, change);
- }
- }
- function makeChangeInner(doc, change) {
- if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return }
- var selAfter = computeSelAfterChange(doc, change);
- addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);
- makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));
- var rebased = [];
- linkedDocs(doc, function (doc, sharedHist) {
- if (!sharedHist && indexOf(rebased, doc.history) == -1) {
- rebaseHist(doc.history, change);
- rebased.push(doc.history);
- }
- makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));
- });
- }
- // Revert a change stored in a document's history.
- function makeChangeFromHistory(doc, type, allowSelectionOnly) {
- var suppress = doc.cm && doc.cm.state.suppressEdits;
- if (suppress && !allowSelectionOnly) { return }
- var hist = doc.history, event, selAfter = doc.sel;
- var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done;
- // Verify that there is a useable event (so that ctrl-z won't
- // needlessly clear selection events)
- var i = 0;
- for (; i < source.length; i++) {
- event = source[i];
- if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)
- { break }
- }
- if (i == source.length) { return }
- hist.lastOrigin = hist.lastSelOrigin = null;
- for (;;) {
- event = source.pop();
- if (event.ranges) {
- pushSelectionToHistory(event, dest);
- if (allowSelectionOnly && !event.equals(doc.sel)) {
- setSelection(doc, event, {clearRedo: false});
- return
- }
- selAfter = event;
- } else if (suppress) {
- source.push(event);
- return
- } else { break }
- }
- // Build up a reverse change object to add to the opposite history
- // stack (redo when undoing, and vice versa).
- var antiChanges = [];
- pushSelectionToHistory(selAfter, dest);
- dest.push({changes: antiChanges, generation: hist.generation});
- hist.generation = event.generation || ++hist.maxGeneration;
- var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange");
- var loop = function ( i ) {
- var change = event.changes[i];
- change.origin = type;
- if (filter && !filterChange(doc, change, false)) {
- source.length = 0;
- return {}
- }
- antiChanges.push(historyChangeFromChange(doc, change));
- var after = i ? computeSelAfterChange(doc, change) : lst(source);
- makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));
- if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }
- var rebased = [];
- // Propagate to the linked documents
- linkedDocs(doc, function (doc, sharedHist) {
- if (!sharedHist && indexOf(rebased, doc.history) == -1) {
- rebaseHist(doc.history, change);
- rebased.push(doc.history);
- }
- makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));
- });
- };
- for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {
- var returned = loop( i$1 );
- if ( returned ) return returned.v;
- }
- }
- // Sub-views need their line numbers shifted when text is added
- // above or below them in the parent document.
- function shiftDoc(doc, distance) {
- if (distance == 0) { return }
- doc.first += distance;
- doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(
- Pos(range.anchor.line + distance, range.anchor.ch),
- Pos(range.head.line + distance, range.head.ch)
- ); }), doc.sel.primIndex);
- if (doc.cm) {
- regChange(doc.cm, doc.first, doc.first - distance, distance);
- for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)
- { regLineChange(doc.cm, l, "gutter"); }
- }
- }
- // More lower-level change function, handling only a single document
- // (not linked ones).
- function makeChangeSingleDoc(doc, change, selAfter, spans) {
- if (doc.cm && !doc.cm.curOp)
- { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }
- if (change.to.line < doc.first) {
- shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));
- return
- }
- if (change.from.line > doc.lastLine()) { return }
- // Clip the change to the size of this doc
- if (change.from.line < doc.first) {
- var shift = change.text.length - 1 - (doc.first - change.from.line);
- shiftDoc(doc, shift);
- change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),
- text: [lst(change.text)], origin: change.origin};
- }
- var last = doc.lastLine();
- if (change.to.line > last) {
- change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),
- text: [change.text[0]], origin: change.origin};
- }
- change.removed = getBetween(doc, change.from, change.to);
- if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }
- if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }
- else { updateDoc(doc, change, spans); }
- setSelectionNoUndo(doc, selAfter, sel_dontScroll);
- if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))
- { doc.cantEdit = false; }
- }
- // Handle the interaction of a change to a document with the editor
- // that this document is part of.
- function makeChangeSingleDocInEditor(cm, change, spans) {
- var doc = cm.doc, display = cm.display, from = change.from, to = change.to;
- var recomputeMaxLength = false, checkWidthStart = from.line;
- if (!cm.options.lineWrapping) {
- checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));
- doc.iter(checkWidthStart, to.line + 1, function (line) {
- if (line == display.maxLine) {
- recomputeMaxLength = true;
- return true
- }
- });
- }
- if (doc.sel.contains(change.from, change.to) > -1)
- { signalCursorActivity(cm); }
- updateDoc(doc, change, spans, estimateHeight(cm));
- if (!cm.options.lineWrapping) {
- doc.iter(checkWidthStart, from.line + change.text.length, function (line) {
- var len = lineLength(line);
- if (len > display.maxLineLength) {
- display.maxLine = line;
- display.maxLineLength = len;
- display.maxLineChanged = true;
- recomputeMaxLength = false;
- }
- });
- if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }
- }
- retreatFrontier(doc, from.line);
- startWorker(cm, 400);
- var lendiff = change.text.length - (to.line - from.line) - 1;
- // Remember that these lines changed, for updating the display
- if (change.full)
- { regChange(cm); }
- else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))
- { regLineChange(cm, from.line, "text"); }
- else
- { regChange(cm, from.line, to.line + 1, lendiff); }
- var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change");
- if (changeHandler || changesHandler) {
- var obj = {
- from: from, to: to,
- text: change.text,
- removed: change.removed,
- origin: change.origin
- };
- if (changeHandler) { signalLater(cm, "change", cm, obj); }
- if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }
- }
- cm.display.selForContextMenu = null;
- }
- function replaceRange(doc, code, from, to, origin) {
- var assign;
- if (!to) { to = from; }
- if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }
- if (typeof code == "string") { code = doc.splitLines(code); }
- makeChange(doc, {from: from, to: to, text: code, origin: origin});
- }
- // Rebasing/resetting history to deal with externally-sourced changes
- function rebaseHistSelSingle(pos, from, to, diff) {
- if (to < pos.line) {
- pos.line += diff;
- } else if (from < pos.line) {
- pos.line = from;
- pos.ch = 0;
- }
- }
- // Tries to rebase an array of history events given a change in the
- // document. If the change touches the same lines as the event, the
- // event, and everything 'behind' it, is discarded. If the change is
- // before the event, the event's positions are updated. Uses a
- // copy-on-write scheme for the positions, to avoid having to
- // reallocate them all on every rebase, but also avoid problems with
- // shared position objects being unsafely updated.
- function rebaseHistArray(array, from, to, diff) {
- for (var i = 0; i < array.length; ++i) {
- var sub = array[i], ok = true;
- if (sub.ranges) {
- if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }
- for (var j = 0; j < sub.ranges.length; j++) {
- rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);
- rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);
- }
- continue
- }
- for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {
- var cur = sub.changes[j$1];
- if (to < cur.from.line) {
- cur.from = Pos(cur.from.line + diff, cur.from.ch);
- cur.to = Pos(cur.to.line + diff, cur.to.ch);
- } else if (from <= cur.to.line) {
- ok = false;
- break
- }
- }
- if (!ok) {
- array.splice(0, i + 1);
- i = 0;
- }
- }
- }
- function rebaseHist(hist, change) {
- var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;
- rebaseHistArray(hist.done, from, to, diff);
- rebaseHistArray(hist.undone, from, to, diff);
- }
- // Utility for applying a change to a line by handle or number,
- // returning the number and optionally registering the line as
- // changed.
- function changeLine(doc, handle, changeType, op) {
- var no = handle, line = handle;
- if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)); }
- else { no = lineNo(handle); }
- if (no == null) { return null }
- if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }
- return line
- }
- // The document is represented as a BTree consisting of leaves, with
- // chunk of lines in them, and branches, with up to ten leaves or
- // other branch nodes below them. The top node is always a branch
- // node, and is the document object itself (meaning it has
- // additional methods and properties).
- //
- // All nodes have parent links. The tree is used both to go from
- // line numbers to line objects, and to go from objects to numbers.
- // It also indexes by height, and is used to convert between height
- // and line object, and to find the total height of the document.
- //
- // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html
- function LeafChunk(lines) {
- this.lines = lines;
- this.parent = null;
- var height = 0;
- for (var i = 0; i < lines.length; ++i) {
- lines[i].parent = this;
- height += lines[i].height;
- }
- this.height = height;
- }
- LeafChunk.prototype = {
- chunkSize: function() { return this.lines.length },
- // Remove the n lines at offset 'at'.
- removeInner: function(at, n) {
- for (var i = at, e = at + n; i < e; ++i) {
- var line = this.lines[i];
- this.height -= line.height;
- cleanUpLine(line);
- signalLater(line, "delete");
- }
- this.lines.splice(at, n);
- },
- // Helper used to collapse a small branch into a single leaf.
- collapse: function(lines) {
- lines.push.apply(lines, this.lines);
- },
- // Insert the given array of lines at offset 'at', count them as
- // having the given height.
- insertInner: function(at, lines, height) {
- this.height += height;
- this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));
- for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }
- },
- // Used to iterate over a part of the tree.
- iterN: function(at, n, op) {
- for (var e = at + n; at < e; ++at)
- { if (op(this.lines[at])) { return true } }
- }
- };
- function BranchChunk(children) {
- this.children = children;
- var size = 0, height = 0;
- for (var i = 0; i < children.length; ++i) {
- var ch = children[i];
- size += ch.chunkSize(); height += ch.height;
- ch.parent = this;
- }
- this.size = size;
- this.height = height;
- this.parent = null;
- }
- BranchChunk.prototype = {
- chunkSize: function() { return this.size },
- removeInner: function(at, n) {
- this.size -= n;
- for (var i = 0; i < this.children.length; ++i) {
- var child = this.children[i], sz = child.chunkSize();
- if (at < sz) {
- var rm = Math.min(n, sz - at), oldHeight = child.height;
- child.removeInner(at, rm);
- this.height -= oldHeight - child.height;
- if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }
- if ((n -= rm) == 0) { break }
- at = 0;
- } else { at -= sz; }
- }
- // If the result is smaller than 25 lines, ensure that it is a
- // single leaf node.
- if (this.size - n < 25 &&
- (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
- var lines = [];
- this.collapse(lines);
- this.children = [new LeafChunk(lines)];
- this.children[0].parent = this;
- }
- },
- collapse: function(lines) {
- for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }
- },
- insertInner: function(at, lines, height) {
- this.size += lines.length;
- this.height += height;
- for (var i = 0; i < this.children.length; ++i) {
- var child = this.children[i], sz = child.chunkSize();
- if (at <= sz) {
- child.insertInner(at, lines, height);
- if (child.lines && child.lines.length > 50) {
- // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
- // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
- var remaining = child.lines.length % 25 + 25;
- for (var pos = remaining; pos < child.lines.length;) {
- var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));
- child.height -= leaf.height;
- this.children.splice(++i, 0, leaf);
- leaf.parent = this;
- }
- child.lines = child.lines.slice(0, remaining);
- this.maybeSpill();
- }
- break
- }
- at -= sz;
- }
- },
- // When a node has grown, check whether it should be split.
- maybeSpill: function() {
- if (this.children.length <= 10) { return }
- var me = this;
- do {
- var spilled = me.children.splice(me.children.length - 5, 5);
- var sibling = new BranchChunk(spilled);
- if (!me.parent) { // Become the parent node
- var copy = new BranchChunk(me.children);
- copy.parent = me;
- me.children = [copy, sibling];
- me = copy;
- } else {
- me.size -= sibling.size;
- me.height -= sibling.height;
- var myIndex = indexOf(me.parent.children, me);
- me.parent.children.splice(myIndex + 1, 0, sibling);
- }
- sibling.parent = me.parent;
- } while (me.children.length > 10)
- me.parent.maybeSpill();
- },
- iterN: function(at, n, op) {
- for (var i = 0; i < this.children.length; ++i) {
- var child = this.children[i], sz = child.chunkSize();
- if (at < sz) {
- var used = Math.min(n, sz - at);
- if (child.iterN(at, used, op)) { return true }
- if ((n -= used) == 0) { break }
- at = 0;
- } else { at -= sz; }
- }
- }
- };
- // Line widgets are block elements displayed above or below a line.
- var LineWidget = function(doc, node, options) {
- if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))
- { this[opt] = options[opt]; } } }
- this.doc = doc;
- this.node = node;
- };
- LineWidget.prototype.clear = function () {
- var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);
- if (no == null || !ws) { return }
- for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }
- if (!ws.length) { line.widgets = null; }
- var height = widgetHeight(this);
- updateLineHeight(line, Math.max(0, line.height - height));
- if (cm) {
- runInOp(cm, function () {
- adjustScrollWhenAboveVisible(cm, line, -height);
- regLineChange(cm, no, "widget");
- });
- signalLater(cm, "lineWidgetCleared", cm, this, no);
- }
- };
- LineWidget.prototype.changed = function () {
- var this$1 = this;
- var oldH = this.height, cm = this.doc.cm, line = this.line;
- this.height = null;
- var diff = widgetHeight(this) - oldH;
- if (!diff) { return }
- if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }
- if (cm) {
- runInOp(cm, function () {
- cm.curOp.forceUpdate = true;
- adjustScrollWhenAboveVisible(cm, line, diff);
- signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line));
- });
- }
- };
- eventMixin(LineWidget);
- function adjustScrollWhenAboveVisible(cm, line, diff) {
- if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))
- { addToScrollTop(cm, diff); }
- }
- function addLineWidget(doc, handle, node, options) {
- var widget = new LineWidget(doc, node, options);
- var cm = doc.cm;
- if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }
- changeLine(doc, handle, "widget", function (line) {
- var widgets = line.widgets || (line.widgets = []);
- if (widget.insertAt == null) { widgets.push(widget); }
- else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }
- widget.line = line;
- if (cm && !lineIsHidden(doc, line)) {
- var aboveVisible = heightAtLine(line) < doc.scrollTop;
- updateLineHeight(line, line.height + widgetHeight(widget));
- if (aboveVisible) { addToScrollTop(cm, widget.height); }
- cm.curOp.forceUpdate = true;
- }
- return true
- });
- if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); }
- return widget
- }
- // TEXTMARKERS
- // Created with markText and setBookmark methods. A TextMarker is a
- // handle that can be used to clear or find a marked position in the
- // document. Line objects hold arrays (markedSpans) containing
- // {from, to, marker} object pointing to such marker objects, and
- // indicating that such a marker is present on that line. Multiple
- // lines may point to the same marker when it spans across lines.
- // The spans will have null for their from/to properties when the
- // marker continues beyond the start/end of the line. Markers have
- // links back to the lines they currently touch.
- // Collapsed markers have unique ids, in order to be able to order
- // them, which is needed for uniquely determining an outer marker
- // when they overlap (they may nest, but not partially overlap).
- var nextMarkerId = 0;
- var TextMarker = function(doc, type) {
- this.lines = [];
- this.type = type;
- this.doc = doc;
- this.id = ++nextMarkerId;
- };
- // Clear the marker.
- TextMarker.prototype.clear = function () {
- if (this.explicitlyCleared) { return }
- var cm = this.doc.cm, withOp = cm && !cm.curOp;
- if (withOp) { startOperation(cm); }
- if (hasHandler(this, "clear")) {
- var found = this.find();
- if (found) { signalLater(this, "clear", found.from, found.to); }
- }
- var min = null, max = null;
- for (var i = 0; i < this.lines.length; ++i) {
- var line = this.lines[i];
- var span = getMarkedSpanFor(line.markedSpans, this);
- if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), "text"); }
- else if (cm) {
- if (span.to != null) { max = lineNo(line); }
- if (span.from != null) { min = lineNo(line); }
- }
- line.markedSpans = removeMarkedSpan(line.markedSpans, span);
- if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)
- { updateLineHeight(line, textHeight(cm.display)); }
- }
- if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {
- var visual = visualLine(this.lines[i$1]), len = lineLength(visual);
- if (len > cm.display.maxLineLength) {
- cm.display.maxLine = visual;
- cm.display.maxLineLength = len;
- cm.display.maxLineChanged = true;
- }
- } }
- if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }
- this.lines.length = 0;
- this.explicitlyCleared = true;
- if (this.atomic && this.doc.cantEdit) {
- this.doc.cantEdit = false;
- if (cm) { reCheckSelection(cm.doc); }
- }
- if (cm) { signalLater(cm, "markerCleared", cm, this, min, max); }
- if (withOp) { endOperation(cm); }
- if (this.parent) { this.parent.clear(); }
- };
- // Find the position of the marker in the document. Returns a {from,
- // to} object by default. Side can be passed to get a specific side
- // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the
- // Pos objects returned contain a line object, rather than a line
- // number (used to prevent looking up the same line twice).
- TextMarker.prototype.find = function (side, lineObj) {
- if (side == null && this.type == "bookmark") { side = 1; }
- var from, to;
- for (var i = 0; i < this.lines.length; ++i) {
- var line = this.lines[i];
- var span = getMarkedSpanFor(line.markedSpans, this);
- if (span.from != null) {
- from = Pos(lineObj ? line : lineNo(line), span.from);
- if (side == -1) { return from }
- }
- if (span.to != null) {
- to = Pos(lineObj ? line : lineNo(line), span.to);
- if (side == 1) { return to }
- }
- }
- return from && {from: from, to: to}
- };
- // Signals that the marker's widget changed, and surrounding layout
- // should be recomputed.
- TextMarker.prototype.changed = function () {
- var this$1 = this;
- var pos = this.find(-1, true), widget = this, cm = this.doc.cm;
- if (!pos || !cm) { return }
- runInOp(cm, function () {
- var line = pos.line, lineN = lineNo(pos.line);
- var view = findViewForLine(cm, lineN);
- if (view) {
- clearLineMeasurementCacheFor(view);
- cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;
- }
- cm.curOp.updateMaxLine = true;
- if (!lineIsHidden(widget.doc, line) && widget.height != null) {
- var oldHeight = widget.height;
- widget.height = null;
- var dHeight = widgetHeight(widget) - oldHeight;
- if (dHeight)
- { updateLineHeight(line, line.height + dHeight); }
- }
- signalLater(cm, "markerChanged", cm, this$1);
- });
- };
- TextMarker.prototype.attachLine = function (line) {
- if (!this.lines.length && this.doc.cm) {
- var op = this.doc.cm.curOp;
- if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)
- { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }
- }
- this.lines.push(line);
- };
- TextMarker.prototype.detachLine = function (line) {
- this.lines.splice(indexOf(this.lines, line), 1);
- if (!this.lines.length && this.doc.cm) {
- var op = this.doc.cm.curOp
- ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);
- }
- };
- eventMixin(TextMarker);
- // Create a marker, wire it up to the right lines, and
- function markText(doc, from, to, options, type) {
- // Shared markers (across linked documents) are handled separately
- // (markTextShared will call out to this again, once per
- // document).
- if (options && options.shared) { return markTextShared(doc, from, to, options, type) }
- // Ensure we are in an operation.
- if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }
- var marker = new TextMarker(doc, type), diff = cmp(from, to);
- if (options) { copyObj(options, marker, false); }
- // Don't connect empty markers unless clearWhenEmpty is false
- if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)
- { return marker }
- if (marker.replacedWith) {
- // Showing up as a widget implies collapsed (widget replaces text)
- marker.collapsed = true;
- marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget");
- if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true"); }
- if (options.insertLeft) { marker.widgetNode.insertLeft = true; }
- }
- if (marker.collapsed) {
- if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||
- from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))
- { throw new Error("Inserting collapsed marker partially overlapping an existing one") }
- seeCollapsedSpans();
- }
- if (marker.addToHistory)
- { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); }
- var curLine = from.line, cm = doc.cm, updateMaxLine;
- doc.iter(curLine, to.line + 1, function (line) {
- if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)
- { updateMaxLine = true; }
- if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }
- addMarkedSpan(line, new MarkedSpan(marker,
- curLine == from.line ? from.ch : null,
- curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);
- ++curLine;
- });
- // lineIsHidden depends on the presence of the spans, so needs a second pass
- if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {
- if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }
- }); }
- if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }); }
- if (marker.readOnly) {
- seeReadOnlySpans();
- if (doc.history.done.length || doc.history.undone.length)
- { doc.clearHistory(); }
- }
- if (marker.collapsed) {
- marker.id = ++nextMarkerId;
- marker.atomic = true;
- }
- if (cm) {
- // Sync editor state
- if (updateMaxLine) { cm.curOp.updateMaxLine = true; }
- if (marker.collapsed)
- { regChange(cm, from.line, to.line + 1); }
- else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||
- marker.attributes || marker.title)
- { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text"); } }
- if (marker.atomic) { reCheckSelection(cm.doc); }
- signalLater(cm, "markerAdded", cm, marker);
- }
- return marker
- }
- // SHARED TEXTMARKERS
- // A shared marker spans multiple linked documents. It is
- // implemented as a meta-marker-object controlling multiple normal
- // markers.
- var SharedTextMarker = function(markers, primary) {
- this.markers = markers;
- this.primary = primary;
- for (var i = 0; i < markers.length; ++i)
- { markers[i].parent = this; }
- };
- SharedTextMarker.prototype.clear = function () {
- if (this.explicitlyCleared) { return }
- this.explicitlyCleared = true;
- for (var i = 0; i < this.markers.length; ++i)
- { this.markers[i].clear(); }
- signalLater(this, "clear");
- };
- SharedTextMarker.prototype.find = function (side, lineObj) {
- return this.primary.find(side, lineObj)
- };
- eventMixin(SharedTextMarker);
- function markTextShared(doc, from, to, options, type) {
- options = copyObj(options);
- options.shared = false;
- var markers = [markText(doc, from, to, options, type)], primary = markers[0];
- var widget = options.widgetNode;
- linkedDocs(doc, function (doc) {
- if (widget) { options.widgetNode = widget.cloneNode(true); }
- markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));
- for (var i = 0; i < doc.linked.length; ++i)
- { if (doc.linked[i].isParent) { return } }
- primary = lst(markers);
- });
- return new SharedTextMarker(markers, primary)
- }
- function findSharedMarkers(doc) {
- return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })
- }
- function copySharedMarkers(doc, markers) {
- for (var i = 0; i < markers.length; i++) {
- var marker = markers[i], pos = marker.find();
- var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);
- if (cmp(mFrom, mTo)) {
- var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);
- marker.markers.push(subMark);
- subMark.parent = marker;
- }
- }
- }
- function detachSharedMarkers(markers) {
- var loop = function ( i ) {
- var marker = markers[i], linked = [marker.primary.doc];
- linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });
- for (var j = 0; j < marker.markers.length; j++) {
- var subMarker = marker.markers[j];
- if (indexOf(linked, subMarker.doc) == -1) {
- subMarker.parent = null;
- marker.markers.splice(j--, 1);
- }
- }
- };
- for (var i = 0; i < markers.length; i++) loop( i );
- }
- var nextDocId = 0;
- var Doc = function(text, mode, firstLine, lineSep, direction) {
- if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }
- if (firstLine == null) { firstLine = 0; }
- BranchChunk.call(this, [new LeafChunk([new Line("", null)])]);
- this.first = firstLine;
- this.scrollTop = this.scrollLeft = 0;
- this.cantEdit = false;
- this.cleanGeneration = 1;
- this.modeFrontier = this.highlightFrontier = firstLine;
- var start = Pos(firstLine, 0);
- this.sel = simpleSelection(start);
- this.history = new History(null);
- this.id = ++nextDocId;
- this.modeOption = mode;
- this.lineSep = lineSep;
- this.direction = (direction == "rtl") ? "rtl" : "ltr";
- this.extend = false;
- if (typeof text == "string") { text = this.splitLines(text); }
- updateDoc(this, {from: start, to: start, text: text});
- setSelection(this, simpleSelection(start), sel_dontScroll);
- };
- Doc.prototype = createObj(BranchChunk.prototype, {
- constructor: Doc,
- // Iterate over the document. Supports two forms -- with only one
- // argument, it calls that for each line in the document. With
- // three, it iterates over the range given by the first two (with
- // the second being non-inclusive).
- iter: function(from, to, op) {
- if (op) { this.iterN(from - this.first, to - from, op); }
- else { this.iterN(this.first, this.first + this.size, from); }
- },
- // Non-public interface for adding and removing lines.
- insert: function(at, lines) {
- var height = 0;
- for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }
- this.insertInner(at - this.first, lines, height);
- },
- remove: function(at, n) { this.removeInner(at - this.first, n); },
- // From here, the methods are part of the public interface. Most
- // are also available from CodeMirror (editor) instances.
- getValue: function(lineSep) {
- var lines = getLines(this, this.first, this.first + this.size);
- if (lineSep === false) { return lines }
- return lines.join(lineSep || this.lineSeparator())
- },
- setValue: docMethodOp(function(code) {
- var top = Pos(this.first, 0), last = this.first + this.size - 1;
- makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
- text: this.splitLines(code), origin: "setValue", full: true}, true);
- if (this.cm) { scrollToCoords(this.cm, 0, 0); }
- setSelection(this, simpleSelection(top), sel_dontScroll);
- }),
- replaceRange: function(code, from, to, origin) {
- from = clipPos(this, from);
- to = to ? clipPos(this, to) : from;
- replaceRange(this, code, from, to, origin);
- },
- getRange: function(from, to, lineSep) {
- var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
- if (lineSep === false) { return lines }
- if (lineSep === '') { return lines.join('') }
- return lines.join(lineSep || this.lineSeparator())
- },
- getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},
- getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},
- getLineNumber: function(line) {return lineNo(line)},
- getLineHandleVisualStart: function(line) {
- if (typeof line == "number") { line = getLine(this, line); }
- return visualLine(line)
- },
- lineCount: function() {return this.size},
- firstLine: function() {return this.first},
- lastLine: function() {return this.first + this.size - 1},
- clipPos: function(pos) {return clipPos(this, pos)},
- getCursor: function(start) {
- var range = this.sel.primary(), pos;
- if (start == null || start == "head") { pos = range.head; }
- else if (start == "anchor") { pos = range.anchor; }
- else if (start == "end" || start == "to" || start === false) { pos = range.to(); }
- else { pos = range.from(); }
- return pos
- },
- listSelections: function() { return this.sel.ranges },
- somethingSelected: function() {return this.sel.somethingSelected()},
- setCursor: docMethodOp(function(line, ch, options) {
- setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options);
- }),
- setSelection: docMethodOp(function(anchor, head, options) {
- setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);
- }),
- extendSelection: docMethodOp(function(head, other, options) {
- extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);
- }),
- extendSelections: docMethodOp(function(heads, options) {
- extendSelections(this, clipPosArray(this, heads), options);
- }),
- extendSelectionsBy: docMethodOp(function(f, options) {
- var heads = map(this.sel.ranges, f);
- extendSelections(this, clipPosArray(this, heads), options);
- }),
- setSelections: docMethodOp(function(ranges, primary, options) {
- if (!ranges.length) { return }
- var out = [];
- for (var i = 0; i < ranges.length; i++)
- { out[i] = new Range(clipPos(this, ranges[i].anchor),
- clipPos(this, ranges[i].head || ranges[i].anchor)); }
- if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }
- setSelection(this, normalizeSelection(this.cm, out, primary), options);
- }),
- addSelection: docMethodOp(function(anchor, head, options) {
- var ranges = this.sel.ranges.slice(0);
- ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));
- setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);
- }),
- getSelection: function(lineSep) {
- var ranges = this.sel.ranges, lines;
- for (var i = 0; i < ranges.length; i++) {
- var sel = getBetween(this, ranges[i].from(), ranges[i].to());
- lines = lines ? lines.concat(sel) : sel;
- }
- if (lineSep === false) { return lines }
- else { return lines.join(lineSep || this.lineSeparator()) }
- },
- getSelections: function(lineSep) {
- var parts = [], ranges = this.sel.ranges;
- for (var i = 0; i < ranges.length; i++) {
- var sel = getBetween(this, ranges[i].from(), ranges[i].to());
- if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }
- parts[i] = sel;
- }
- return parts
- },
- replaceSelection: function(code, collapse, origin) {
- var dup = [];
- for (var i = 0; i < this.sel.ranges.length; i++)
- { dup[i] = code; }
- this.replaceSelections(dup, collapse, origin || "+input");
- },
- replaceSelections: docMethodOp(function(code, collapse, origin) {
- var changes = [], sel = this.sel;
- for (var i = 0; i < sel.ranges.length; i++) {
- var range = sel.ranges[i];
- changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};
- }
- var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse);
- for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)
- { makeChange(this, changes[i$1]); }
- if (newSel) { setSelectionReplaceHistory(this, newSel); }
- else if (this.cm) { ensureCursorVisible(this.cm); }
- }),
- undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}),
- redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}),
- undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}),
- redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}),
- setExtending: function(val) {this.extend = val;},
- getExtending: function() {return this.extend},
- historySize: function() {
- var hist = this.history, done = 0, undone = 0;
- for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }
- for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }
- return {undo: done, redo: undone}
- },
- clearHistory: function() {
- var this$1 = this;
- this.history = new History(this.history);
- linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);
- },
- markClean: function() {
- this.cleanGeneration = this.changeGeneration(true);
- },
- changeGeneration: function(forceSplit) {
- if (forceSplit)
- { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }
- return this.history.generation
- },
- isClean: function (gen) {
- return this.history.generation == (gen || this.cleanGeneration)
- },
- getHistory: function() {
- return {done: copyHistoryArray(this.history.done),
- undone: copyHistoryArray(this.history.undone)}
- },
- setHistory: function(histData) {
- var hist = this.history = new History(this.history);
- hist.done = copyHistoryArray(histData.done.slice(0), null, true);
- hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);
- },
- setGutterMarker: docMethodOp(function(line, gutterID, value) {
- return changeLine(this, line, "gutter", function (line) {
- var markers = line.gutterMarkers || (line.gutterMarkers = {});
- markers[gutterID] = value;
- if (!value && isEmpty(markers)) { line.gutterMarkers = null; }
- return true
- })
- }),
- clearGutter: docMethodOp(function(gutterID) {
- var this$1 = this;
- this.iter(function (line) {
- if (line.gutterMarkers && line.gutterMarkers[gutterID]) {
- changeLine(this$1, line, "gutter", function () {
- line.gutterMarkers[gutterID] = null;
- if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }
- return true
- });
- }
- });
- }),
- lineInfo: function(line) {
- var n;
- if (typeof line == "number") {
- if (!isLine(this, line)) { return null }
- n = line;
- line = getLine(this, line);
- if (!line) { return null }
- } else {
- n = lineNo(line);
- if (n == null) { return null }
- }
- return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,
- textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,
- widgets: line.widgets}
- },
- addLineClass: docMethodOp(function(handle, where, cls) {
- return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
- var prop = where == "text" ? "textClass"
- : where == "background" ? "bgClass"
- : where == "gutter" ? "gutterClass" : "wrapClass";
- if (!line[prop]) { line[prop] = cls; }
- else if (classTest(cls).test(line[prop])) { return false }
- else { line[prop] += " " + cls; }
- return true
- })
- }),
- removeLineClass: docMethodOp(function(handle, where, cls) {
- return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
- var prop = where == "text" ? "textClass"
- : where == "background" ? "bgClass"
- : where == "gutter" ? "gutterClass" : "wrapClass";
- var cur = line[prop];
- if (!cur) { return false }
- else if (cls == null) { line[prop] = null; }
- else {
- var found = cur.match(classTest(cls));
- if (!found) { return false }
- var end = found.index + found[0].length;
- line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null;
- }
- return true
- })
- }),
- addLineWidget: docMethodOp(function(handle, node, options) {
- return addLineWidget(this, handle, node, options)
- }),
- removeLineWidget: function(widget) { widget.clear(); },
- markText: function(from, to, options) {
- return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range")
- },
- setBookmark: function(pos, options) {
- var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
- insertLeft: options && options.insertLeft,
- clearWhenEmpty: false, shared: options && options.shared,
- handleMouseEvents: options && options.handleMouseEvents};
- pos = clipPos(this, pos);
- return markText(this, pos, pos, realOpts, "bookmark")
- },
- findMarksAt: function(pos) {
- pos = clipPos(this, pos);
- var markers = [], spans = getLine(this, pos.line).markedSpans;
- if (spans) { for (var i = 0; i < spans.length; ++i) {
- var span = spans[i];
- if ((span.from == null || span.from <= pos.ch) &&
- (span.to == null || span.to >= pos.ch))
- { markers.push(span.marker.parent || span.marker); }
- } }
- return markers
- },
- findMarks: function(from, to, filter) {
- from = clipPos(this, from); to = clipPos(this, to);
- var found = [], lineNo = from.line;
- this.iter(from.line, to.line + 1, function (line) {
- var spans = line.markedSpans;
- if (spans) { for (var i = 0; i < spans.length; i++) {
- var span = spans[i];
- if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||
- span.from == null && lineNo != from.line ||
- span.from != null && lineNo == to.line && span.from >= to.ch) &&
- (!filter || filter(span.marker)))
- { found.push(span.marker.parent || span.marker); }
- } }
- ++lineNo;
- });
- return found
- },
- getAllMarks: function() {
- var markers = [];
- this.iter(function (line) {
- var sps = line.markedSpans;
- if (sps) { for (var i = 0; i < sps.length; ++i)
- { if (sps[i].from != null) { markers.push(sps[i].marker); } } }
- });
- return markers
- },
- posFromIndex: function(off) {
- var ch, lineNo = this.first, sepSize = this.lineSeparator().length;
- this.iter(function (line) {
- var sz = line.text.length + sepSize;
- if (sz > off) { ch = off; return true }
- off -= sz;
- ++lineNo;
- });
- return clipPos(this, Pos(lineNo, ch))
- },
- indexFromPos: function (coords) {
- coords = clipPos(this, coords);
- var index = coords.ch;
- if (coords.line < this.first || coords.ch < 0) { return 0 }
- var sepSize = this.lineSeparator().length;
- this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value
- index += line.text.length + sepSize;
- });
- return index
- },
- copy: function(copyHistory) {
- var doc = new Doc(getLines(this, this.first, this.first + this.size),
- this.modeOption, this.first, this.lineSep, this.direction);
- doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;
- doc.sel = this.sel;
- doc.extend = false;
- if (copyHistory) {
- doc.history.undoDepth = this.history.undoDepth;
- doc.setHistory(this.getHistory());
- }
- return doc
- },
- linkedDoc: function(options) {
- if (!options) { options = {}; }
- var from = this.first, to = this.first + this.size;
- if (options.from != null && options.from > from) { from = options.from; }
- if (options.to != null && options.to < to) { to = options.to; }
- var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);
- if (options.sharedHist) { copy.history = this.history
- ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});
- copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];
- copySharedMarkers(copy, findSharedMarkers(this));
- return copy
- },
- unlinkDoc: function(other) {
- if (other instanceof CodeMirror) { other = other.doc; }
- if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {
- var link = this.linked[i];
- if (link.doc != other) { continue }
- this.linked.splice(i, 1);
- other.unlinkDoc(this);
- detachSharedMarkers(findSharedMarkers(this));
- break
- } }
- // If the histories were shared, split them again
- if (other.history == this.history) {
- var splitIds = [other.id];
- linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);
- other.history = new History(null);
- other.history.done = copyHistoryArray(this.history.done, splitIds);
- other.history.undone = copyHistoryArray(this.history.undone, splitIds);
- }
- },
- iterLinkedDocs: function(f) {linkedDocs(this, f);},
- getMode: function() {return this.mode},
- getEditor: function() {return this.cm},
- splitLines: function(str) {
- if (this.lineSep) { return str.split(this.lineSep) }
- return splitLinesAuto(str)
- },
- lineSeparator: function() { return this.lineSep || "\n" },
- setDirection: docMethodOp(function (dir) {
- if (dir != "rtl") { dir = "ltr"; }
- if (dir == this.direction) { return }
- this.direction = dir;
- this.iter(function (line) { return line.order = null; });
- if (this.cm) { directionChanged(this.cm); }
- })
- });
- // Public alias.
- Doc.prototype.eachLine = Doc.prototype.iter;
- // Kludge to work around strange IE behavior where it'll sometimes
- // re-fire a series of drag-related events right after the drop (#1551)
- var lastDrop = 0;
- function onDrop(e) {
- var cm = this;
- clearDragCursor(cm);
- if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
- { return }
- e_preventDefault(e);
- if (ie) { lastDrop = +new Date; }
- var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
- if (!pos || cm.isReadOnly()) { return }
- // Might be a file drop, in which case we simply extract the text
- // and insert it.
- if (files && files.length && window.FileReader && window.File) {
- var n = files.length, text = Array(n), read = 0;
- var markAsReadAndPasteIfAllFilesAreRead = function () {
- if (++read == n) {
- operation(cm, function () {
- pos = clipPos(cm.doc, pos);
- var change = {from: pos, to: pos,
- text: cm.doc.splitLines(
- text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),
- origin: "paste"};
- makeChange(cm.doc, change);
- setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));
- })();
- }
- };
- var readTextFromFile = function (file, i) {
- if (cm.options.allowDropFileTypes &&
- indexOf(cm.options.allowDropFileTypes, file.type) == -1) {
- markAsReadAndPasteIfAllFilesAreRead();
- return
- }
- var reader = new FileReader;
- reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };
- reader.onload = function () {
- var content = reader.result;
- if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) {
- markAsReadAndPasteIfAllFilesAreRead();
- return
- }
- text[i] = content;
- markAsReadAndPasteIfAllFilesAreRead();
- };
- reader.readAsText(file);
- };
- for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }
- } else { // Normal drop
- // Don't do a replace if the drop happened inside of the selected text.
- if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {
- cm.state.draggingText(e);
- // Ensure the editor is re-focused
- setTimeout(function () { return cm.display.input.focus(); }, 20);
- return
- }
- try {
- var text$1 = e.dataTransfer.getData("Text");
- if (text$1) {
- var selected;
- if (cm.state.draggingText && !cm.state.draggingText.copy)
- { selected = cm.listSelections(); }
- setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));
- if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)
- { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag"); } }
- cm.replaceSelection(text$1, "around", "paste");
- cm.display.input.focus();
- }
- }
- catch(e$1){}
- }
- }
- function onDragStart(cm, e) {
- if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }
- if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }
- e.dataTransfer.setData("Text", cm.getSelection());
- e.dataTransfer.effectAllowed = "copyMove";
- // Use dummy image instead of default browsers image.
- // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
- if (e.dataTransfer.setDragImage && !safari) {
- var img = elt("img", null, null, "position: fixed; left: 0; top: 0;");
- img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
- if (presto) {
- img.width = img.height = 1;
- cm.display.wrapper.appendChild(img);
- // Force a relayout, or Opera won't use our image for some obscure reason
- img._top = img.offsetTop;
- }
- e.dataTransfer.setDragImage(img, 0, 0);
- if (presto) { img.parentNode.removeChild(img); }
- }
- }
- function onDragOver(cm, e) {
- var pos = posFromMouse(cm, e);
- if (!pos) { return }
- var frag = document.createDocumentFragment();
- drawSelectionCursor(cm, pos, frag);
- if (!cm.display.dragCursor) {
- cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors");
- cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);
- }
- removeChildrenAndAdd(cm.display.dragCursor, frag);
- }
- function clearDragCursor(cm) {
- if (cm.display.dragCursor) {
- cm.display.lineSpace.removeChild(cm.display.dragCursor);
- cm.display.dragCursor = null;
- }
- }
- // These must be handled carefully, because naively registering a
- // handler for each editor will cause the editors to never be
- // garbage collected.
- function forEachCodeMirror(f) {
- if (!document.getElementsByClassName) { return }
- var byClass = document.getElementsByClassName("CodeMirror"), editors = [];
- for (var i = 0; i < byClass.length; i++) {
- var cm = byClass[i].CodeMirror;
- if (cm) { editors.push(cm); }
- }
- if (editors.length) { editors[0].operation(function () {
- for (var i = 0; i < editors.length; i++) { f(editors[i]); }
- }); }
- }
- var globalsRegistered = false;
- function ensureGlobalHandlers() {
- if (globalsRegistered) { return }
- registerGlobalHandlers();
- globalsRegistered = true;
- }
- function registerGlobalHandlers() {
- // When the window resizes, we need to refresh active editors.
- var resizeTimer;
- on(window, "resize", function () {
- if (resizeTimer == null) { resizeTimer = setTimeout(function () {
- resizeTimer = null;
- forEachCodeMirror(onResize);
- }, 100); }
- });
- // When the window loses focus, we want to show the editor as blurred
- on(window, "blur", function () { return forEachCodeMirror(onBlur); });
- }
- // Called when the window resizes
- function onResize(cm) {
- var d = cm.display;
- // Might be a text scaling operation, clear size caches.
- d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;
- d.scrollbarsClipped = false;
- cm.setSize();
- }
- var keyNames = {
- 3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
- 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
- 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
- 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
- 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 145: "ScrollLock",
- 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
- 221: "]", 222: "'", 224: "Mod", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
- 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
- };
- // Number keys
- for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }
- // Alphabetic keys
- for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }
- // Function keys
- for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; }
- var keyMap = {};
- keyMap.basic = {
- "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
- "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
- "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",
- "Tab": "defaultTab", "Shift-Tab": "indentAuto",
- "Enter": "newlineAndIndent", "Insert": "toggleOverwrite",
- "Esc": "singleSelection"
- };
- // Note that the save and find-related commands aren't defined by
- // default. User code or addons can define them. Unknown commands
- // are simply ignored.
- keyMap.pcDefault = {
- "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo",
- "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown",
- "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd",
- "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find",
- "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll",
- "Ctrl-[": "indentLess", "Ctrl-]": "indentMore",
- "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection",
- "fallthrough": "basic"
- };
- // Very basic readline/emacs-style bindings, which are standard on Mac.
- keyMap.emacsy = {
- "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
- "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp",
- "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine",
- "Ctrl-T": "transposeChars", "Ctrl-O": "openLine"
- };
- keyMap.macDefault = {
- "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
- "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft",
- "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore",
- "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find",
- "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll",
- "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight",
- "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd",
- "fallthrough": ["basic", "emacsy"]
- };
- keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault;
- // KEYMAP DISPATCH
- function normalizeKeyName(name) {
- var parts = name.split(/-(?!$)/);
- name = parts[parts.length - 1];
- var alt, ctrl, shift, cmd;
- for (var i = 0; i < parts.length - 1; i++) {
- var mod = parts[i];
- if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }
- else if (/^a(lt)?$/i.test(mod)) { alt = true; }
- else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }
- else if (/^s(hift)?$/i.test(mod)) { shift = true; }
- else { throw new Error("Unrecognized modifier name: " + mod) }
- }
- if (alt) { name = "Alt-" + name; }
- if (ctrl) { name = "Ctrl-" + name; }
- if (cmd) { name = "Cmd-" + name; }
- if (shift) { name = "Shift-" + name; }
- return name
- }
- // This is a kludge to keep keymaps mostly working as raw objects
- // (backwards compatibility) while at the same time support features
- // like normalization and multi-stroke key bindings. It compiles a
- // new normalized keymap, and then updates the old object to reflect
- // this.
- function normalizeKeyMap(keymap) {
- var copy = {};
- for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {
- var value = keymap[keyname];
- if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }
- if (value == "...") { delete keymap[keyname]; continue }
- var keys = map(keyname.split(" "), normalizeKeyName);
- for (var i = 0; i < keys.length; i++) {
- var val = (void 0), name = (void 0);
- if (i == keys.length - 1) {
- name = keys.join(" ");
- val = value;
- } else {
- name = keys.slice(0, i + 1).join(" ");
- val = "...";
- }
- var prev = copy[name];
- if (!prev) { copy[name] = val; }
- else if (prev != val) { throw new Error("Inconsistent bindings for " + name) }
- }
- delete keymap[keyname];
- } }
- for (var prop in copy) { keymap[prop] = copy[prop]; }
- return keymap
- }
- function lookupKey(key, map, handle, context) {
- map = getKeyMap(map);
- var found = map.call ? map.call(key, context) : map[key];
- if (found === false) { return "nothing" }
- if (found === "...") { return "multi" }
- if (found != null && handle(found)) { return "handled" }
- if (map.fallthrough) {
- if (Object.prototype.toString.call(map.fallthrough) != "[object Array]")
- { return lookupKey(key, map.fallthrough, handle, context) }
- for (var i = 0; i < map.fallthrough.length; i++) {
- var result = lookupKey(key, map.fallthrough[i], handle, context);
- if (result) { return result }
- }
- }
- }
- // Modifier key presses don't count as 'real' key presses for the
- // purpose of keymap fallthrough.
- function isModifierKey(value) {
- var name = typeof value == "string" ? value : keyNames[value.keyCode];
- return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"
- }
- function addModifierNames(name, event, noShift) {
- var base = name;
- if (event.altKey && base != "Alt") { name = "Alt-" + name; }
- if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; }
- if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Mod") { name = "Cmd-" + name; }
- if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name; }
- return name
- }
- // Look up the name of a key as indicated by an event object.
- function keyName(event, noShift) {
- if (presto && event.keyCode == 34 && event["char"]) { return false }
- var name = keyNames[event.keyCode];
- if (name == null || event.altGraphKey) { return false }
- // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,
- // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)
- if (event.keyCode == 3 && event.code) { name = event.code; }
- return addModifierNames(name, event, noShift)
- }
- function getKeyMap(val) {
- return typeof val == "string" ? keyMap[val] : val
- }
- // Helper for deleting text near the selection(s), used to implement
- // backspace, delete, and similar functionality.
- function deleteNearSelection(cm, compute) {
- var ranges = cm.doc.sel.ranges, kill = [];
- // Build up a set of ranges to kill first, merging overlapping
- // ranges.
- for (var i = 0; i < ranges.length; i++) {
- var toKill = compute(ranges[i]);
- while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {
- var replaced = kill.pop();
- if (cmp(replaced.from, toKill.from) < 0) {
- toKill.from = replaced.from;
- break
- }
- }
- kill.push(toKill);
- }
- // Next, remove those actual ranges.
- runInOp(cm, function () {
- for (var i = kill.length - 1; i >= 0; i--)
- { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); }
- ensureCursorVisible(cm);
- });
- }
- function moveCharLogically(line, ch, dir) {
- var target = skipExtendingChars(line.text, ch + dir, dir);
- return target < 0 || target > line.text.length ? null : target
- }
- function moveLogically(line, start, dir) {
- var ch = moveCharLogically(line, start.ch, dir);
- return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before")
- }
- function endOfLine(visually, cm, lineObj, lineNo, dir) {
- if (visually) {
- if (cm.doc.direction == "rtl") { dir = -dir; }
- var order = getOrder(lineObj, cm.doc.direction);
- if (order) {
- var part = dir < 0 ? lst(order) : order[0];
- var moveInStorageOrder = (dir < 0) == (part.level == 1);
- var sticky = moveInStorageOrder ? "after" : "before";
- var ch;
- // With a wrapped rtl chunk (possibly spanning multiple bidi parts),
- // it could be that the last bidi part is not on the last visual line,
- // since visual lines contain content order-consecutive chunks.
- // Thus, in rtl, we are looking for the first (content-order) character
- // in the rtl chunk that is on the last line (that is, the same line
- // as the last (content-order) character).
- if (part.level > 0 || cm.doc.direction == "rtl") {
- var prep = prepareMeasureForLine(cm, lineObj);
- ch = dir < 0 ? lineObj.text.length - 1 : 0;
- var targetTop = measureCharPrepared(cm, prep, ch).top;
- ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);
- if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1); }
- } else { ch = dir < 0 ? part.to : part.from; }
- return new Pos(lineNo, ch, sticky)
- }
- }
- return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after")
- }
- function moveVisually(cm, line, start, dir) {
- var bidi = getOrder(line, cm.doc.direction);
- if (!bidi) { return moveLogically(line, start, dir) }
- if (start.ch >= line.text.length) {
- start.ch = line.text.length;
- start.sticky = "before";
- } else if (start.ch <= 0) {
- start.ch = 0;
- start.sticky = "after";
- }
- var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];
- if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {
- // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,
- // nothing interesting happens.
- return moveLogically(line, start, dir)
- }
- var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };
- var prep;
- var getWrappedLineExtent = function (ch) {
- if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }
- prep = prep || prepareMeasureForLine(cm, line);
- return wrappedLineExtentChar(cm, line, prep, ch)
- };
- var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch);
- if (cm.doc.direction == "rtl" || part.level == 1) {
- var moveInStorageOrder = (part.level == 1) == (dir < 0);
- var ch = mv(start, moveInStorageOrder ? 1 : -1);
- if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {
- // Case 2: We move within an rtl part or in an rtl editor on the same visual line
- var sticky = moveInStorageOrder ? "before" : "after";
- return new Pos(start.line, ch, sticky)
- }
- }
- // Case 3: Could not move within this bidi part in this visual line, so leave
- // the current bidi part
- var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {
- var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder
- ? new Pos(start.line, mv(ch, 1), "before")
- : new Pos(start.line, ch, "after"); };
- for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {
- var part = bidi[partPos];
- var moveInStorageOrder = (dir > 0) == (part.level != 1);
- var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);
- if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }
- ch = moveInStorageOrder ? part.from : mv(part.to, -1);
- if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }
- }
- };
- // Case 3a: Look for other bidi parts on the same visual line
- var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);
- if (res) { return res }
- // Case 3b: Look for other bidi parts on the next visual line
- var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);
- if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {
- res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));
- if (res) { return res }
- }
- // Case 4: Nowhere to move
- return null
- }
- // Commands are parameter-less actions that can be performed on an
- // editor, mostly used for keybindings.
- var commands = {
- selectAll: selectAll,
- singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); },
- killLine: function (cm) { return deleteNearSelection(cm, function (range) {
- if (range.empty()) {
- var len = getLine(cm.doc, range.head.line).text.length;
- if (range.head.ch == len && range.head.line < cm.lastLine())
- { return {from: range.head, to: Pos(range.head.line + 1, 0)} }
- else
- { return {from: range.head, to: Pos(range.head.line, len)} }
- } else {
- return {from: range.from(), to: range.to()}
- }
- }); },
- deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({
- from: Pos(range.from().line, 0),
- to: clipPos(cm.doc, Pos(range.to().line + 1, 0))
- }); }); },
- delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({
- from: Pos(range.from().line, 0), to: range.from()
- }); }); },
- delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {
- var top = cm.charCoords(range.head, "div").top + 5;
- var leftPos = cm.coordsChar({left: 0, top: top}, "div");
- return {from: leftPos, to: range.from()}
- }); },
- delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {
- var top = cm.charCoords(range.head, "div").top + 5;
- var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div");
- return {from: range.from(), to: rightPos }
- }); },
- undo: function (cm) { return cm.undo(); },
- redo: function (cm) { return cm.redo(); },
- undoSelection: function (cm) { return cm.undoSelection(); },
- redoSelection: function (cm) { return cm.redoSelection(); },
- goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },
- goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },
- goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },
- {origin: "+move", bias: 1}
- ); },
- goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },
- {origin: "+move", bias: 1}
- ); },
- goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },
- {origin: "+move", bias: -1}
- ); },
- goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {
- var top = cm.cursorCoords(range.head, "div").top + 5;
- return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
- }, sel_move); },
- goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {
- var top = cm.cursorCoords(range.head, "div").top + 5;
- return cm.coordsChar({left: 0, top: top}, "div")
- }, sel_move); },
- goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {
- var top = cm.cursorCoords(range.head, "div").top + 5;
- var pos = cm.coordsChar({left: 0, top: top}, "div");
- if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) }
- return pos
- }, sel_move); },
- goLineUp: function (cm) { return cm.moveV(-1, "line"); },
- goLineDown: function (cm) { return cm.moveV(1, "line"); },
- goPageUp: function (cm) { return cm.moveV(-1, "page"); },
- goPageDown: function (cm) { return cm.moveV(1, "page"); },
- goCharLeft: function (cm) { return cm.moveH(-1, "char"); },
- goCharRight: function (cm) { return cm.moveH(1, "char"); },
- goColumnLeft: function (cm) { return cm.moveH(-1, "column"); },
- goColumnRight: function (cm) { return cm.moveH(1, "column"); },
- goWordLeft: function (cm) { return cm.moveH(-1, "word"); },
- goGroupRight: function (cm) { return cm.moveH(1, "group"); },
- goGroupLeft: function (cm) { return cm.moveH(-1, "group"); },
- goWordRight: function (cm) { return cm.moveH(1, "word"); },
- delCharBefore: function (cm) { return cm.deleteH(-1, "codepoint"); },
- delCharAfter: function (cm) { return cm.deleteH(1, "char"); },
- delWordBefore: function (cm) { return cm.deleteH(-1, "word"); },
- delWordAfter: function (cm) { return cm.deleteH(1, "word"); },
- delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); },
- delGroupAfter: function (cm) { return cm.deleteH(1, "group"); },
- indentAuto: function (cm) { return cm.indentSelection("smart"); },
- indentMore: function (cm) { return cm.indentSelection("add"); },
- indentLess: function (cm) { return cm.indentSelection("subtract"); },
- insertTab: function (cm) { return cm.replaceSelection("\t"); },
- insertSoftTab: function (cm) {
- var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;
- for (var i = 0; i < ranges.length; i++) {
- var pos = ranges[i].from();
- var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);
- spaces.push(spaceStr(tabSize - col % tabSize));
- }
- cm.replaceSelections(spaces);
- },
- defaultTab: function (cm) {
- if (cm.somethingSelected()) { cm.indentSelection("add"); }
- else { cm.execCommand("insertTab"); }
- },
- // Swap the two chars left and right of each selection's head.
- // Move cursor behind the two swapped characters afterwards.
- //
- // Doesn't consider line feeds a character.
- // Doesn't scan more than one line above to find a character.
- // Doesn't do anything on an empty line.
- // Doesn't do anything with non-empty selections.
- transposeChars: function (cm) { return runInOp(cm, function () {
- var ranges = cm.listSelections(), newSel = [];
- for (var i = 0; i < ranges.length; i++) {
- if (!ranges[i].empty()) { continue }
- var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;
- if (line) {
- if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }
- if (cur.ch > 0) {
- cur = new Pos(cur.line, cur.ch + 1);
- cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),
- Pos(cur.line, cur.ch - 2), cur, "+transpose");
- } else if (cur.line > cm.doc.first) {
- var prev = getLine(cm.doc, cur.line - 1).text;
- if (prev) {
- cur = new Pos(cur.line, 1);
- cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +
- prev.charAt(prev.length - 1),
- Pos(cur.line - 1, prev.length - 1), cur, "+transpose");
- }
- }
- }
- newSel.push(new Range(cur, cur));
- }
- cm.setSelections(newSel);
- }); },
- newlineAndIndent: function (cm) { return runInOp(cm, function () {
- var sels = cm.listSelections();
- for (var i = sels.length - 1; i >= 0; i--)
- { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input"); }
- sels = cm.listSelections();
- for (var i$1 = 0; i$1 < sels.length; i$1++)
- { cm.indentLine(sels[i$1].from().line, null, true); }
- ensureCursorVisible(cm);
- }); },
- openLine: function (cm) { return cm.replaceSelection("\n", "start"); },
- toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }
- };
- function lineStart(cm, lineN) {
- var line = getLine(cm.doc, lineN);
- var visual = visualLine(line);
- if (visual != line) { lineN = lineNo(visual); }
- return endOfLine(true, cm, visual, lineN, 1)
- }
- function lineEnd(cm, lineN) {
- var line = getLine(cm.doc, lineN);
- var visual = visualLineEnd(line);
- if (visual != line) { lineN = lineNo(visual); }
- return endOfLine(true, cm, line, lineN, -1)
- }
- function lineStartSmart(cm, pos) {
- var start = lineStart(cm, pos.line);
- var line = getLine(cm.doc, start.line);
- var order = getOrder(line, cm.doc.direction);
- if (!order || order[0].level == 0) {
- var firstNonWS = Math.max(start.ch, line.text.search(/\S/));
- var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;
- return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
- }
- return start
- }
- // Run a handler that was bound to a key.
- function doHandleBinding(cm, bound, dropShift) {
- if (typeof bound == "string") {
- bound = commands[bound];
- if (!bound) { return false }
- }
- // Ensure previous input has been read, so that the handler sees a
- // consistent view of the document
- cm.display.input.ensurePolled();
- var prevShift = cm.display.shift, done = false;
- try {
- if (cm.isReadOnly()) { cm.state.suppressEdits = true; }
- if (dropShift) { cm.display.shift = false; }
- done = bound(cm) != Pass;
- } finally {
- cm.display.shift = prevShift;
- cm.state.suppressEdits = false;
- }
- return done
- }
- function lookupKeyForEditor(cm, name, handle) {
- for (var i = 0; i < cm.state.keyMaps.length; i++) {
- var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);
- if (result) { return result }
- }
- return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))
- || lookupKey(name, cm.options.keyMap, handle, cm)
- }
- // Note that, despite the name, this function is also used to check
- // for bound mouse clicks.
- var stopSeq = new Delayed;
- function dispatchKey(cm, name, e, handle) {
- var seq = cm.state.keySeq;
- if (seq) {
- if (isModifierKey(name)) { return "handled" }
- if (/\'$/.test(name))
- { cm.state.keySeq = null; }
- else
- { stopSeq.set(50, function () {
- if (cm.state.keySeq == seq) {
- cm.state.keySeq = null;
- cm.display.input.reset();
- }
- }); }
- if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true }
- }
- return dispatchKeyInner(cm, name, e, handle)
- }
- function dispatchKeyInner(cm, name, e, handle) {
- var result = lookupKeyForEditor(cm, name, handle);
- if (result == "multi")
- { cm.state.keySeq = name; }
- if (result == "handled")
- { signalLater(cm, "keyHandled", cm, name, e); }
- if (result == "handled" || result == "multi") {
- e_preventDefault(e);
- restartBlink(cm);
- }
- return !!result
- }
- // Handle a key from the keydown event.
- function handleKeyBinding(cm, e) {
- var name = keyName(e, true);
- if (!name) { return false }
- if (e.shiftKey && !cm.state.keySeq) {
- // First try to resolve full name (including 'Shift-'). Failing
- // that, see if there is a cursor-motion command (starting with
- // 'go') bound to the keyname without 'Shift-'.
- return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); })
- || dispatchKey(cm, name, e, function (b) {
- if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
- { return doHandleBinding(cm, b) }
- })
- } else {
- return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })
- }
- }
- // Handle a key from the keypress event
- function handleCharBinding(cm, e, ch) {
- return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); })
- }
- var lastStoppedKey = null;
- function onKeyDown(e) {
- var cm = this;
- if (e.target && e.target != cm.display.input.getField()) { return }
- cm.curOp.focus = activeElt();
- if (signalDOMEvent(cm, e)) { return }
- // IE does strange things with escape.
- if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }
- var code = e.keyCode;
- cm.display.shift = code == 16 || e.shiftKey;
- var handled = handleKeyBinding(cm, e);
- if (presto) {
- lastStoppedKey = handled ? code : null;
- // Opera has no cut event... we try to at least catch the key combo
- if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
- { cm.replaceSelection("", null, "cut"); }
- }
- if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)
- { document.execCommand("cut"); }
- // Turn mouse into crosshair when Alt is held on Mac.
- if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
- { showCrossHair(cm); }
- }
- function showCrossHair(cm) {
- var lineDiv = cm.display.lineDiv;
- addClass(lineDiv, "CodeMirror-crosshair");
- function up(e) {
- if (e.keyCode == 18 || !e.altKey) {
- rmClass(lineDiv, "CodeMirror-crosshair");
- off(document, "keyup", up);
- off(document, "mouseover", up);
- }
- }
- on(document, "keyup", up);
- on(document, "mouseover", up);
- }
- function onKeyUp(e) {
- if (e.keyCode == 16) { this.doc.sel.shift = false; }
- signalDOMEvent(this, e);
- }
- function onKeyPress(e) {
- var cm = this;
- if (e.target && e.target != cm.display.input.getField()) { return }
- if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }
- var keyCode = e.keyCode, charCode = e.charCode;
- if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}
- if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }
- var ch = String.fromCharCode(charCode == null ? keyCode : charCode);
- // Some browsers fire keypress events for backspace
- if (ch == "\x08") { return }
- if (handleCharBinding(cm, e, ch)) { return }
- cm.display.input.onKeyPress(e);
- }
- var DOUBLECLICK_DELAY = 400;
- var PastClick = function(time, pos, button) {
- this.time = time;
- this.pos = pos;
- this.button = button;
- };
- PastClick.prototype.compare = function (time, pos, button) {
- return this.time + DOUBLECLICK_DELAY > time &&
- cmp(pos, this.pos) == 0 && button == this.button
- };
- var lastClick, lastDoubleClick;
- function clickRepeat(pos, button) {
- var now = +new Date;
- if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {
- lastClick = lastDoubleClick = null;
- return "triple"
- } else if (lastClick && lastClick.compare(now, pos, button)) {
- lastDoubleClick = new PastClick(now, pos, button);
- lastClick = null;
- return "double"
- } else {
- lastClick = new PastClick(now, pos, button);
- lastDoubleClick = null;
- return "single"
- }
- }
- // A mouse down can be a single click, double click, triple click,
- // start of selection drag, start of text drag, new cursor
- // (ctrl-click), rectangle drag (alt-drag), or xwin
- // middle-click-paste. Or it might be a click on something we should
- // not interfere with, such as a scrollbar or widget.
- function onMouseDown(e) {
- var cm = this, display = cm.display;
- if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }
- display.input.ensurePolled();
- display.shift = e.shiftKey;
- if (eventInWidget(display, e)) {
- if (!webkit) {
- // Briefly turn off draggability, to allow widgets to do
- // normal dragging things.
- display.scroller.draggable = false;
- setTimeout(function () { return display.scroller.draggable = true; }, 100);
- }
- return
- }
- if (clickInGutter(cm, e)) { return }
- var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single";
- window.focus();
- // #3261: make sure, that we're not starting a second selection
- if (button == 1 && cm.state.selectingText)
- { cm.state.selectingText(e); }
- if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }
- if (button == 1) {
- if (pos) { leftButtonDown(cm, pos, repeat, e); }
- else if (e_target(e) == display.scroller) { e_preventDefault(e); }
- } else if (button == 2) {
- if (pos) { extendSelection(cm.doc, pos); }
- setTimeout(function () { return display.input.focus(); }, 20);
- } else if (button == 3) {
- if (captureRightClick) { cm.display.input.onContextMenu(e); }
- else { delayBlurEvent(cm); }
- }
- }
- function handleMappedButton(cm, button, pos, repeat, event) {
- var name = "Click";
- if (repeat == "double") { name = "Double" + name; }
- else if (repeat == "triple") { name = "Triple" + name; }
- name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name;
- return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {
- if (typeof bound == "string") { bound = commands[bound]; }
- if (!bound) { return false }
- var done = false;
- try {
- if (cm.isReadOnly()) { cm.state.suppressEdits = true; }
- done = bound(cm, pos) != Pass;
- } finally {
- cm.state.suppressEdits = false;
- }
- return done
- })
- }
- function configureMouse(cm, repeat, event) {
- var option = cm.getOption("configureMouse");
- var value = option ? option(cm, repeat, event) : {};
- if (value.unit == null) {
- var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;
- value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line";
- }
- if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }
- if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }
- if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }
- return value
- }
- function leftButtonDown(cm, pos, repeat, event) {
- if (ie) { setTimeout(bind(ensureFocus, cm), 0); }
- else { cm.curOp.focus = activeElt(); }
- var behavior = configureMouse(cm, repeat, event);
- var sel = cm.doc.sel, contained;
- if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
- repeat == "single" && (contained = sel.contains(pos)) > -1 &&
- (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&
- (cmp(contained.to(), pos) > 0 || pos.xRel < 0))
- { leftButtonStartDrag(cm, event, pos, behavior); }
- else
- { leftButtonSelect(cm, event, pos, behavior); }
- }
- // Start a text drag. When it ends, see if any dragging actually
- // happen, and treat as a click if it didn't.
- function leftButtonStartDrag(cm, event, pos, behavior) {
- var display = cm.display, moved = false;
- var dragEnd = operation(cm, function (e) {
- if (webkit) { display.scroller.draggable = false; }
- cm.state.draggingText = false;
- if (cm.state.delayingBlurEvent) {
- if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }
- else { delayBlurEvent(cm); }
- }
- off(display.wrapper.ownerDocument, "mouseup", dragEnd);
- off(display.wrapper.ownerDocument, "mousemove", mouseMove);
- off(display.scroller, "dragstart", dragStart);
- off(display.scroller, "drop", dragEnd);
- if (!moved) {
- e_preventDefault(e);
- if (!behavior.addNew)
- { extendSelection(cm.doc, pos, null, null, behavior.extend); }
- // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
- if ((webkit && !safari) || ie && ie_version == 9)
- { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }
- else
- { display.input.focus(); }
- }
- });
- var mouseMove = function(e2) {
- moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;
- };
- var dragStart = function () { return moved = true; };
- // Let the drag handler handle this.
- if (webkit) { display.scroller.draggable = true; }
- cm.state.draggingText = dragEnd;
- dragEnd.copy = !behavior.moveOnDrag;
- on(display.wrapper.ownerDocument, "mouseup", dragEnd);
- on(display.wrapper.ownerDocument, "mousemove", mouseMove);
- on(display.scroller, "dragstart", dragStart);
- on(display.scroller, "drop", dragEnd);
- cm.state.delayingBlurEvent = true;
- setTimeout(function () { return display.input.focus(); }, 20);
- // IE's approach to draggable
- if (display.scroller.dragDrop) { display.scroller.dragDrop(); }
- }
- function rangeForUnit(cm, pos, unit) {
- if (unit == "char") { return new Range(pos, pos) }
- if (unit == "word") { return cm.findWordAt(pos) }
- if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }
- var result = unit(cm, pos);
- return new Range(result.from, result.to)
- }
- // Normal selection, as opposed to text dragging.
- function leftButtonSelect(cm, event, start, behavior) {
- if (ie) { delayBlurEvent(cm); }
- var display = cm.display, doc = cm.doc;
- e_preventDefault(event);
- var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;
- if (behavior.addNew && !behavior.extend) {
- ourIndex = doc.sel.contains(start);
- if (ourIndex > -1)
- { ourRange = ranges[ourIndex]; }
- else
- { ourRange = new Range(start, start); }
- } else {
- ourRange = doc.sel.primary();
- ourIndex = doc.sel.primIndex;
- }
- if (behavior.unit == "rectangle") {
- if (!behavior.addNew) { ourRange = new Range(start, start); }
- start = posFromMouse(cm, event, true, true);
- ourIndex = -1;
- } else {
- var range = rangeForUnit(cm, start, behavior.unit);
- if (behavior.extend)
- { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }
- else
- { ourRange = range; }
- }
- if (!behavior.addNew) {
- ourIndex = 0;
- setSelection(doc, new Selection([ourRange], 0), sel_mouse);
- startSel = doc.sel;
- } else if (ourIndex == -1) {
- ourIndex = ranges.length;
- setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),
- {scroll: false, origin: "*mouse"});
- } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) {
- setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
- {scroll: false, origin: "*mouse"});
- startSel = doc.sel;
- } else {
- replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);
- }
- var lastPos = start;
- function extendTo(pos) {
- if (cmp(lastPos, pos) == 0) { return }
- lastPos = pos;
- if (behavior.unit == "rectangle") {
- var ranges = [], tabSize = cm.options.tabSize;
- var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);
- var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);
- var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);
- for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));
- line <= end; line++) {
- var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);
- if (left == right)
- { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }
- else if (text.length > leftPos)
- { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }
- }
- if (!ranges.length) { ranges.push(new Range(start, start)); }
- setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
- {origin: "*mouse", scroll: false});
- cm.scrollIntoView(pos);
- } else {
- var oldRange = ourRange;
- var range = rangeForUnit(cm, pos, behavior.unit);
- var anchor = oldRange.anchor, head;
- if (cmp(range.anchor, anchor) > 0) {
- head = range.head;
- anchor = minPos(oldRange.from(), range.anchor);
- } else {
- head = range.anchor;
- anchor = maxPos(oldRange.to(), range.head);
- }
- var ranges$1 = startSel.ranges.slice(0);
- ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));
- setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);
- }
- }
- var editorSize = display.wrapper.getBoundingClientRect();
- // Used to ensure timeout re-tries don't fire when another extend
- // happened in the meantime (clearTimeout isn't reliable -- at
- // least on Chrome, the timeouts still happen even when cleared,
- // if the clear happens after their scheduled firing time).
- var counter = 0;
- function extend(e) {
- var curCount = ++counter;
- var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle");
- if (!cur) { return }
- if (cmp(cur, lastPos) != 0) {
- cm.curOp.focus = activeElt();
- extendTo(cur);
- var visible = visibleLines(display, doc);
- if (cur.line >= visible.to || cur.line < visible.from)
- { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }
- } else {
- var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
- if (outside) { setTimeout(operation(cm, function () {
- if (counter != curCount) { return }
- display.scroller.scrollTop += outside;
- extend(e);
- }), 50); }
- }
- }
- function done(e) {
- cm.state.selectingText = false;
- counter = Infinity;
- // If e is null or undefined we interpret this as someone trying
- // to explicitly cancel the selection rather than the user
- // letting go of the mouse button.
- if (e) {
- e_preventDefault(e);
- display.input.focus();
- }
- off(display.wrapper.ownerDocument, "mousemove", move);
- off(display.wrapper.ownerDocument, "mouseup", up);
- doc.history.lastSelOrigin = null;
- }
- var move = operation(cm, function (e) {
- if (e.buttons === 0 || !e_button(e)) { done(e); }
- else { extend(e); }
- });
- var up = operation(cm, done);
- cm.state.selectingText = up;
- on(display.wrapper.ownerDocument, "mousemove", move);
- on(display.wrapper.ownerDocument, "mouseup", up);
- }
- // Used when mouse-selecting to adjust the anchor to the proper side
- // of a bidi jump depending on the visual position of the head.
- function bidiSimplify(cm, range) {
- var anchor = range.anchor;
- var head = range.head;
- var anchorLine = getLine(cm.doc, anchor.line);
- if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }
- var order = getOrder(anchorLine);
- if (!order) { return range }
- var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];
- if (part.from != anchor.ch && part.to != anchor.ch) { return range }
- var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);
- if (boundary == 0 || boundary == order.length) { return range }
- // Compute the relative visual position of the head compared to the
- // anchor (<0 is to the left, >0 to the right)
- var leftSide;
- if (head.line != anchor.line) {
- leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0;
- } else {
- var headIndex = getBidiPartAt(order, head.ch, head.sticky);
- var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);
- if (headIndex == boundary - 1 || headIndex == boundary)
- { leftSide = dir < 0; }
- else
- { leftSide = dir > 0; }
- }
- var usePart = order[boundary + (leftSide ? -1 : 0)];
- var from = leftSide == (usePart.level == 1);
- var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before";
- return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)
- }
- // Determines whether an event happened in the gutter, and fires the
- // handlers for the corresponding event.
- function gutterEvent(cm, e, type, prevent) {
- var mX, mY;
- if (e.touches) {
- mX = e.touches[0].clientX;
- mY = e.touches[0].clientY;
- } else {
- try { mX = e.clientX; mY = e.clientY; }
- catch(e$1) { return false }
- }
- if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }
- if (prevent) { e_preventDefault(e); }
- var display = cm.display;
- var lineBox = display.lineDiv.getBoundingClientRect();
- if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }
- mY -= lineBox.top - display.viewOffset;
- for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {
- var g = display.gutters.childNodes[i];
- if (g && g.getBoundingClientRect().right >= mX) {
- var line = lineAtHeight(cm.doc, mY);
- var gutter = cm.display.gutterSpecs[i];
- signal(cm, type, cm, line, gutter.className, e);
- return e_defaultPrevented(e)
- }
- }
- }
- function clickInGutter(cm, e) {
- return gutterEvent(cm, e, "gutterClick", true)
- }
- // CONTEXT MENU HANDLING
- // To make the context menu work, we need to briefly unhide the
- // textarea (making it as unobtrusive as possible) to let the
- // right-click take effect on it.
- function onContextMenu(cm, e) {
- if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }
- if (signalDOMEvent(cm, e, "contextmenu")) { return }
- if (!captureRightClick) { cm.display.input.onContextMenu(e); }
- }
- function contextMenuInGutter(cm, e) {
- if (!hasHandler(cm, "gutterContextMenu")) { return false }
- return gutterEvent(cm, e, "gutterContextMenu", false)
- }
- function themeChanged(cm) {
- cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
- cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-");
- clearCaches(cm);
- }
- var Init = {toString: function(){return "CodeMirror.Init"}};
- var defaults = {};
- var optionHandlers = {};
- function defineOptions(CodeMirror) {
- var optionHandlers = CodeMirror.optionHandlers;
- function option(name, deflt, handle, notOnInit) {
- CodeMirror.defaults[name] = deflt;
- if (handle) { optionHandlers[name] =
- notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }
- }
- CodeMirror.defineOption = option;
- // Passed to option handlers when there is no old value.
- CodeMirror.Init = Init;
- // These two are, on init, called from the constructor because they
- // have to be initialized before the editor can start at all.
- option("value", "", function (cm, val) { return cm.setValue(val); }, true);
- option("mode", null, function (cm, val) {
- cm.doc.modeOption = val;
- loadMode(cm);
- }, true);
- option("indentUnit", 2, loadMode, true);
- option("indentWithTabs", false);
- option("smartIndent", true);
- option("tabSize", 4, function (cm) {
- resetModeState(cm);
- clearCaches(cm);
- regChange(cm);
- }, true);
- option("lineSeparator", null, function (cm, val) {
- cm.doc.lineSep = val;
- if (!val) { return }
- var newBreaks = [], lineNo = cm.doc.first;
- cm.doc.iter(function (line) {
- for (var pos = 0;;) {
- var found = line.text.indexOf(val, pos);
- if (found == -1) { break }
- pos = found + val.length;
- newBreaks.push(Pos(lineNo, found));
- }
- lineNo++;
- });
- for (var i = newBreaks.length - 1; i >= 0; i--)
- { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }
- });
- option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) {
- cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
- if (old != Init) { cm.refresh(); }
- });
- option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);
- option("electricChars", true);
- option("inputStyle", mobile ? "contenteditable" : "textarea", function () {
- throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME
- }, true);
- option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);
- option("autocorrect", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);
- option("autocapitalize", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);
- option("rtlMoveVisually", !windows);
- option("wholeLineUpdateBefore", true);
- option("theme", "default", function (cm) {
- themeChanged(cm);
- updateGutters(cm);
- }, true);
- option("keyMap", "default", function (cm, val, old) {
- var next = getKeyMap(val);
- var prev = old != Init && getKeyMap(old);
- if (prev && prev.detach) { prev.detach(cm, next); }
- if (next.attach) { next.attach(cm, prev || null); }
- });
- option("extraKeys", null);
- option("configureMouse", null);
- option("lineWrapping", false, wrappingChanged, true);
- option("gutters", [], function (cm, val) {
- cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);
- updateGutters(cm);
- }, true);
- option("fixedGutter", true, function (cm, val) {
- cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0";
- cm.refresh();
- }, true);
- option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true);
- option("scrollbarStyle", "native", function (cm) {
- initScrollbars(cm);
- updateScrollbars(cm);
- cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);
- cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);
- }, true);
- option("lineNumbers", false, function (cm, val) {
- cm.display.gutterSpecs = getGutters(cm.options.gutters, val);
- updateGutters(cm);
- }, true);
- option("firstLineNumber", 1, updateGutters, true);
- option("lineNumberFormatter", function (integer) { return integer; }, updateGutters, true);
- option("showCursorWhenSelecting", false, updateSelection, true);
- option("resetSelectionOnContextMenu", true);
- option("lineWiseCopyCut", true);
- option("pasteLinesPerSelection", true);
- option("selectionsMayTouch", false);
- option("readOnly", false, function (cm, val) {
- if (val == "nocursor") {
- onBlur(cm);
- cm.display.input.blur();
- }
- cm.display.input.readOnlyChanged(val);
- });
- option("screenReaderLabel", null, function (cm, val) {
- val = (val === '') ? null : val;
- cm.display.input.screenReaderLabelChanged(val);
- });
- option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);
- option("dragDrop", true, dragDropChanged);
- option("allowDropFileTypes", null);
- option("cursorBlinkRate", 530);
- option("cursorScrollMargin", 0);
- option("cursorHeight", 1, updateSelection, true);
- option("singleCursorHeightPerLine", true, updateSelection, true);
- option("workTime", 100);
- option("workDelay", 100);
- option("flattenSpans", true, resetModeState, true);
- option("addModeClass", false, resetModeState, true);
- option("pollInterval", 100);
- option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });
- option("historyEventDelay", 1250);
- option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true);
- option("maxHighlightLength", 10000, resetModeState, true);
- option("moveInputWithCursor", true, function (cm, val) {
- if (!val) { cm.display.input.resetPosition(); }
- });
- option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; });
- option("autofocus", null);
- option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true);
- option("phrases", null);
- }
- function dragDropChanged(cm, value, old) {
- var wasOn = old && old != Init;
- if (!value != !wasOn) {
- var funcs = cm.display.dragFunctions;
- var toggle = value ? on : off;
- toggle(cm.display.scroller, "dragstart", funcs.start);
- toggle(cm.display.scroller, "dragenter", funcs.enter);
- toggle(cm.display.scroller, "dragover", funcs.over);
- toggle(cm.display.scroller, "dragleave", funcs.leave);
- toggle(cm.display.scroller, "drop", funcs.drop);
- }
- }
- function wrappingChanged(cm) {
- if (cm.options.lineWrapping) {
- addClass(cm.display.wrapper, "CodeMirror-wrap");
- cm.display.sizer.style.minWidth = "";
- cm.display.sizerWidth = null;
- } else {
- rmClass(cm.display.wrapper, "CodeMirror-wrap");
- findMaxLine(cm);
- }
- estimateLineHeights(cm);
- regChange(cm);
- clearCaches(cm);
- setTimeout(function () { return updateScrollbars(cm); }, 100);
- }
- // A CodeMirror instance represents an editor. This is the object
- // that user code is usually dealing with.
- function CodeMirror(place, options) {
- var this$1 = this;
- if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }
- this.options = options = options ? copyObj(options) : {};
- // Determine effective options based on given values and defaults.
- copyObj(defaults, options, false);
- var doc = options.value;
- if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }
- else if (options.mode) { doc.modeOption = options.mode; }
- this.doc = doc;
- var input = new CodeMirror.inputStyles[options.inputStyle](this);
- var display = this.display = new Display(place, doc, input, options);
- display.wrapper.CodeMirror = this;
- themeChanged(this);
- if (options.lineWrapping)
- { this.display.wrapper.className += " CodeMirror-wrap"; }
- initScrollbars(this);
- this.state = {
- keyMaps: [], // stores maps added by addKeyMap
- overlays: [], // highlighting overlays, as added by addOverlay
- modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info
- overwrite: false,
- delayingBlurEvent: false,
- focused: false,
- suppressEdits: false, // used to disable editing during key handlers when in readOnly mode
- pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll
- selectingText: false,
- draggingText: false,
- highlight: new Delayed(), // stores highlight worker timeout
- keySeq: null, // Unfinished key sequence
- specialChars: null
- };
- if (options.autofocus && !mobile) { display.input.focus(); }
- // Override magic textarea content restore that IE sometimes does
- // on our hidden textarea on reload
- if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }
- registerEventHandlers(this);
- ensureGlobalHandlers();
- startOperation(this);
- this.curOp.forceUpdate = true;
- attachDoc(this, doc);
- if ((options.autofocus && !mobile) || this.hasFocus())
- { setTimeout(function () {
- if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }
- }, 20); }
- else
- { onBlur(this); }
- for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))
- { optionHandlers[opt](this, options[opt], Init); } }
- maybeUpdateLineNumberWidth(this);
- if (options.finishInit) { options.finishInit(this); }
- for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }
- endOperation(this);
- // Suppress optimizelegibility in Webkit, since it breaks text
- // measuring on line wrapping boundaries.
- if (webkit && options.lineWrapping &&
- getComputedStyle(display.lineDiv).textRendering == "optimizelegibility")
- { display.lineDiv.style.textRendering = "auto"; }
- }
- // The default configuration options.
- CodeMirror.defaults = defaults;
- // Functions to run when options are changed.
- CodeMirror.optionHandlers = optionHandlers;
- // Attach the necessary event handlers when initializing the editor
- function registerEventHandlers(cm) {
- var d = cm.display;
- on(d.scroller, "mousedown", operation(cm, onMouseDown));
- // Older IE's will not fire a second mousedown for a double click
- if (ie && ie_version < 11)
- { on(d.scroller, "dblclick", operation(cm, function (e) {
- if (signalDOMEvent(cm, e)) { return }
- var pos = posFromMouse(cm, e);
- if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }
- e_preventDefault(e);
- var word = cm.findWordAt(pos);
- extendSelection(cm.doc, word.anchor, word.head);
- })); }
- else
- { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }
- // Some browsers fire contextmenu *after* opening the menu, at
- // which point we can't mess with it anymore. Context menu is
- // handled in onMouseDown for these browsers.
- on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); });
- on(d.input.getField(), "contextmenu", function (e) {
- if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }
- });
- // Used to suppress mouse event handling when a touch happens
- var touchFinished, prevTouch = {end: 0};
- function finishTouch() {
- if (d.activeTouch) {
- touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);
- prevTouch = d.activeTouch;
- prevTouch.end = +new Date;
- }
- }
- function isMouseLikeTouchEvent(e) {
- if (e.touches.length != 1) { return false }
- var touch = e.touches[0];
- return touch.radiusX <= 1 && touch.radiusY <= 1
- }
- function farAway(touch, other) {
- if (other.left == null) { return true }
- var dx = other.left - touch.left, dy = other.top - touch.top;
- return dx * dx + dy * dy > 20 * 20
- }
- on(d.scroller, "touchstart", function (e) {
- if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {
- d.input.ensurePolled();
- clearTimeout(touchFinished);
- var now = +new Date;
- d.activeTouch = {start: now, moved: false,
- prev: now - prevTouch.end <= 300 ? prevTouch : null};
- if (e.touches.length == 1) {
- d.activeTouch.left = e.touches[0].pageX;
- d.activeTouch.top = e.touches[0].pageY;
- }
- }
- });
- on(d.scroller, "touchmove", function () {
- if (d.activeTouch) { d.activeTouch.moved = true; }
- });
- on(d.scroller, "touchend", function (e) {
- var touch = d.activeTouch;
- if (touch && !eventInWidget(d, e) && touch.left != null &&
- !touch.moved && new Date - touch.start < 300) {
- var pos = cm.coordsChar(d.activeTouch, "page"), range;
- if (!touch.prev || farAway(touch, touch.prev)) // Single tap
- { range = new Range(pos, pos); }
- else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap
- { range = cm.findWordAt(pos); }
- else // Triple tap
- { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }
- cm.setSelection(range.anchor, range.head);
- cm.focus();
- e_preventDefault(e);
- }
- finishTouch();
- });
- on(d.scroller, "touchcancel", finishTouch);
- // Sync scrolling between fake scrollbars and real scrollable
- // area, ensure viewport is updated when scrolling.
- on(d.scroller, "scroll", function () {
- if (d.scroller.clientHeight) {
- updateScrollTop(cm, d.scroller.scrollTop);
- setScrollLeft(cm, d.scroller.scrollLeft, true);
- signal(cm, "scroll", cm);
- }
- });
- // Listen to wheel events in order to try and update the viewport on time.
- on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); });
- on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); });
- // Prevent wrapper from ever scrolling
- on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });
- d.dragFunctions = {
- enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},
- over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},
- start: function (e) { return onDragStart(cm, e); },
- drop: operation(cm, onDrop),
- leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}
- };
- var inp = d.input.getField();
- on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); });
- on(inp, "keydown", operation(cm, onKeyDown));
- on(inp, "keypress", operation(cm, onKeyPress));
- on(inp, "focus", function (e) { return onFocus(cm, e); });
- on(inp, "blur", function (e) { return onBlur(cm, e); });
- }
- var initHooks = [];
- CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };
- // Indent the given line. The how parameter can be "smart",
- // "add"/null, "subtract", or "prev". When aggressive is false
- // (typically set to true for forced single-line indents), empty
- // lines are not indented, and places where the mode returns Pass
- // are left alone.
- function indentLine(cm, n, how, aggressive) {
- var doc = cm.doc, state;
- if (how == null) { how = "add"; }
- if (how == "smart") {
- // Fall back to "prev" when the mode doesn't have an indentation
- // method.
- if (!doc.mode.indent) { how = "prev"; }
- else { state = getContextBefore(cm, n).state; }
- }
- var tabSize = cm.options.tabSize;
- var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);
- if (line.stateAfter) { line.stateAfter = null; }
- var curSpaceString = line.text.match(/^\s*/)[0], indentation;
- if (!aggressive && !/\S/.test(line.text)) {
- indentation = 0;
- how = "not";
- } else if (how == "smart") {
- indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);
- if (indentation == Pass || indentation > 150) {
- if (!aggressive) { return }
- how = "prev";
- }
- }
- if (how == "prev") {
- if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }
- else { indentation = 0; }
- } else if (how == "add") {
- indentation = curSpace + cm.options.indentUnit;
- } else if (how == "subtract") {
- indentation = curSpace - cm.options.indentUnit;
- } else if (typeof how == "number") {
- indentation = curSpace + how;
- }
- indentation = Math.max(0, indentation);
- var indentString = "", pos = 0;
- if (cm.options.indentWithTabs)
- { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} }
- if (pos < indentation) { indentString += spaceStr(indentation - pos); }
- if (indentString != curSpaceString) {
- replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input");
- line.stateAfter = null;
- return true
- } else {
- // Ensure that, if the cursor was in the whitespace at the start
- // of the line, it is moved to the end of that space.
- for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {
- var range = doc.sel.ranges[i$1];
- if (range.head.line == n && range.head.ch < curSpaceString.length) {
- var pos$1 = Pos(n, curSpaceString.length);
- replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));
- break
- }
- }
- }
- }
- // This will be set to a {lineWise: bool, text: [string]} object, so
- // that, when pasting, we know what kind of selections the copied
- // text was made out of.
- var lastCopied = null;
- function setLastCopied(newLastCopied) {
- lastCopied = newLastCopied;
- }
- function applyTextInput(cm, inserted, deleted, sel, origin) {
- var doc = cm.doc;
- cm.display.shift = false;
- if (!sel) { sel = doc.sel; }
- var recent = +new Date - 200;
- var paste = origin == "paste" || cm.state.pasteIncoming > recent;
- var textLines = splitLinesAuto(inserted), multiPaste = null;
- // When pasting N lines into N selections, insert one line per selection
- if (paste && sel.ranges.length > 1) {
- if (lastCopied && lastCopied.text.join("\n") == inserted) {
- if (sel.ranges.length % lastCopied.text.length == 0) {
- multiPaste = [];
- for (var i = 0; i < lastCopied.text.length; i++)
- { multiPaste.push(doc.splitLines(lastCopied.text[i])); }
- }
- } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {
- multiPaste = map(textLines, function (l) { return [l]; });
- }
- }
- var updateInput = cm.curOp.updateInput;
- // Normal behavior is to insert the new text into every selection
- for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {
- var range = sel.ranges[i$1];
- var from = range.from(), to = range.to();
- if (range.empty()) {
- if (deleted && deleted > 0) // Handle deletion
- { from = Pos(from.line, from.ch - deleted); }
- else if (cm.state.overwrite && !paste) // Handle overwrite
- { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }
- else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n"))
- { from = to = Pos(from.line, 0); }
- }
- var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,
- origin: origin || (paste ? "paste" : cm.state.cutIncoming > recent ? "cut" : "+input")};
- makeChange(cm.doc, changeEvent);
- signalLater(cm, "inputRead", cm, changeEvent);
- }
- if (inserted && !paste)
- { triggerElectric(cm, inserted); }
- ensureCursorVisible(cm);
- if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }
- cm.curOp.typing = true;
- cm.state.pasteIncoming = cm.state.cutIncoming = -1;
- }
- function handlePaste(e, cm) {
- var pasted = e.clipboardData && e.clipboardData.getData("Text");
- if (pasted) {
- e.preventDefault();
- if (!cm.isReadOnly() && !cm.options.disableInput)
- { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }); }
- return true
- }
- }
- function triggerElectric(cm, inserted) {
- // When an 'electric' character is inserted, immediately trigger a reindent
- if (!cm.options.electricChars || !cm.options.smartIndent) { return }
- var sel = cm.doc.sel;
- for (var i = sel.ranges.length - 1; i >= 0; i--) {
- var range = sel.ranges[i];
- if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }
- var mode = cm.getModeAt(range.head);
- var indented = false;
- if (mode.electricChars) {
- for (var j = 0; j < mode.electricChars.length; j++)
- { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
- indented = indentLine(cm, range.head.line, "smart");
- break
- } }
- } else if (mode.electricInput) {
- if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))
- { indented = indentLine(cm, range.head.line, "smart"); }
- }
- if (indented) { signalLater(cm, "electricInput", cm, range.head.line); }
- }
- }
- function copyableRanges(cm) {
- var text = [], ranges = [];
- for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
- var line = cm.doc.sel.ranges[i].head.line;
- var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};
- ranges.push(lineRange);
- text.push(cm.getRange(lineRange.anchor, lineRange.head));
- }
- return {text: text, ranges: ranges}
- }
- function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {
- field.setAttribute("autocorrect", autocorrect ? "" : "off");
- field.setAttribute("autocapitalize", autocapitalize ? "" : "off");
- field.setAttribute("spellcheck", !!spellcheck);
- }
- function hiddenTextarea() {
- var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");
- var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
- // The textarea is kept positioned near the cursor to prevent the
- // fact that it'll be scrolled into view on input from scrolling
- // our fake cursor out of view. On webkit, when wrap=off, paste is
- // very slow. So make the area wide instead.
- if (webkit) { te.style.width = "1000px"; }
- else { te.setAttribute("wrap", "off"); }
- // If border: 0; -- iOS fails to open keyboard (issue #1287)
- if (ios) { te.style.border = "1px solid black"; }
- disableBrowserMagic(te);
- return div
- }
- // The publicly visible API. Note that methodOp(f) means
- // 'wrap f in an operation, performed on its `this` parameter'.
- // This is not the complete set of editor methods. Most of the
- // methods defined on the Doc type are also injected into
- // CodeMirror.prototype, for backwards compatibility and
- // convenience.
- function addEditorMethods(CodeMirror) {
- var optionHandlers = CodeMirror.optionHandlers;
- var helpers = CodeMirror.helpers = {};
- CodeMirror.prototype = {
- constructor: CodeMirror,
- focus: function(){window.focus(); this.display.input.focus();},
- setOption: function(option, value) {
- var options = this.options, old = options[option];
- if (options[option] == value && option != "mode") { return }
- options[option] = value;
- if (optionHandlers.hasOwnProperty(option))
- { operation(this, optionHandlers[option])(this, value, old); }
- signal(this, "optionChange", this, option);
- },
- getOption: function(option) {return this.options[option]},
- getDoc: function() {return this.doc},
- addKeyMap: function(map, bottom) {
- this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map));
- },
- removeKeyMap: function(map) {
- var maps = this.state.keyMaps;
- for (var i = 0; i < maps.length; ++i)
- { if (maps[i] == map || maps[i].name == map) {
- maps.splice(i, 1);
- return true
- } }
- },
- addOverlay: methodOp(function(spec, options) {
- var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);
- if (mode.startState) { throw new Error("Overlays may not be stateful.") }
- insertSorted(this.state.overlays,
- {mode: mode, modeSpec: spec, opaque: options && options.opaque,
- priority: (options && options.priority) || 0},
- function (overlay) { return overlay.priority; });
- this.state.modeGen++;
- regChange(this);
- }),
- removeOverlay: methodOp(function(spec) {
- var overlays = this.state.overlays;
- for (var i = 0; i < overlays.length; ++i) {
- var cur = overlays[i].modeSpec;
- if (cur == spec || typeof spec == "string" && cur.name == spec) {
- overlays.splice(i, 1);
- this.state.modeGen++;
- regChange(this);
- return
- }
- }
- }),
- indentLine: methodOp(function(n, dir, aggressive) {
- if (typeof dir != "string" && typeof dir != "number") {
- if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev"; }
- else { dir = dir ? "add" : "subtract"; }
- }
- if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }
- }),
- indentSelection: methodOp(function(how) {
- var ranges = this.doc.sel.ranges, end = -1;
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i];
- if (!range.empty()) {
- var from = range.from(), to = range.to();
- var start = Math.max(end, from.line);
- end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;
- for (var j = start; j < end; ++j)
- { indentLine(this, j, how); }
- var newRanges = this.doc.sel.ranges;
- if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)
- { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }
- } else if (range.head.line > end) {
- indentLine(this, range.head.line, how, true);
- end = range.head.line;
- if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }
- }
- }
- }),
- // Fetch the parser token for a given character. Useful for hacks
- // that want to inspect the mode state (say, for completion).
- getTokenAt: function(pos, precise) {
- return takeToken(this, pos, precise)
- },
- getLineTokens: function(line, precise) {
- return takeToken(this, Pos(line), precise, true)
- },
- getTokenTypeAt: function(pos) {
- pos = clipPos(this.doc, pos);
- var styles = getLineStyles(this, getLine(this.doc, pos.line));
- var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;
- var type;
- if (ch == 0) { type = styles[2]; }
- else { for (;;) {
- var mid = (before + after) >> 1;
- if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }
- else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }
- else { type = styles[mid * 2 + 2]; break }
- } }
- var cut = type ? type.indexOf("overlay ") : -1;
- return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)
- },
- getModeAt: function(pos) {
- var mode = this.doc.mode;
- if (!mode.innerMode) { return mode }
- return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode
- },
- getHelper: function(pos, type) {
- return this.getHelpers(pos, type)[0]
- },
- getHelpers: function(pos, type) {
- var found = [];
- if (!helpers.hasOwnProperty(type)) { return found }
- var help = helpers[type], mode = this.getModeAt(pos);
- if (typeof mode[type] == "string") {
- if (help[mode[type]]) { found.push(help[mode[type]]); }
- } else if (mode[type]) {
- for (var i = 0; i < mode[type].length; i++) {
- var val = help[mode[type][i]];
- if (val) { found.push(val); }
- }
- } else if (mode.helperType && help[mode.helperType]) {
- found.push(help[mode.helperType]);
- } else if (help[mode.name]) {
- found.push(help[mode.name]);
- }
- for (var i$1 = 0; i$1 < help._global.length; i$1++) {
- var cur = help._global[i$1];
- if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)
- { found.push(cur.val); }
- }
- return found
- },
- getStateAfter: function(line, precise) {
- var doc = this.doc;
- line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);
- return getContextBefore(this, line + 1, precise).state
- },
- cursorCoords: function(start, mode) {
- var pos, range = this.doc.sel.primary();
- if (start == null) { pos = range.head; }
- else if (typeof start == "object") { pos = clipPos(this.doc, start); }
- else { pos = start ? range.from() : range.to(); }
- return cursorCoords(this, pos, mode || "page")
- },
- charCoords: function(pos, mode) {
- return charCoords(this, clipPos(this.doc, pos), mode || "page")
- },
- coordsChar: function(coords, mode) {
- coords = fromCoordSystem(this, coords, mode || "page");
- return coordsChar(this, coords.left, coords.top)
- },
- lineAtHeight: function(height, mode) {
- height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top;
- return lineAtHeight(this.doc, height + this.display.viewOffset)
- },
- heightAtLine: function(line, mode, includeWidgets) {
- var end = false, lineObj;
- if (typeof line == "number") {
- var last = this.doc.first + this.doc.size - 1;
- if (line < this.doc.first) { line = this.doc.first; }
- else if (line > last) { line = last; end = true; }
- lineObj = getLine(this.doc, line);
- } else {
- lineObj = line;
- }
- return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top +
- (end ? this.doc.height - heightAtLine(lineObj) : 0)
- },
- defaultTextHeight: function() { return textHeight(this.display) },
- defaultCharWidth: function() { return charWidth(this.display) },
- getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},
- addWidget: function(pos, node, scroll, vert, horiz) {
- var display = this.display;
- pos = cursorCoords(this, clipPos(this.doc, pos));
- var top = pos.bottom, left = pos.left;
- node.style.position = "absolute";
- node.setAttribute("cm-ignore-events", "true");
- this.display.input.setUneditable(node);
- display.sizer.appendChild(node);
- if (vert == "over") {
- top = pos.top;
- } else if (vert == "above" || vert == "near") {
- var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),
- hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);
- // Default to positioning above (if specified and possible); otherwise default to positioning below
- if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)
- { top = pos.top - node.offsetHeight; }
- else if (pos.bottom + node.offsetHeight <= vspace)
- { top = pos.bottom; }
- if (left + node.offsetWidth > hspace)
- { left = hspace - node.offsetWidth; }
- }
- node.style.top = top + "px";
- node.style.left = node.style.right = "";
- if (horiz == "right") {
- left = display.sizer.clientWidth - node.offsetWidth;
- node.style.right = "0px";
- } else {
- if (horiz == "left") { left = 0; }
- else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }
- node.style.left = left + "px";
- }
- if (scroll)
- { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }
- },
- triggerOnKeyDown: methodOp(onKeyDown),
- triggerOnKeyPress: methodOp(onKeyPress),
- triggerOnKeyUp: onKeyUp,
- triggerOnMouseDown: methodOp(onMouseDown),
- execCommand: function(cmd) {
- if (commands.hasOwnProperty(cmd))
- { return commands[cmd].call(null, this) }
- },
- triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),
- findPosH: function(from, amount, unit, visually) {
- var dir = 1;
- if (amount < 0) { dir = -1; amount = -amount; }
- var cur = clipPos(this.doc, from);
- for (var i = 0; i < amount; ++i) {
- cur = findPosH(this.doc, cur, dir, unit, visually);
- if (cur.hitSide) { break }
- }
- return cur
- },
- moveH: methodOp(function(dir, unit) {
- var this$1 = this;
- this.extendSelectionsBy(function (range) {
- if (this$1.display.shift || this$1.doc.extend || range.empty())
- { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }
- else
- { return dir < 0 ? range.from() : range.to() }
- }, sel_move);
- }),
- deleteH: methodOp(function(dir, unit) {
- var sel = this.doc.sel, doc = this.doc;
- if (sel.somethingSelected())
- { doc.replaceSelection("", null, "+delete"); }
- else
- { deleteNearSelection(this, function (range) {
- var other = findPosH(doc, range.head, dir, unit, false);
- return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}
- }); }
- }),
- findPosV: function(from, amount, unit, goalColumn) {
- var dir = 1, x = goalColumn;
- if (amount < 0) { dir = -1; amount = -amount; }
- var cur = clipPos(this.doc, from);
- for (var i = 0; i < amount; ++i) {
- var coords = cursorCoords(this, cur, "div");
- if (x == null) { x = coords.left; }
- else { coords.left = x; }
- cur = findPosV(this, coords, dir, unit);
- if (cur.hitSide) { break }
- }
- return cur
- },
- moveV: methodOp(function(dir, unit) {
- var this$1 = this;
- var doc = this.doc, goals = [];
- var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();
- doc.extendSelectionsBy(function (range) {
- if (collapse)
- { return dir < 0 ? range.from() : range.to() }
- var headPos = cursorCoords(this$1, range.head, "div");
- if (range.goalColumn != null) { headPos.left = range.goalColumn; }
- goals.push(headPos.left);
- var pos = findPosV(this$1, headPos, dir, unit);
- if (unit == "page" && range == doc.sel.primary())
- { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); }
- return pos
- }, sel_move);
- if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)
- { doc.sel.ranges[i].goalColumn = goals[i]; } }
- }),
- // Find the word at the given position (as returned by coordsChar).
- findWordAt: function(pos) {
- var doc = this.doc, line = getLine(doc, pos.line).text;
- var start = pos.ch, end = pos.ch;
- if (line) {
- var helper = this.getHelper(pos, "wordChars");
- if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end; }
- var startChar = line.charAt(start);
- var check = isWordChar(startChar, helper)
- ? function (ch) { return isWordChar(ch, helper); }
- : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); }
- : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); };
- while (start > 0 && check(line.charAt(start - 1))) { --start; }
- while (end < line.length && check(line.charAt(end))) { ++end; }
- }
- return new Range(Pos(pos.line, start), Pos(pos.line, end))
- },
- toggleOverwrite: function(value) {
- if (value != null && value == this.state.overwrite) { return }
- if (this.state.overwrite = !this.state.overwrite)
- { addClass(this.display.cursorDiv, "CodeMirror-overwrite"); }
- else
- { rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); }
- signal(this, "overwriteToggle", this, this.state.overwrite);
- },
- hasFocus: function() { return this.display.input.getField() == activeElt() },
- isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
- scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),
- getScrollInfo: function() {
- var scroller = this.display.scroller;
- return {left: scroller.scrollLeft, top: scroller.scrollTop,
- height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,
- width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,
- clientHeight: displayHeight(this), clientWidth: displayWidth(this)}
- },
- scrollIntoView: methodOp(function(range, margin) {
- if (range == null) {
- range = {from: this.doc.sel.primary().head, to: null};
- if (margin == null) { margin = this.options.cursorScrollMargin; }
- } else if (typeof range == "number") {
- range = {from: Pos(range, 0), to: null};
- } else if (range.from == null) {
- range = {from: range, to: null};
- }
- if (!range.to) { range.to = range.from; }
- range.margin = margin || 0;
- if (range.from.line != null) {
- scrollToRange(this, range);
- } else {
- scrollToCoordsRange(this, range.from, range.to, range.margin);
- }
- }),
- setSize: methodOp(function(width, height) {
- var this$1 = this;
- var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; };
- if (width != null) { this.display.wrapper.style.width = interpret(width); }
- if (height != null) { this.display.wrapper.style.height = interpret(height); }
- if (this.options.lineWrapping) { clearLineMeasurementCache(this); }
- var lineNo = this.display.viewFrom;
- this.doc.iter(lineNo, this.display.viewTo, function (line) {
- if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)
- { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } }
- ++lineNo;
- });
- this.curOp.forceUpdate = true;
- signal(this, "refresh", this);
- }),
- operation: function(f){return runInOp(this, f)},
- startOperation: function(){return startOperation(this)},
- endOperation: function(){return endOperation(this)},
- refresh: methodOp(function() {
- var oldHeight = this.display.cachedTextHeight;
- regChange(this);
- this.curOp.forceUpdate = true;
- clearCaches(this);
- scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);
- updateGutterSpace(this.display);
- if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)
- { estimateLineHeights(this); }
- signal(this, "refresh", this);
- }),
- swapDoc: methodOp(function(doc) {
- var old = this.doc;
- old.cm = null;
- // Cancel the current text selection if any (#5821)
- if (this.state.selectingText) { this.state.selectingText(); }
- attachDoc(this, doc);
- clearCaches(this);
- this.display.input.reset();
- scrollToCoords(this, doc.scrollLeft, doc.scrollTop);
- this.curOp.forceScroll = true;
- signalLater(this, "swapDoc", this, old);
- return old
- }),
- phrase: function(phraseText) {
- var phrases = this.options.phrases;
- return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText
- },
- getInputField: function(){return this.display.input.getField()},
- getWrapperElement: function(){return this.display.wrapper},
- getScrollerElement: function(){return this.display.scroller},
- getGutterElement: function(){return this.display.gutters}
- };
- eventMixin(CodeMirror);
- CodeMirror.registerHelper = function(type, name, value) {
- if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }
- helpers[type][name] = value;
- };
- CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {
- CodeMirror.registerHelper(type, name, value);
- helpers[type]._global.push({pred: predicate, val: value});
- };
- }
- // Used for horizontal relative motion. Dir is -1 or 1 (left or
- // right), unit can be "codepoint", "char", "column" (like char, but
- // doesn't cross line boundaries), "word" (across next word), or
- // "group" (to the start of next group of word or
- // non-word-non-whitespace chars). The visually param controls
- // whether, in right-to-left text, direction 1 means to move towards
- // the next index in the string, or towards the character to the right
- // of the current position. The resulting position will have a
- // hitSide=true property if it reached the end of the document.
- function findPosH(doc, pos, dir, unit, visually) {
- var oldPos = pos;
- var origDir = dir;
- var lineObj = getLine(doc, pos.line);
- var lineDir = visually && doc.direction == "rtl" ? -dir : dir;
- function findNextLine() {
- var l = pos.line + lineDir;
- if (l < doc.first || l >= doc.first + doc.size) { return false }
- pos = new Pos(l, pos.ch, pos.sticky);
- return lineObj = getLine(doc, l)
- }
- function moveOnce(boundToLine) {
- var next;
- if (unit == "codepoint") {
- var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));
- if (isNaN(ch)) {
- next = null;
- } else {
- var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;
- next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);
- }
- } else if (visually) {
- next = moveVisually(doc.cm, lineObj, pos, dir);
- } else {
- next = moveLogically(lineObj, pos, dir);
- }
- if (next == null) {
- if (!boundToLine && findNextLine())
- { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }
- else
- { return false }
- } else {
- pos = next;
- }
- return true
- }
- if (unit == "char" || unit == "codepoint") {
- moveOnce();
- } else if (unit == "column") {
- moveOnce(true);
- } else if (unit == "word" || unit == "group") {
- var sawType = null, group = unit == "group";
- var helper = doc.cm && doc.cm.getHelper(pos, "wordChars");
- for (var first = true;; first = false) {
- if (dir < 0 && !moveOnce(!first)) { break }
- var cur = lineObj.text.charAt(pos.ch) || "\n";
- var type = isWordChar(cur, helper) ? "w"
- : group && cur == "\n" ? "n"
- : !group || /\s/.test(cur) ? null
- : "p";
- if (group && !first && !type) { type = "s"; }
- if (sawType && sawType != type) {
- if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after";}
- break
- }
- if (type) { sawType = type; }
- if (dir > 0 && !moveOnce(!first)) { break }
- }
- }
- var result = skipAtomic(doc, pos, oldPos, origDir, true);
- if (equalCursorPos(oldPos, result)) { result.hitSide = true; }
- return result
- }
- // For relative vertical movement. Dir may be -1 or 1. Unit can be
- // "page" or "line". The resulting position will have a hitSide=true
- // property if it reached the end of the document.
- function findPosV(cm, pos, dir, unit) {
- var doc = cm.doc, x = pos.left, y;
- if (unit == "page") {
- var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);
- var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);
- y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;
- } else if (unit == "line") {
- y = dir > 0 ? pos.bottom + 3 : pos.top - 3;
- }
- var target;
- for (;;) {
- target = coordsChar(cm, x, y);
- if (!target.outside) { break }
- if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }
- y += dir * 5;
- }
- return target
- }
- // CONTENTEDITABLE INPUT STYLE
- var ContentEditableInput = function(cm) {
- this.cm = cm;
- this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;
- this.polling = new Delayed();
- this.composing = null;
- this.gracePeriod = false;
- this.readDOMTimeout = null;
- };
- ContentEditableInput.prototype.init = function (display) {
- var this$1 = this;
- var input = this, cm = input.cm;
- var div = input.div = display.lineDiv;
- div.contentEditable = true;
- disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);
- function belongsToInput(e) {
- for (var t = e.target; t; t = t.parentNode) {
- if (t == div) { return true }
- if (/\bCodeMirror-(?:line)?widget\b/.test(t.className)) { break }
- }
- return false
- }
- on(div, "paste", function (e) {
- if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
- // IE doesn't fire input events, so we schedule a read for the pasted content in this way
- if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }
- });
- on(div, "compositionstart", function (e) {
- this$1.composing = {data: e.data, done: false};
- });
- on(div, "compositionupdate", function (e) {
- if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }
- });
- on(div, "compositionend", function (e) {
- if (this$1.composing) {
- if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }
- this$1.composing.done = true;
- }
- });
- on(div, "touchstart", function () { return input.forceCompositionEnd(); });
- on(div, "input", function () {
- if (!this$1.composing) { this$1.readFromDOMSoon(); }
- });
- function onCopyCut(e) {
- if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }
- if (cm.somethingSelected()) {
- setLastCopied({lineWise: false, text: cm.getSelections()});
- if (e.type == "cut") { cm.replaceSelection("", null, "cut"); }
- } else if (!cm.options.lineWiseCopyCut) {
- return
- } else {
- var ranges = copyableRanges(cm);
- setLastCopied({lineWise: true, text: ranges.text});
- if (e.type == "cut") {
- cm.operation(function () {
- cm.setSelections(ranges.ranges, 0, sel_dontScroll);
- cm.replaceSelection("", null, "cut");
- });
- }
- }
- if (e.clipboardData) {
- e.clipboardData.clearData();
- var content = lastCopied.text.join("\n");
- // iOS exposes the clipboard API, but seems to discard content inserted into it
- e.clipboardData.setData("Text", content);
- if (e.clipboardData.getData("Text") == content) {
- e.preventDefault();
- return
- }
- }
- // Old-fashioned briefly-focus-a-textarea hack
- var kludge = hiddenTextarea(), te = kludge.firstChild;
- cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
- te.value = lastCopied.text.join("\n");
- var hadFocus = activeElt();
- selectInput(te);
- setTimeout(function () {
- cm.display.lineSpace.removeChild(kludge);
- hadFocus.focus();
- if (hadFocus == div) { input.showPrimarySelection(); }
- }, 50);
- }
- on(div, "copy", onCopyCut);
- on(div, "cut", onCopyCut);
- };
- ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {
- // Label for screenreaders, accessibility
- if(label) {
- this.div.setAttribute('aria-label', label);
- } else {
- this.div.removeAttribute('aria-label');
- }
- };
- ContentEditableInput.prototype.prepareSelection = function () {
- var result = prepareSelection(this.cm, false);
- result.focus = activeElt() == this.div;
- return result
- };
- ContentEditableInput.prototype.showSelection = function (info, takeFocus) {
- if (!info || !this.cm.display.view.length) { return }
- if (info.focus || takeFocus) { this.showPrimarySelection(); }
- this.showMultipleSelections(info);
- };
- ContentEditableInput.prototype.getSelection = function () {
- return this.cm.display.wrapper.ownerDocument.getSelection()
- };
- ContentEditableInput.prototype.showPrimarySelection = function () {
- var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();
- var from = prim.from(), to = prim.to();
- if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {
- sel.removeAllRanges();
- return
- }
- var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);
- var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);
- if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
- cmp(minPos(curAnchor, curFocus), from) == 0 &&
- cmp(maxPos(curAnchor, curFocus), to) == 0)
- { return }
- var view = cm.display.view;
- var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||
- {node: view[0].measure.map[2], offset: 0};
- var end = to.line < cm.display.viewTo && posToDOM(cm, to);
- if (!end) {
- var measure = view[view.length - 1].measure;
- var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;
- end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};
- }
- if (!start || !end) {
- sel.removeAllRanges();
- return
- }
- var old = sel.rangeCount && sel.getRangeAt(0), rng;
- try { rng = range(start.node, start.offset, end.offset, end.node); }
- catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
- if (rng) {
- if (!gecko && cm.state.focused) {
- sel.collapse(start.node, start.offset);
- if (!rng.collapsed) {
- sel.removeAllRanges();
- sel.addRange(rng);
- }
- } else {
- sel.removeAllRanges();
- sel.addRange(rng);
- }
- if (old && sel.anchorNode == null) { sel.addRange(old); }
- else if (gecko) { this.startGracePeriod(); }
- }
- this.rememberSelection();
- };
- ContentEditableInput.prototype.startGracePeriod = function () {
- var this$1 = this;
- clearTimeout(this.gracePeriod);
- this.gracePeriod = setTimeout(function () {
- this$1.gracePeriod = false;
- if (this$1.selectionChanged())
- { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }
- }, 20);
- };
- ContentEditableInput.prototype.showMultipleSelections = function (info) {
- removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);
- removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);
- };
- ContentEditableInput.prototype.rememberSelection = function () {
- var sel = this.getSelection();
- this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;
- this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;
- };
- ContentEditableInput.prototype.selectionInEditor = function () {
- var sel = this.getSelection();
- if (!sel.rangeCount) { return false }
- var node = sel.getRangeAt(0).commonAncestorContainer;
- return contains(this.div, node)
- };
- ContentEditableInput.prototype.focus = function () {
- if (this.cm.options.readOnly != "nocursor") {
- if (!this.selectionInEditor() || activeElt() != this.div)
- { this.showSelection(this.prepareSelection(), true); }
- this.div.focus();
- }
- };
- ContentEditableInput.prototype.blur = function () { this.div.blur(); };
- ContentEditableInput.prototype.getField = function () { return this.div };
- ContentEditableInput.prototype.supportsTouch = function () { return true };
- ContentEditableInput.prototype.receivedFocus = function () {
- var this$1 = this;
- var input = this;
- if (this.selectionInEditor())
- { setTimeout(function () { return this$1.pollSelection(); }, 20); }
- else
- { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }
- function poll() {
- if (input.cm.state.focused) {
- input.pollSelection();
- input.polling.set(input.cm.options.pollInterval, poll);
- }
- }
- this.polling.set(this.cm.options.pollInterval, poll);
- };
- ContentEditableInput.prototype.selectionChanged = function () {
- var sel = this.getSelection();
- return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||
- sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset
- };
- ContentEditableInput.prototype.pollSelection = function () {
- if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }
- var sel = this.getSelection(), cm = this.cm;
- // On Android Chrome (version 56, at least), backspacing into an
- // uneditable block element will put the cursor in that element,
- // and then, because it's not editable, hide the virtual keyboard.
- // Because Android doesn't allow us to actually detect backspace
- // presses in a sane way, this code checks for when that happens
- // and simulates a backspace press in this case.
- if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {
- this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs});
- this.blur();
- this.focus();
- return
- }
- if (this.composing) { return }
- this.rememberSelection();
- var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);
- var head = domToPos(cm, sel.focusNode, sel.focusOffset);
- if (anchor && head) { runInOp(cm, function () {
- setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);
- if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }
- }); }
- };
- ContentEditableInput.prototype.pollContent = function () {
- if (this.readDOMTimeout != null) {
- clearTimeout(this.readDOMTimeout);
- this.readDOMTimeout = null;
- }
- var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();
- var from = sel.from(), to = sel.to();
- if (from.ch == 0 && from.line > cm.firstLine())
- { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }
- if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())
- { to = Pos(to.line + 1, 0); }
- if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }
- var fromIndex, fromLine, fromNode;
- if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {
- fromLine = lineNo(display.view[0].line);
- fromNode = display.view[0].node;
- } else {
- fromLine = lineNo(display.view[fromIndex].line);
- fromNode = display.view[fromIndex - 1].node.nextSibling;
- }
- var toIndex = findViewIndex(cm, to.line);
- var toLine, toNode;
- if (toIndex == display.view.length - 1) {
- toLine = display.viewTo - 1;
- toNode = display.lineDiv.lastChild;
- } else {
- toLine = lineNo(display.view[toIndex + 1].line) - 1;
- toNode = display.view[toIndex + 1].node.previousSibling;
- }
- if (!fromNode) { return false }
- var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));
- var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));
- while (newText.length > 1 && oldText.length > 1) {
- if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }
- else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }
- else { break }
- }
- var cutFront = 0, cutEnd = 0;
- var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);
- while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))
- { ++cutFront; }
- var newBot = lst(newText), oldBot = lst(oldText);
- var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),
- oldBot.length - (oldText.length == 1 ? cutFront : 0));
- while (cutEnd < maxCutEnd &&
- newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))
- { ++cutEnd; }
- // Try to move start of change to start of selection if ambiguous
- if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {
- while (cutFront && cutFront > from.ch &&
- newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {
- cutFront--;
- cutEnd++;
- }
- }
- newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "");
- newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "");
- var chFrom = Pos(fromLine, cutFront);
- var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);
- if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {
- replaceRange(cm.doc, newText, chFrom, chTo, "+input");
- return true
- }
- };
- ContentEditableInput.prototype.ensurePolled = function () {
- this.forceCompositionEnd();
- };
- ContentEditableInput.prototype.reset = function () {
- this.forceCompositionEnd();
- };
- ContentEditableInput.prototype.forceCompositionEnd = function () {
- if (!this.composing) { return }
- clearTimeout(this.readDOMTimeout);
- this.composing = null;
- this.updateFromDOM();
- this.div.blur();
- this.div.focus();
- };
- ContentEditableInput.prototype.readFromDOMSoon = function () {
- var this$1 = this;
- if (this.readDOMTimeout != null) { return }
- this.readDOMTimeout = setTimeout(function () {
- this$1.readDOMTimeout = null;
- if (this$1.composing) {
- if (this$1.composing.done) { this$1.composing = null; }
- else { return }
- }
- this$1.updateFromDOM();
- }, 80);
- };
- ContentEditableInput.prototype.updateFromDOM = function () {
- var this$1 = this;
- if (this.cm.isReadOnly() || !this.pollContent())
- { runInOp(this.cm, function () { return regChange(this$1.cm); }); }
- };
- ContentEditableInput.prototype.setUneditable = function (node) {
- node.contentEditable = "false";
- };
- ContentEditableInput.prototype.onKeyPress = function (e) {
- if (e.charCode == 0 || this.composing) { return }
- e.preventDefault();
- if (!this.cm.isReadOnly())
- { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }
- };
- ContentEditableInput.prototype.readOnlyChanged = function (val) {
- this.div.contentEditable = String(val != "nocursor");
- };
- ContentEditableInput.prototype.onContextMenu = function () {};
- ContentEditableInput.prototype.resetPosition = function () {};
- ContentEditableInput.prototype.needsContentAttribute = true;
- function posToDOM(cm, pos) {
- var view = findViewForLine(cm, pos.line);
- if (!view || view.hidden) { return null }
- var line = getLine(cm.doc, pos.line);
- var info = mapFromLineView(view, line, pos.line);
- var order = getOrder(line, cm.doc.direction), side = "left";
- if (order) {
- var partPos = getBidiPartAt(order, pos.ch);
- side = partPos % 2 ? "right" : "left";
- }
- var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);
- result.offset = result.collapse == "right" ? result.end : result.start;
- return result
- }
- function isInGutter(node) {
- for (var scan = node; scan; scan = scan.parentNode)
- { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }
- return false
- }
- function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }
- function domTextBetween(cm, from, to, fromLine, toLine) {
- var text = "", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;
- function recognizeMarker(id) { return function (marker) { return marker.id == id; } }
- function close() {
- if (closing) {
- text += lineSep;
- if (extraLinebreak) { text += lineSep; }
- closing = extraLinebreak = false;
- }
- }
- function addText(str) {
- if (str) {
- close();
- text += str;
- }
- }
- function walk(node) {
- if (node.nodeType == 1) {
- var cmText = node.getAttribute("cm-text");
- if (cmText) {
- addText(cmText);
- return
- }
- var markerID = node.getAttribute("cm-marker"), range;
- if (markerID) {
- var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));
- if (found.length && (range = found[0].find(0)))
- { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }
- return
- }
- if (node.getAttribute("contenteditable") == "false") { return }
- var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);
- if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }
- if (isBlock) { close(); }
- for (var i = 0; i < node.childNodes.length; i++)
- { walk(node.childNodes[i]); }
- if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }
- if (isBlock) { closing = true; }
- } else if (node.nodeType == 3) {
- addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " "));
- }
- }
- for (;;) {
- walk(from);
- if (from == to) { break }
- from = from.nextSibling;
- extraLinebreak = false;
- }
- return text
- }
- function domToPos(cm, node, offset) {
- var lineNode;
- if (node == cm.display.lineDiv) {
- lineNode = cm.display.lineDiv.childNodes[offset];
- if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }
- node = null; offset = 0;
- } else {
- for (lineNode = node;; lineNode = lineNode.parentNode) {
- if (!lineNode || lineNode == cm.display.lineDiv) { return null }
- if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }
- }
- }
- for (var i = 0; i < cm.display.view.length; i++) {
- var lineView = cm.display.view[i];
- if (lineView.node == lineNode)
- { return locateNodeInLineView(lineView, node, offset) }
- }
- }
- function locateNodeInLineView(lineView, node, offset) {
- var wrapper = lineView.text.firstChild, bad = false;
- if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }
- if (node == wrapper) {
- bad = true;
- node = wrapper.childNodes[offset];
- offset = 0;
- if (!node) {
- var line = lineView.rest ? lst(lineView.rest) : lineView.line;
- return badPos(Pos(lineNo(line), line.text.length), bad)
- }
- }
- var textNode = node.nodeType == 3 ? node : null, topNode = node;
- if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
- textNode = node.firstChild;
- if (offset) { offset = textNode.nodeValue.length; }
- }
- while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }
- var measure = lineView.measure, maps = measure.maps;
- function find(textNode, topNode, offset) {
- for (var i = -1; i < (maps ? maps.length : 0); i++) {
- var map = i < 0 ? measure.map : maps[i];
- for (var j = 0; j < map.length; j += 3) {
- var curNode = map[j + 2];
- if (curNode == textNode || curNode == topNode) {
- var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);
- var ch = map[j] + offset;
- if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }
- return Pos(line, ch)
- }
- }
- }
- }
- var found = find(textNode, topNode, offset);
- if (found) { return badPos(found, bad) }
- // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems
- for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {
- found = find(after, after.firstChild, 0);
- if (found)
- { return badPos(Pos(found.line, found.ch - dist), bad) }
- else
- { dist += after.textContent.length; }
- }
- for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {
- found = find(before, before.firstChild, -1);
- if (found)
- { return badPos(Pos(found.line, found.ch + dist$1), bad) }
- else
- { dist$1 += before.textContent.length; }
- }
- }
- // TEXTAREA INPUT STYLE
- var TextareaInput = function(cm) {
- this.cm = cm;
- // See input.poll and input.reset
- this.prevInput = "";
- // Flag that indicates whether we expect input to appear real soon
- // now (after some event like 'keypress' or 'input') and are
- // polling intensively.
- this.pollingFast = false;
- // Self-resetting timeout for the poller
- this.polling = new Delayed();
- // Used to work around IE issue with selection being forgotten when focus moves away from textarea
- this.hasSelection = false;
- this.composing = null;
- };
- TextareaInput.prototype.init = function (display) {
- var this$1 = this;
- var input = this, cm = this.cm;
- this.createField(display);
- var te = this.textarea;
- display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);
- // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)
- if (ios) { te.style.width = "0px"; }
- on(te, "input", function () {
- if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }
- input.poll();
- });
- on(te, "paste", function (e) {
- if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
- cm.state.pasteIncoming = +new Date;
- input.fastPoll();
- });
- function prepareCopyCut(e) {
- if (signalDOMEvent(cm, e)) { return }
- if (cm.somethingSelected()) {
- setLastCopied({lineWise: false, text: cm.getSelections()});
- } else if (!cm.options.lineWiseCopyCut) {
- return
- } else {
- var ranges = copyableRanges(cm);
- setLastCopied({lineWise: true, text: ranges.text});
- if (e.type == "cut") {
- cm.setSelections(ranges.ranges, null, sel_dontScroll);
- } else {
- input.prevInput = "";
- te.value = ranges.text.join("\n");
- selectInput(te);
- }
- }
- if (e.type == "cut") { cm.state.cutIncoming = +new Date; }
- }
- on(te, "cut", prepareCopyCut);
- on(te, "copy", prepareCopyCut);
- on(display.scroller, "paste", function (e) {
- if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }
- if (!te.dispatchEvent) {
- cm.state.pasteIncoming = +new Date;
- input.focus();
- return
- }
- // Pass the `paste` event to the textarea so it's handled by its event listener.
- var event = new Event("paste");
- event.clipboardData = e.clipboardData;
- te.dispatchEvent(event);
- });
- // Prevent normal selection in the editor (we handle our own)
- on(display.lineSpace, "selectstart", function (e) {
- if (!eventInWidget(display, e)) { e_preventDefault(e); }
- });
- on(te, "compositionstart", function () {
- var start = cm.getCursor("from");
- if (input.composing) { input.composing.range.clear(); }
- input.composing = {
- start: start,
- range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"})
- };
- });
- on(te, "compositionend", function () {
- if (input.composing) {
- input.poll();
- input.composing.range.clear();
- input.composing = null;
- }
- });
- };
- TextareaInput.prototype.createField = function (_display) {
- // Wraps and hides input textarea
- this.wrapper = hiddenTextarea();
- // The semihidden textarea that is focused when the editor is
- // focused, and receives input.
- this.textarea = this.wrapper.firstChild;
- };
- TextareaInput.prototype.screenReaderLabelChanged = function (label) {
- // Label for screenreaders, accessibility
- if(label) {
- this.textarea.setAttribute('aria-label', label);
- } else {
- this.textarea.removeAttribute('aria-label');
- }
- };
- TextareaInput.prototype.prepareSelection = function () {
- // Redraw the selection and/or cursor
- var cm = this.cm, display = cm.display, doc = cm.doc;
- var result = prepareSelection(cm);
- // Move the hidden textarea near the cursor to prevent scrolling artifacts
- if (cm.options.moveInputWithCursor) {
- var headPos = cursorCoords(cm, doc.sel.primary().head, "div");
- var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();
- result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
- headPos.top + lineOff.top - wrapOff.top));
- result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
- headPos.left + lineOff.left - wrapOff.left));
- }
- return result
- };
- TextareaInput.prototype.showSelection = function (drawn) {
- var cm = this.cm, display = cm.display;
- removeChildrenAndAdd(display.cursorDiv, drawn.cursors);
- removeChildrenAndAdd(display.selectionDiv, drawn.selection);
- if (drawn.teTop != null) {
- this.wrapper.style.top = drawn.teTop + "px";
- this.wrapper.style.left = drawn.teLeft + "px";
- }
- };
- // Reset the input to correspond to the selection (or to be empty,
- // when not typing and nothing is selected)
- TextareaInput.prototype.reset = function (typing) {
- if (this.contextMenuPending || this.composing) { return }
- var cm = this.cm;
- if (cm.somethingSelected()) {
- this.prevInput = "";
- var content = cm.getSelection();
- this.textarea.value = content;
- if (cm.state.focused) { selectInput(this.textarea); }
- if (ie && ie_version >= 9) { this.hasSelection = content; }
- } else if (!typing) {
- this.prevInput = this.textarea.value = "";
- if (ie && ie_version >= 9) { this.hasSelection = null; }
- }
- };
- TextareaInput.prototype.getField = function () { return this.textarea };
- TextareaInput.prototype.supportsTouch = function () { return false };
- TextareaInput.prototype.focus = function () {
- if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) {
- try { this.textarea.focus(); }
- catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM
- }
- };
- TextareaInput.prototype.blur = function () { this.textarea.blur(); };
- TextareaInput.prototype.resetPosition = function () {
- this.wrapper.style.top = this.wrapper.style.left = 0;
- };
- TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };
- // Poll for input changes, using the normal rate of polling. This
- // runs as long as the editor is focused.
- TextareaInput.prototype.slowPoll = function () {
- var this$1 = this;
- if (this.pollingFast) { return }
- this.polling.set(this.cm.options.pollInterval, function () {
- this$1.poll();
- if (this$1.cm.state.focused) { this$1.slowPoll(); }
- });
- };
- // When an event has just come in that is likely to add or change
- // something in the input textarea, we poll faster, to ensure that
- // the change appears on the screen quickly.
- TextareaInput.prototype.fastPoll = function () {
- var missed = false, input = this;
- input.pollingFast = true;
- function p() {
- var changed = input.poll();
- if (!changed && !missed) {missed = true; input.polling.set(60, p);}
- else {input.pollingFast = false; input.slowPoll();}
- }
- input.polling.set(20, p);
- };
- // Read input from the textarea, and update the document to match.
- // When something is selected, it is present in the textarea, and
- // selected (unless it is huge, in which case a placeholder is
- // used). When nothing is selected, the cursor sits after previously
- // seen text (can be empty), which is stored in prevInput (we must
- // not reset the textarea when typing, because that breaks IME).
- TextareaInput.prototype.poll = function () {
- var this$1 = this;
- var cm = this.cm, input = this.textarea, prevInput = this.prevInput;
- // Since this is called a *lot*, try to bail out as cheaply as
- // possible when it is clear that nothing happened. hasSelection
- // will be the case when there is a lot of text in the textarea,
- // in which case reading its value would be expensive.
- if (this.contextMenuPending || !cm.state.focused ||
- (hasSelection(input) && !prevInput && !this.composing) ||
- cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
- { return false }
- var text = input.value;
- // If nothing changed, bail.
- if (text == prevInput && !cm.somethingSelected()) { return false }
- // Work around nonsensical selection resetting in IE9/10, and
- // inexplicable appearance of private area unicode characters on
- // some key combos in Mac (#2689).
- if (ie && ie_version >= 9 && this.hasSelection === text ||
- mac && /[\uf700-\uf7ff]/.test(text)) {
- cm.display.input.reset();
- return false
- }
- if (cm.doc.sel == cm.display.selForContextMenu) {
- var first = text.charCodeAt(0);
- if (first == 0x200b && !prevInput) { prevInput = "\u200b"; }
- if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") }
- }
- // Find the part of the input that is actually new
- var same = 0, l = Math.min(prevInput.length, text.length);
- while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }
- runInOp(cm, function () {
- applyTextInput(cm, text.slice(same), prevInput.length - same,
- null, this$1.composing ? "*compose" : null);
- // Don't leave long text in the textarea, since it makes further polling slow
- if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = ""; }
- else { this$1.prevInput = text; }
- if (this$1.composing) {
- this$1.composing.range.clear();
- this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"),
- {className: "CodeMirror-composing"});
- }
- });
- return true
- };
- TextareaInput.prototype.ensurePolled = function () {
- if (this.pollingFast && this.poll()) { this.pollingFast = false; }
- };
- TextareaInput.prototype.onKeyPress = function () {
- if (ie && ie_version >= 9) { this.hasSelection = null; }
- this.fastPoll();
- };
- TextareaInput.prototype.onContextMenu = function (e) {
- var input = this, cm = input.cm, display = cm.display, te = input.textarea;
- if (input.contextMenuPending) { input.contextMenuPending(); }
- var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;
- if (!pos || presto) { return } // Opera is difficult.
- // Reset the current text selection only if the click is done outside of the selection
- // and 'resetSelectionOnContextMenu' option is true.
- var reset = cm.options.resetSelectionOnContextMenu;
- if (reset && cm.doc.sel.contains(pos) == -1)
- { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }
- var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;
- var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();
- input.wrapper.style.cssText = "position: static";
- te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
- var oldScrollY;
- if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)
- display.input.focus();
- if (webkit) { window.scrollTo(null, oldScrollY); }
- display.input.reset();
- // Adds "Select all" to context menu in FF
- if (!cm.somethingSelected()) { te.value = input.prevInput = " "; }
- input.contextMenuPending = rehide;
- display.selForContextMenu = cm.doc.sel;
- clearTimeout(display.detectingSelectAll);
- // Select-all will be greyed out if there's nothing to select, so
- // this adds a zero-width space so that we can later check whether
- // it got selected.
- function prepareSelectAllHack() {
- if (te.selectionStart != null) {
- var selected = cm.somethingSelected();
- var extval = "\u200b" + (selected ? te.value : "");
- te.value = "\u21da"; // Used to catch context-menu undo
- te.value = extval;
- input.prevInput = selected ? "" : "\u200b";
- te.selectionStart = 1; te.selectionEnd = extval.length;
- // Re-set this, in case some other handler touched the
- // selection in the meantime.
- display.selForContextMenu = cm.doc.sel;
- }
- }
- function rehide() {
- if (input.contextMenuPending != rehide) { return }
- input.contextMenuPending = false;
- input.wrapper.style.cssText = oldWrapperCSS;
- te.style.cssText = oldCSS;
- if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }
- // Try to detect the user choosing select-all
- if (te.selectionStart != null) {
- if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }
- var i = 0, poll = function () {
- if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
- te.selectionEnd > 0 && input.prevInput == "\u200b") {
- operation(cm, selectAll)(cm);
- } else if (i++ < 10) {
- display.detectingSelectAll = setTimeout(poll, 500);
- } else {
- display.selForContextMenu = null;
- display.input.reset();
- }
- };
- display.detectingSelectAll = setTimeout(poll, 200);
- }
- }
- if (ie && ie_version >= 9) { prepareSelectAllHack(); }
- if (captureRightClick) {
- e_stop(e);
- var mouseup = function () {
- off(window, "mouseup", mouseup);
- setTimeout(rehide, 20);
- };
- on(window, "mouseup", mouseup);
- } else {
- setTimeout(rehide, 50);
- }
- };
- TextareaInput.prototype.readOnlyChanged = function (val) {
- if (!val) { this.reset(); }
- this.textarea.disabled = val == "nocursor";
- this.textarea.readOnly = !!val;
- };
- TextareaInput.prototype.setUneditable = function () {};
- TextareaInput.prototype.needsContentAttribute = false;
- function fromTextArea(textarea, options) {
- options = options ? copyObj(options) : {};
- options.value = textarea.value;
- if (!options.tabindex && textarea.tabIndex)
- { options.tabindex = textarea.tabIndex; }
- if (!options.placeholder && textarea.placeholder)
- { options.placeholder = textarea.placeholder; }
- // Set autofocus to true if this textarea is focused, or if it has
- // autofocus and no other element is focused.
- if (options.autofocus == null) {
- var hasFocus = activeElt();
- options.autofocus = hasFocus == textarea ||
- textarea.getAttribute("autofocus") != null && hasFocus == document.body;
- }
- function save() {textarea.value = cm.getValue();}
- var realSubmit;
- if (textarea.form) {
- on(textarea.form, "submit", save);
- // Deplorable hack to make the submit method do the right thing.
- if (!options.leaveSubmitMethodAlone) {
- var form = textarea.form;
- realSubmit = form.submit;
- try {
- var wrappedSubmit = form.submit = function () {
- save();
- form.submit = realSubmit;
- form.submit();
- form.submit = wrappedSubmit;
- };
- } catch(e) {}
- }
- }
- options.finishInit = function (cm) {
- cm.save = save;
- cm.getTextArea = function () { return textarea; };
- cm.toTextArea = function () {
- cm.toTextArea = isNaN; // Prevent this from being ran twice
- save();
- textarea.parentNode.removeChild(cm.getWrapperElement());
- textarea.style.display = "";
- if (textarea.form) {
- off(textarea.form, "submit", save);
- if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == "function")
- { textarea.form.submit = realSubmit; }
- }
- };
- };
- textarea.style.display = "none";
- var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },
- options);
- return cm
- }
- function addLegacyProps(CodeMirror) {
- CodeMirror.off = off;
- CodeMirror.on = on;
- CodeMirror.wheelEventPixels = wheelEventPixels;
- CodeMirror.Doc = Doc;
- CodeMirror.splitLines = splitLinesAuto;
- CodeMirror.countColumn = countColumn;
- CodeMirror.findColumn = findColumn;
- CodeMirror.isWordChar = isWordCharBasic;
- CodeMirror.Pass = Pass;
- CodeMirror.signal = signal;
- CodeMirror.Line = Line;
- CodeMirror.changeEnd = changeEnd;
- CodeMirror.scrollbarModel = scrollbarModel;
- CodeMirror.Pos = Pos;
- CodeMirror.cmpPos = cmp;
- CodeMirror.modes = modes;
- CodeMirror.mimeModes = mimeModes;
- CodeMirror.resolveMode = resolveMode;
- CodeMirror.getMode = getMode;
- CodeMirror.modeExtensions = modeExtensions;
- CodeMirror.extendMode = extendMode;
- CodeMirror.copyState = copyState;
- CodeMirror.startState = startState;
- CodeMirror.innerMode = innerMode;
- CodeMirror.commands = commands;
- CodeMirror.keyMap = keyMap;
- CodeMirror.keyName = keyName;
- CodeMirror.isModifierKey = isModifierKey;
- CodeMirror.lookupKey = lookupKey;
- CodeMirror.normalizeKeyMap = normalizeKeyMap;
- CodeMirror.StringStream = StringStream;
- CodeMirror.SharedTextMarker = SharedTextMarker;
- CodeMirror.TextMarker = TextMarker;
- CodeMirror.LineWidget = LineWidget;
- CodeMirror.e_preventDefault = e_preventDefault;
- CodeMirror.e_stopPropagation = e_stopPropagation;
- CodeMirror.e_stop = e_stop;
- CodeMirror.addClass = addClass;
- CodeMirror.contains = contains;
- CodeMirror.rmClass = rmClass;
- CodeMirror.keyNames = keyNames;
- }
- // EDITOR CONSTRUCTOR
- defineOptions(CodeMirror);
- addEditorMethods(CodeMirror);
- // Set up methods on CodeMirror's prototype to redirect to the editor's document.
- var dontDelegate = "iter insert remove copy getEditor constructor".split(" ");
- for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
- { CodeMirror.prototype[prop] = (function(method) {
- return function() {return method.apply(this.doc, arguments)}
- })(Doc.prototype[prop]); } }
- eventMixin(Doc);
- CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput};
- // Extra arguments are stored as the mode's dependencies, which is
- // used by (legacy) mechanisms like loadmode.js to automatically
- // load a mode. (Preferred mechanism is the require/define calls.)
- CodeMirror.defineMode = function(name/*, mode, …*/) {
- if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name; }
- defineMode.apply(this, arguments);
- };
- CodeMirror.defineMIME = defineMIME;
- // Minimal default mode.
- CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });
- CodeMirror.defineMIME("text/plain", "null");
- // EXTENSIONS
- CodeMirror.defineExtension = function (name, func) {
- CodeMirror.prototype[name] = func;
- };
- CodeMirror.defineDocExtension = function (name, func) {
- Doc.prototype[name] = func;
- };
- CodeMirror.fromTextArea = fromTextArea;
- addLegacyProps(CodeMirror);
- CodeMirror.version = "5.65.2";
- return CodeMirror;
- })));
- /***/ }),
- /***/ 99762:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- function Context(indented, column, type, info, align, prev) {
- this.indented = indented;
- this.column = column;
- this.type = type;
- this.info = info;
- this.align = align;
- this.prev = prev;
- }
- function pushContext(state, col, type, info) {
- var indent = state.indented;
- if (state.context && state.context.type == "statement" && type != "statement")
- indent = state.context.indented;
- return state.context = new Context(indent, col, type, info, null, state.context);
- }
- function popContext(state) {
- var t = state.context.type;
- if (t == ")" || t == "]" || t == "}")
- state.indented = state.context.indented;
- return state.context = state.context.prev;
- }
- function typeBefore(stream, state, pos) {
- if (state.prevToken == "variable" || state.prevToken == "type") return true;
- if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
- if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
- }
- function isTopScope(context) {
- for (;;) {
- if (!context || context.type == "top") return true;
- if (context.type == "}" && context.prev.info != "namespace") return false;
- context = context.prev;
- }
- }
- CodeMirror.defineMode("clike", function(config, parserConfig) {
- var indentUnit = config.indentUnit,
- statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
- dontAlignCalls = parserConfig.dontAlignCalls,
- keywords = parserConfig.keywords || {},
- types = parserConfig.types || {},
- builtin = parserConfig.builtin || {},
- blockKeywords = parserConfig.blockKeywords || {},
- defKeywords = parserConfig.defKeywords || {},
- atoms = parserConfig.atoms || {},
- hooks = parserConfig.hooks || {},
- multiLineStrings = parserConfig.multiLineStrings,
- indentStatements = parserConfig.indentStatements !== false,
- indentSwitch = parserConfig.indentSwitch !== false,
- namespaceSeparator = parserConfig.namespaceSeparator,
- isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
- numberStart = parserConfig.numberStart || /[\d\.]/,
- number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
- isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
- isIdentifierChar = parserConfig.isIdentifierChar || /[\w\$_\xa1-\uffff]/,
- // An optional function that takes a {string} token and returns true if it
- // should be treated as a builtin.
- isReservedIdentifier = parserConfig.isReservedIdentifier || false;
- var curPunc, isDefKeyword;
- function tokenBase(stream, state) {
- var ch = stream.next();
- if (hooks[ch]) {
- var result = hooks[ch](stream, state);
- if (result !== false) return result;
- }
- if (ch == '"' || ch == "'") {
- state.tokenize = tokenString(ch);
- return state.tokenize(stream, state);
- }
- if (numberStart.test(ch)) {
- stream.backUp(1)
- if (stream.match(number)) return "number"
- stream.next()
- }
- if (isPunctuationChar.test(ch)) {
- curPunc = ch;
- return null;
- }
- if (ch == "/") {
- if (stream.eat("*")) {
- state.tokenize = tokenComment;
- return tokenComment(stream, state);
- }
- if (stream.eat("/")) {
- stream.skipToEnd();
- return "comment";
- }
- }
- if (isOperatorChar.test(ch)) {
- while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {}
- return "operator";
- }
- stream.eatWhile(isIdentifierChar);
- if (namespaceSeparator) while (stream.match(namespaceSeparator))
- stream.eatWhile(isIdentifierChar);
- var cur = stream.current();
- if (contains(keywords, cur)) {
- if (contains(blockKeywords, cur)) curPunc = "newstatement";
- if (contains(defKeywords, cur)) isDefKeyword = true;
- return "keyword";
- }
- if (contains(types, cur)) return "type";
- if (contains(builtin, cur)
- || (isReservedIdentifier && isReservedIdentifier(cur))) {
- if (contains(blockKeywords, cur)) curPunc = "newstatement";
- return "builtin";
- }
- if (contains(atoms, cur)) return "atom";
- return "variable";
- }
- function tokenString(quote) {
- return function(stream, state) {
- var escaped = false, next, end = false;
- while ((next = stream.next()) != null) {
- if (next == quote && !escaped) {end = true; break;}
- escaped = !escaped && next == "\\";
- }
- if (end || !(escaped || multiLineStrings))
- state.tokenize = null;
- return "string";
- };
- }
- function tokenComment(stream, state) {
- var maybeEnd = false, ch;
- while (ch = stream.next()) {
- if (ch == "/" && maybeEnd) {
- state.tokenize = null;
- break;
- }
- maybeEnd = (ch == "*");
- }
- return "comment";
- }
- function maybeEOL(stream, state) {
- if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context))
- state.typeAtEndOfLine = typeBefore(stream, state, stream.pos)
- }
- // Interface
- return {
- startState: function(basecolumn) {
- return {
- tokenize: null,
- context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
- indented: 0,
- startOfLine: true,
- prevToken: null
- };
- },
- token: function(stream, state) {
- var ctx = state.context;
- if (stream.sol()) {
- if (ctx.align == null) ctx.align = false;
- state.indented = stream.indentation();
- state.startOfLine = true;
- }
- if (stream.eatSpace()) { maybeEOL(stream, state); return null; }
- curPunc = isDefKeyword = null;
- var style = (state.tokenize || tokenBase)(stream, state);
- if (style == "comment" || style == "meta") return style;
- if (ctx.align == null) ctx.align = true;
- if (curPunc == ";" || curPunc == ":" || (curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)))
- while (state.context.type == "statement") popContext(state);
- else if (curPunc == "{") pushContext(state, stream.column(), "}");
- else if (curPunc == "[") pushContext(state, stream.column(), "]");
- else if (curPunc == "(") pushContext(state, stream.column(), ")");
- else if (curPunc == "}") {
- while (ctx.type == "statement") ctx = popContext(state);
- if (ctx.type == "}") ctx = popContext(state);
- while (ctx.type == "statement") ctx = popContext(state);
- }
- else if (curPunc == ctx.type) popContext(state);
- else if (indentStatements &&
- (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
- (ctx.type == "statement" && curPunc == "newstatement"))) {
- pushContext(state, stream.column(), "statement", stream.current());
- }
- if (style == "variable" &&
- ((state.prevToken == "def" ||
- (parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) &&
- isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
- style = "def";
- if (hooks.token) {
- var result = hooks.token(stream, state, style);
- if (result !== undefined) style = result;
- }
- if (style == "def" && parserConfig.styleDefs === false) style = "variable";
- state.startOfLine = false;
- state.prevToken = isDefKeyword ? "def" : style || curPunc;
- maybeEOL(stream, state);
- return style;
- },
- indent: function(state, textAfter) {
- if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
- var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
- var closing = firstChar == ctx.type;
- if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
- if (parserConfig.dontIndentStatements)
- while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info))
- ctx = ctx.prev
- if (hooks.indent) {
- var hook = hooks.indent(state, ctx, textAfter, indentUnit);
- if (typeof hook == "number") return hook
- }
- var switchBlock = ctx.prev && ctx.prev.info == "switch";
- if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
- while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
- return ctx.indented
- }
- if (ctx.type == "statement")
- return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
- if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
- return ctx.column + (closing ? 0 : 1);
- if (ctx.type == ")" && !closing)
- return ctx.indented + statementIndentUnit;
- return ctx.indented + (closing ? 0 : indentUnit) +
- (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
- },
- electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
- blockCommentStart: "/*",
- blockCommentEnd: "*/",
- blockCommentContinue: " * ",
- lineComment: "//",
- fold: "brace"
- };
- });
- function words(str) {
- var obj = {}, words = str.split(" ");
- for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
- return obj;
- }
- function contains(words, word) {
- if (typeof words === "function") {
- return words(word);
- } else {
- return words.propertyIsEnumerable(word);
- }
- }
- var cKeywords = "auto if break case register continue return default do sizeof " +
- "static else struct switch extern typedef union for goto while enum const " +
- "volatile inline restrict asm fortran";
- // Keywords from https://en.cppreference.com/w/cpp/keyword includes C++20.
- var cppKeywords = "alignas alignof and and_eq audit axiom bitand bitor catch " +
- "class compl concept constexpr const_cast decltype delete dynamic_cast " +
- "explicit export final friend import module mutable namespace new noexcept " +
- "not not_eq operator or or_eq override private protected public " +
- "reinterpret_cast requires static_assert static_cast template this " +
- "thread_local throw try typeid typename using virtual xor xor_eq";
- var objCKeywords = "bycopy byref in inout oneway out self super atomic nonatomic retain copy " +
- "readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd " +
- "@interface @implementation @end @protocol @encode @property @synthesize @dynamic @class " +
- "@public @package @private @protected @required @optional @try @catch @finally @import " +
- "@selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available";
- var objCBuiltins = "FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION " +
- " NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER " +
- "NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION " +
- "NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT"
- // Do not use this. Use the cTypes function below. This is global just to avoid
- // excessive calls when cTypes is being called multiple times during a parse.
- var basicCTypes = words("int long char short double float unsigned signed " +
- "void bool");
- // Do not use this. Use the objCTypes function below. This is global just to avoid
- // excessive calls when objCTypes is being called multiple times during a parse.
- var basicObjCTypes = words("SEL instancetype id Class Protocol BOOL");
- // Returns true if identifier is a "C" type.
- // C type is defined as those that are reserved by the compiler (basicTypes),
- // and those that end in _t (Reserved by POSIX for types)
- // http://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html
- function cTypes(identifier) {
- return contains(basicCTypes, identifier) || /.+_t$/.test(identifier);
- }
- // Returns true if identifier is a "Objective C" type.
- function objCTypes(identifier) {
- return cTypes(identifier) || contains(basicObjCTypes, identifier);
- }
- var cBlockKeywords = "case do else for if switch while struct enum union";
- var cDefKeywords = "struct enum union";
- function cppHook(stream, state) {
- if (!state.startOfLine) return false
- for (var ch, next = null; ch = stream.peek();) {
- if (ch == "\\" && stream.match(/^.$/)) {
- next = cppHook
- break
- } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) {
- break
- }
- stream.next()
- }
- state.tokenize = next
- return "meta"
- }
- function pointerHook(_stream, state) {
- if (state.prevToken == "type") return "type";
- return false;
- }
- // For C and C++ (and ObjC): identifiers starting with __
- // or _ followed by a capital letter are reserved for the compiler.
- function cIsReservedIdentifier(token) {
- if (!token || token.length < 2) return false;
- if (token[0] != '_') return false;
- return (token[1] == '_') || (token[1] !== token[1].toLowerCase());
- }
- function cpp14Literal(stream) {
- stream.eatWhile(/[\w\.']/);
- return "number";
- }
- function cpp11StringHook(stream, state) {
- stream.backUp(1);
- // Raw strings.
- if (stream.match(/^(?:R|u8R|uR|UR|LR)/)) {
- var match = stream.match(/^"([^\s\\()]{0,16})\(/);
- if (!match) {
- return false;
- }
- state.cpp11RawStringDelim = match[1];
- state.tokenize = tokenRawString;
- return tokenRawString(stream, state);
- }
- // Unicode strings/chars.
- if (stream.match(/^(?:u8|u|U|L)/)) {
- if (stream.match(/^["']/, /* eat */ false)) {
- return "string";
- }
- return false;
- }
- // Ignore this hook.
- stream.next();
- return false;
- }
- function cppLooksLikeConstructor(word) {
- var lastTwo = /(\w+)::~?(\w+)$/.exec(word);
- return lastTwo && lastTwo[1] == lastTwo[2];
- }
- // C#-style strings where "" escapes a quote.
- function tokenAtString(stream, state) {
- var next;
- while ((next = stream.next()) != null) {
- if (next == '"' && !stream.eat('"')) {
- state.tokenize = null;
- break;
- }
- }
- return "string";
- }
- // C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where
- // <delim> can be a string up to 16 characters long.
- function tokenRawString(stream, state) {
- // Escape characters that have special regex meanings.
- var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&');
- var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
- if (match)
- state.tokenize = null;
- else
- stream.skipToEnd();
- return "string";
- }
- function def(mimes, mode) {
- if (typeof mimes == "string") mimes = [mimes];
- var words = [];
- function add(obj) {
- if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
- words.push(prop);
- }
- add(mode.keywords);
- add(mode.types);
- add(mode.builtin);
- add(mode.atoms);
- if (words.length) {
- mode.helperType = mimes[0];
- CodeMirror.registerHelper("hintWords", mimes[0], words);
- }
- for (var i = 0; i < mimes.length; ++i)
- CodeMirror.defineMIME(mimes[i], mode);
- }
- def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
- name: "clike",
- keywords: words(cKeywords),
- types: cTypes,
- blockKeywords: words(cBlockKeywords),
- defKeywords: words(cDefKeywords),
- typeFirstDefinitions: true,
- atoms: words("NULL true false"),
- isReservedIdentifier: cIsReservedIdentifier,
- hooks: {
- "#": cppHook,
- "*": pointerHook,
- },
- modeProps: {fold: ["brace", "include"]}
- });
- def(["text/x-c++src", "text/x-c++hdr"], {
- name: "clike",
- keywords: words(cKeywords + " " + cppKeywords),
- types: cTypes,
- blockKeywords: words(cBlockKeywords + " class try catch"),
- defKeywords: words(cDefKeywords + " class namespace"),
- typeFirstDefinitions: true,
- atoms: words("true false NULL nullptr"),
- dontIndentStatements: /^template$/,
- isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
- isReservedIdentifier: cIsReservedIdentifier,
- hooks: {
- "#": cppHook,
- "*": pointerHook,
- "u": cpp11StringHook,
- "U": cpp11StringHook,
- "L": cpp11StringHook,
- "R": cpp11StringHook,
- "0": cpp14Literal,
- "1": cpp14Literal,
- "2": cpp14Literal,
- "3": cpp14Literal,
- "4": cpp14Literal,
- "5": cpp14Literal,
- "6": cpp14Literal,
- "7": cpp14Literal,
- "8": cpp14Literal,
- "9": cpp14Literal,
- token: function(stream, state, style) {
- if (style == "variable" && stream.peek() == "(" &&
- (state.prevToken == ";" || state.prevToken == null ||
- state.prevToken == "}") &&
- cppLooksLikeConstructor(stream.current()))
- return "def";
- }
- },
- namespaceSeparator: "::",
- modeProps: {fold: ["brace", "include"]}
- });
- def("text/x-java", {
- name: "clike",
- keywords: words("abstract assert break case catch class const continue default " +
- "do else enum extends final finally for goto if implements import " +
- "instanceof interface native new package private protected public " +
- "return static strictfp super switch synchronized this throw throws transient " +
- "try volatile while @interface"),
- types: words("var byte short int long float double boolean char void Boolean Byte Character Double Float " +
- "Integer Long Number Object Short String StringBuffer StringBuilder Void"),
- blockKeywords: words("catch class do else finally for if switch try while"),
- defKeywords: words("class interface enum @interface"),
- typeFirstDefinitions: true,
- atoms: words("true false null"),
- number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
- hooks: {
- "@": function(stream) {
- // Don't match the @interface keyword.
- if (stream.match('interface', false)) return false;
- stream.eatWhile(/[\w\$_]/);
- return "meta";
- },
- '"': function(stream, state) {
- if (!stream.match('""\n')) return false;
- state.tokenize = tokenTripleString;
- return state.tokenize(stream, state);
- }
- },
- modeProps: {fold: ["brace", "import"]}
- });
- def("text/x-csharp", {
- name: "clike",
- keywords: words("abstract as async await base break case catch checked class const continue" +
- " default delegate do else enum event explicit extern finally fixed for" +
- " foreach goto if implicit in interface internal is lock namespace new" +
- " operator out override params private protected public readonly ref return sealed" +
- " sizeof stackalloc static struct switch this throw try typeof unchecked" +
- " unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
- " global group into join let orderby partial remove select set value var yield"),
- types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
- " Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
- " UInt64 bool byte char decimal double short int long object" +
- " sbyte float string ushort uint ulong"),
- blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
- defKeywords: words("class interface namespace struct var"),
- typeFirstDefinitions: true,
- atoms: words("true false null"),
- hooks: {
- "@": function(stream, state) {
- if (stream.eat('"')) {
- state.tokenize = tokenAtString;
- return tokenAtString(stream, state);
- }
- stream.eatWhile(/[\w\$_]/);
- return "meta";
- }
- }
- });
- function tokenTripleString(stream, state) {
- var escaped = false;
- while (!stream.eol()) {
- if (!escaped && stream.match('"""')) {
- state.tokenize = null;
- break;
- }
- escaped = stream.next() == "\\" && !escaped;
- }
- return "string";
- }
- function tokenNestedComment(depth) {
- return function (stream, state) {
- var ch
- while (ch = stream.next()) {
- if (ch == "*" && stream.eat("/")) {
- if (depth == 1) {
- state.tokenize = null
- break
- } else {
- state.tokenize = tokenNestedComment(depth - 1)
- return state.tokenize(stream, state)
- }
- } else if (ch == "/" && stream.eat("*")) {
- state.tokenize = tokenNestedComment(depth + 1)
- return state.tokenize(stream, state)
- }
- }
- return "comment"
- }
- }
- def("text/x-scala", {
- name: "clike",
- keywords: words(
- /* scala */
- "abstract case catch class def do else extends final finally for forSome if " +
- "implicit import lazy match new null object override package private protected return " +
- "sealed super this throw trait try type val var while with yield _ " +
- /* package scala */
- "assert assume require print println printf readLine readBoolean readByte readShort " +
- "readChar readInt readLong readFloat readDouble"
- ),
- types: words(
- "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
- "Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " +
- "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
- "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
- "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
- /* package java.lang */
- "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
- "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
- "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
- "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
- ),
- multiLineStrings: true,
- blockKeywords: words("catch class enum do else finally for forSome if match switch try while"),
- defKeywords: words("class enum def object package trait type val var"),
- atoms: words("true false null"),
- indentStatements: false,
- indentSwitch: false,
- isOperatorChar: /[+\-*&%=<>!?|\/#:@]/,
- hooks: {
- "@": function(stream) {
- stream.eatWhile(/[\w\$_]/);
- return "meta";
- },
- '"': function(stream, state) {
- if (!stream.match('""')) return false;
- state.tokenize = tokenTripleString;
- return state.tokenize(stream, state);
- },
- "'": function(stream) {
- stream.eatWhile(/[\w\$_\xa1-\uffff]/);
- return "atom";
- },
- "=": function(stream, state) {
- var cx = state.context
- if (cx.type == "}" && cx.align && stream.eat(">")) {
- state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev)
- return "operator"
- } else {
- return false
- }
- },
- "/": function(stream, state) {
- if (!stream.eat("*")) return false
- state.tokenize = tokenNestedComment(1)
- return state.tokenize(stream, state)
- }
- },
- modeProps: {closeBrackets: {pairs: '()[]{}""', triples: '"'}}
- });
- function tokenKotlinString(tripleString){
- return function (stream, state) {
- var escaped = false, next, end = false;
- while (!stream.eol()) {
- if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
- if (tripleString && stream.match('"""')) {end = true; break;}
- next = stream.next();
- if(!escaped && next == "$" && stream.match('{'))
- stream.skipTo("}");
- escaped = !escaped && next == "\\" && !tripleString;
- }
- if (end || !tripleString)
- state.tokenize = null;
- return "string";
- }
- }
- def("text/x-kotlin", {
- name: "clike",
- keywords: words(
- /*keywords*/
- "package as typealias class interface this super val operator " +
- "var fun for is in This throw return annotation " +
- "break continue object if else while do try when !in !is as? " +
- /*soft keywords*/
- "file import where by get set abstract enum open inner override private public internal " +
- "protected catch finally out final vararg reified dynamic companion constructor init " +
- "sealed field property receiver param sparam lateinit data inline noinline tailrec " +
- "external annotation crossinline const operator infix suspend actual expect setparam value"
- ),
- types: words(
- /* package java.lang */
- "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
- "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
- "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
- "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray " +
- "ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy " +
- "LazyThreadSafetyMode LongArray Nothing ShortArray Unit"
- ),
- intendSwitch: false,
- indentStatements: false,
- multiLineStrings: true,
- number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
- blockKeywords: words("catch class do else finally for if where try while enum"),
- defKeywords: words("class val var object interface fun"),
- atoms: words("true false null this"),
- hooks: {
- "@": function(stream) {
- stream.eatWhile(/[\w\$_]/);
- return "meta";
- },
- '*': function(_stream, state) {
- return state.prevToken == '.' ? 'variable' : 'operator';
- },
- '"': function(stream, state) {
- state.tokenize = tokenKotlinString(stream.match('""'));
- return state.tokenize(stream, state);
- },
- "/": function(stream, state) {
- if (!stream.eat("*")) return false;
- state.tokenize = tokenNestedComment(1);
- return state.tokenize(stream, state)
- },
- indent: function(state, ctx, textAfter, indentUnit) {
- var firstChar = textAfter && textAfter.charAt(0);
- if ((state.prevToken == "}" || state.prevToken == ")") && textAfter == "")
- return state.indented;
- if ((state.prevToken == "operator" && textAfter != "}" && state.context.type != "}") ||
- state.prevToken == "variable" && firstChar == "." ||
- (state.prevToken == "}" || state.prevToken == ")") && firstChar == ".")
- return indentUnit * 2 + ctx.indented;
- if (ctx.align && ctx.type == "}")
- return ctx.indented + (state.context.type == (textAfter || "").charAt(0) ? 0 : indentUnit);
- }
- },
- modeProps: {closeBrackets: {triples: '"'}}
- });
- def(["x-shader/x-vertex", "x-shader/x-fragment"], {
- name: "clike",
- keywords: words("sampler1D sampler2D sampler3D samplerCube " +
- "sampler1DShadow sampler2DShadow " +
- "const attribute uniform varying " +
- "break continue discard return " +
- "for while do if else struct " +
- "in out inout"),
- types: words("float int bool void " +
- "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
- "mat2 mat3 mat4"),
- blockKeywords: words("for while do if else struct"),
- builtin: words("radians degrees sin cos tan asin acos atan " +
- "pow exp log exp2 sqrt inversesqrt " +
- "abs sign floor ceil fract mod min max clamp mix step smoothstep " +
- "length distance dot cross normalize ftransform faceforward " +
- "reflect refract matrixCompMult " +
- "lessThan lessThanEqual greaterThan greaterThanEqual " +
- "equal notEqual any all not " +
- "texture1D texture1DProj texture1DLod texture1DProjLod " +
- "texture2D texture2DProj texture2DLod texture2DProjLod " +
- "texture3D texture3DProj texture3DLod texture3DProjLod " +
- "textureCube textureCubeLod " +
- "shadow1D shadow2D shadow1DProj shadow2DProj " +
- "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
- "dFdx dFdy fwidth " +
- "noise1 noise2 noise3 noise4"),
- atoms: words("true false " +
- "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
- "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
- "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
- "gl_FogCoord gl_PointCoord " +
- "gl_Position gl_PointSize gl_ClipVertex " +
- "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
- "gl_TexCoord gl_FogFragCoord " +
- "gl_FragCoord gl_FrontFacing " +
- "gl_FragData gl_FragDepth " +
- "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
- "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
- "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
- "gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
- "gl_ProjectionMatrixInverseTranspose " +
- "gl_ModelViewProjectionMatrixInverseTranspose " +
- "gl_TextureMatrixInverseTranspose " +
- "gl_NormalScale gl_DepthRange gl_ClipPlane " +
- "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
- "gl_FrontLightModelProduct gl_BackLightModelProduct " +
- "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
- "gl_FogParameters " +
- "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
- "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
- "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
- "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
- "gl_MaxDrawBuffers"),
- indentSwitch: false,
- hooks: {"#": cppHook},
- modeProps: {fold: ["brace", "include"]}
- });
- def("text/x-nesc", {
- name: "clike",
- keywords: words(cKeywords + " as atomic async call command component components configuration event generic " +
- "implementation includes interface module new norace nx_struct nx_union post provides " +
- "signal task uses abstract extends"),
- types: cTypes,
- blockKeywords: words(cBlockKeywords),
- atoms: words("null true false"),
- hooks: {"#": cppHook},
- modeProps: {fold: ["brace", "include"]}
- });
- def("text/x-objectivec", {
- name: "clike",
- keywords: words(cKeywords + " " + objCKeywords),
- types: objCTypes,
- builtin: words(objCBuiltins),
- blockKeywords: words(cBlockKeywords + " @synthesize @try @catch @finally @autoreleasepool @synchronized"),
- defKeywords: words(cDefKeywords + " @interface @implementation @protocol @class"),
- dontIndentStatements: /^@.*$/,
- typeFirstDefinitions: true,
- atoms: words("YES NO NULL Nil nil true false nullptr"),
- isReservedIdentifier: cIsReservedIdentifier,
- hooks: {
- "#": cppHook,
- "*": pointerHook,
- },
- modeProps: {fold: ["brace", "include"]}
- });
- def("text/x-objectivec++", {
- name: "clike",
- keywords: words(cKeywords + " " + objCKeywords + " " + cppKeywords),
- types: objCTypes,
- builtin: words(objCBuiltins),
- blockKeywords: words(cBlockKeywords + " @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),
- defKeywords: words(cDefKeywords + " @interface @implementation @protocol @class class namespace"),
- dontIndentStatements: /^@.*$|^template$/,
- typeFirstDefinitions: true,
- atoms: words("YES NO NULL Nil nil true false nullptr"),
- isReservedIdentifier: cIsReservedIdentifier,
- hooks: {
- "#": cppHook,
- "*": pointerHook,
- "u": cpp11StringHook,
- "U": cpp11StringHook,
- "L": cpp11StringHook,
- "R": cpp11StringHook,
- "0": cpp14Literal,
- "1": cpp14Literal,
- "2": cpp14Literal,
- "3": cpp14Literal,
- "4": cpp14Literal,
- "5": cpp14Literal,
- "6": cpp14Literal,
- "7": cpp14Literal,
- "8": cpp14Literal,
- "9": cpp14Literal,
- token: function(stream, state, style) {
- if (style == "variable" && stream.peek() == "(" &&
- (state.prevToken == ";" || state.prevToken == null ||
- state.prevToken == "}") &&
- cppLooksLikeConstructor(stream.current()))
- return "def";
- }
- },
- namespaceSeparator: "::",
- modeProps: {fold: ["brace", "include"]}
- });
- def("text/x-squirrel", {
- name: "clike",
- keywords: words("base break clone continue const default delete enum extends function in class" +
- " foreach local resume return this throw typeof yield constructor instanceof static"),
- types: cTypes,
- blockKeywords: words("case catch class else for foreach if switch try while"),
- defKeywords: words("function local class"),
- typeFirstDefinitions: true,
- atoms: words("true false null"),
- hooks: {"#": cppHook},
- modeProps: {fold: ["brace", "include"]}
- });
- // Ceylon Strings need to deal with interpolation
- var stringTokenizer = null;
- function tokenCeylonString(type) {
- return function(stream, state) {
- var escaped = false, next, end = false;
- while (!stream.eol()) {
- if (!escaped && stream.match('"') &&
- (type == "single" || stream.match('""'))) {
- end = true;
- break;
- }
- if (!escaped && stream.match('``')) {
- stringTokenizer = tokenCeylonString(type);
- end = true;
- break;
- }
- next = stream.next();
- escaped = type == "single" && !escaped && next == "\\";
- }
- if (end)
- state.tokenize = null;
- return "string";
- }
- }
- def("text/x-ceylon", {
- name: "clike",
- keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" +
- " exists extends finally for function given if import in interface is let module new" +
- " nonempty object of out outer package return satisfies super switch then this throw" +
- " try value void while"),
- types: function(word) {
- // In Ceylon all identifiers that start with an uppercase are types
- var first = word.charAt(0);
- return (first === first.toUpperCase() && first !== first.toLowerCase());
- },
- blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"),
- defKeywords: words("class dynamic function interface module object package value"),
- builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" +
- " native optional sealed see serializable shared suppressWarnings tagged throws variable"),
- isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
- isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
- numberStart: /[\d#$]/,
- number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
- multiLineStrings: true,
- typeFirstDefinitions: true,
- atoms: words("true false null larger smaller equal empty finished"),
- indentSwitch: false,
- styleDefs: false,
- hooks: {
- "@": function(stream) {
- stream.eatWhile(/[\w\$_]/);
- return "meta";
- },
- '"': function(stream, state) {
- state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single");
- return state.tokenize(stream, state);
- },
- '`': function(stream, state) {
- if (!stringTokenizer || !stream.match('`')) return false;
- state.tokenize = stringTokenizer;
- stringTokenizer = null;
- return state.tokenize(stream, state);
- },
- "'": function(stream) {
- stream.eatWhile(/[\w\$_\xa1-\uffff]/);
- return "atom";
- },
- token: function(_stream, state, style) {
- if ((style == "variable" || style == "type") &&
- state.prevToken == ".") {
- return "variable-2";
- }
- }
- },
- modeProps: {
- fold: ["brace", "import"],
- closeBrackets: {triples: '"'}
- }
- });
- });
- /***/ }),
- /***/ 36629:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.defineMode("css", function(config, parserConfig) {
- var inline = parserConfig.inline
- if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
- var indentUnit = config.indentUnit,
- tokenHooks = parserConfig.tokenHooks,
- documentTypes = parserConfig.documentTypes || {},
- mediaTypes = parserConfig.mediaTypes || {},
- mediaFeatures = parserConfig.mediaFeatures || {},
- mediaValueKeywords = parserConfig.mediaValueKeywords || {},
- propertyKeywords = parserConfig.propertyKeywords || {},
- nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
- fontProperties = parserConfig.fontProperties || {},
- counterDescriptors = parserConfig.counterDescriptors || {},
- colorKeywords = parserConfig.colorKeywords || {},
- valueKeywords = parserConfig.valueKeywords || {},
- allowNested = parserConfig.allowNested,
- lineComment = parserConfig.lineComment,
- supportsAtComponent = parserConfig.supportsAtComponent === true,
- highlightNonStandardPropertyKeywords = config.highlightNonStandardPropertyKeywords !== false;
- var type, override;
- function ret(style, tp) { type = tp; return style; }
- // Tokenizers
- function tokenBase(stream, state) {
- var ch = stream.next();
- if (tokenHooks[ch]) {
- var result = tokenHooks[ch](stream, state);
- if (result !== false) return result;
- }
- if (ch == "@") {
- stream.eatWhile(/[\w\\\-]/);
- return ret("def", stream.current());
- } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) {
- return ret(null, "compare");
- } else if (ch == "\"" || ch == "'") {
- state.tokenize = tokenString(ch);
- return state.tokenize(stream, state);
- } else if (ch == "#") {
- stream.eatWhile(/[\w\\\-]/);
- return ret("atom", "hash");
- } else if (ch == "!") {
- stream.match(/^\s*\w*/);
- return ret("keyword", "important");
- } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) {
- stream.eatWhile(/[\w.%]/);
- return ret("number", "unit");
- } else if (ch === "-") {
- if (/[\d.]/.test(stream.peek())) {
- stream.eatWhile(/[\w.%]/);
- return ret("number", "unit");
- } else if (stream.match(/^-[\w\\\-]*/)) {
- stream.eatWhile(/[\w\\\-]/);
- if (stream.match(/^\s*:/, false))
- return ret("variable-2", "variable-definition");
- return ret("variable-2", "variable");
- } else if (stream.match(/^\w+-/)) {
- return ret("meta", "meta");
- }
- } else if (/[,+>*\/]/.test(ch)) {
- return ret(null, "select-op");
- } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
- return ret("qualifier", "qualifier");
- } else if (/[:;{}\[\]\(\)]/.test(ch)) {
- return ret(null, ch);
- } else if (stream.match(/^[\w-.]+(?=\()/)) {
- if (/^(url(-prefix)?|domain|regexp)$/i.test(stream.current())) {
- state.tokenize = tokenParenthesized;
- }
- return ret("variable callee", "variable");
- } else if (/[\w\\\-]/.test(ch)) {
- stream.eatWhile(/[\w\\\-]/);
- return ret("property", "word");
- } else {
- return ret(null, null);
- }
- }
- function tokenString(quote) {
- return function(stream, state) {
- var escaped = false, ch;
- while ((ch = stream.next()) != null) {
- if (ch == quote && !escaped) {
- if (quote == ")") stream.backUp(1);
- break;
- }
- escaped = !escaped && ch == "\\";
- }
- if (ch == quote || !escaped && quote != ")") state.tokenize = null;
- return ret("string", "string");
- };
- }
- function tokenParenthesized(stream, state) {
- stream.next(); // Must be '('
- if (!stream.match(/^\s*[\"\')]/, false))
- state.tokenize = tokenString(")");
- else
- state.tokenize = null;
- return ret(null, "(");
- }
- // Context management
- function Context(type, indent, prev) {
- this.type = type;
- this.indent = indent;
- this.prev = prev;
- }
- function pushContext(state, stream, type, indent) {
- state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);
- return type;
- }
- function popContext(state) {
- if (state.context.prev)
- state.context = state.context.prev;
- return state.context.type;
- }
- function pass(type, stream, state) {
- return states[state.context.type](type, stream, state);
- }
- function popAndPass(type, stream, state, n) {
- for (var i = n || 1; i > 0; i--)
- state.context = state.context.prev;
- return pass(type, stream, state);
- }
- // Parser
- function wordAsValue(stream) {
- var word = stream.current().toLowerCase();
- if (valueKeywords.hasOwnProperty(word))
- override = "atom";
- else if (colorKeywords.hasOwnProperty(word))
- override = "keyword";
- else
- override = "variable";
- }
- var states = {};
- states.top = function(type, stream, state) {
- if (type == "{") {
- return pushContext(state, stream, "block");
- } else if (type == "}" && state.context.prev) {
- return popContext(state);
- } else if (supportsAtComponent && /@component/i.test(type)) {
- return pushContext(state, stream, "atComponentBlock");
- } else if (/^@(-moz-)?document$/i.test(type)) {
- return pushContext(state, stream, "documentTypes");
- } else if (/^@(media|supports|(-moz-)?document|import)$/i.test(type)) {
- return pushContext(state, stream, "atBlock");
- } else if (/^@(font-face|counter-style)/i.test(type)) {
- state.stateArg = type;
- return "restricted_atBlock_before";
- } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type)) {
- return "keyframes";
- } else if (type && type.charAt(0) == "@") {
- return pushContext(state, stream, "at");
- } else if (type == "hash") {
- override = "builtin";
- } else if (type == "word") {
- override = "tag";
- } else if (type == "variable-definition") {
- return "maybeprop";
- } else if (type == "interpolation") {
- return pushContext(state, stream, "interpolation");
- } else if (type == ":") {
- return "pseudo";
- } else if (allowNested && type == "(") {
- return pushContext(state, stream, "parens");
- }
- return state.context.type;
- };
- states.block = function(type, stream, state) {
- if (type == "word") {
- var word = stream.current().toLowerCase();
- if (propertyKeywords.hasOwnProperty(word)) {
- override = "property";
- return "maybeprop";
- } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
- override = highlightNonStandardPropertyKeywords ? "string-2" : "property";
- return "maybeprop";
- } else if (allowNested) {
- override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag";
- return "block";
- } else {
- override += " error";
- return "maybeprop";
- }
- } else if (type == "meta") {
- return "block";
- } else if (!allowNested && (type == "hash" || type == "qualifier")) {
- override = "error";
- return "block";
- } else {
- return states.top(type, stream, state);
- }
- };
- states.maybeprop = function(type, stream, state) {
- if (type == ":") return pushContext(state, stream, "prop");
- return pass(type, stream, state);
- };
- states.prop = function(type, stream, state) {
- if (type == ";") return popContext(state);
- if (type == "{" && allowNested) return pushContext(state, stream, "propBlock");
- if (type == "}" || type == "{") return popAndPass(type, stream, state);
- if (type == "(") return pushContext(state, stream, "parens");
- if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {
- override += " error";
- } else if (type == "word") {
- wordAsValue(stream);
- } else if (type == "interpolation") {
- return pushContext(state, stream, "interpolation");
- }
- return "prop";
- };
- states.propBlock = function(type, _stream, state) {
- if (type == "}") return popContext(state);
- if (type == "word") { override = "property"; return "maybeprop"; }
- return state.context.type;
- };
- states.parens = function(type, stream, state) {
- if (type == "{" || type == "}") return popAndPass(type, stream, state);
- if (type == ")") return popContext(state);
- if (type == "(") return pushContext(state, stream, "parens");
- if (type == "interpolation") return pushContext(state, stream, "interpolation");
- if (type == "word") wordAsValue(stream);
- return "parens";
- };
- states.pseudo = function(type, stream, state) {
- if (type == "meta") return "pseudo";
- if (type == "word") {
- override = "variable-3";
- return state.context.type;
- }
- return pass(type, stream, state);
- };
- states.documentTypes = function(type, stream, state) {
- if (type == "word" && documentTypes.hasOwnProperty(stream.current())) {
- override = "tag";
- return state.context.type;
- } else {
- return states.atBlock(type, stream, state);
- }
- };
- states.atBlock = function(type, stream, state) {
- if (type == "(") return pushContext(state, stream, "atBlock_parens");
- if (type == "}" || type == ";") return popAndPass(type, stream, state);
- if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");
- if (type == "interpolation") return pushContext(state, stream, "interpolation");
- if (type == "word") {
- var word = stream.current().toLowerCase();
- if (word == "only" || word == "not" || word == "and" || word == "or")
- override = "keyword";
- else if (mediaTypes.hasOwnProperty(word))
- override = "attribute";
- else if (mediaFeatures.hasOwnProperty(word))
- override = "property";
- else if (mediaValueKeywords.hasOwnProperty(word))
- override = "keyword";
- else if (propertyKeywords.hasOwnProperty(word))
- override = "property";
- else if (nonStandardPropertyKeywords.hasOwnProperty(word))
- override = highlightNonStandardPropertyKeywords ? "string-2" : "property";
- else if (valueKeywords.hasOwnProperty(word))
- override = "atom";
- else if (colorKeywords.hasOwnProperty(word))
- override = "keyword";
- else
- override = "error";
- }
- return state.context.type;
- };
- states.atComponentBlock = function(type, stream, state) {
- if (type == "}")
- return popAndPass(type, stream, state);
- if (type == "{")
- return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false);
- if (type == "word")
- override = "error";
- return state.context.type;
- };
- states.atBlock_parens = function(type, stream, state) {
- if (type == ")") return popContext(state);
- if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);
- return states.atBlock(type, stream, state);
- };
- states.restricted_atBlock_before = function(type, stream, state) {
- if (type == "{")
- return pushContext(state, stream, "restricted_atBlock");
- if (type == "word" && state.stateArg == "@counter-style") {
- override = "variable";
- return "restricted_atBlock_before";
- }
- return pass(type, stream, state);
- };
- states.restricted_atBlock = function(type, stream, state) {
- if (type == "}") {
- state.stateArg = null;
- return popContext(state);
- }
- if (type == "word") {
- if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||
- (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))
- override = "error";
- else
- override = "property";
- return "maybeprop";
- }
- return "restricted_atBlock";
- };
- states.keyframes = function(type, stream, state) {
- if (type == "word") { override = "variable"; return "keyframes"; }
- if (type == "{") return pushContext(state, stream, "top");
- return pass(type, stream, state);
- };
- states.at = function(type, stream, state) {
- if (type == ";") return popContext(state);
- if (type == "{" || type == "}") return popAndPass(type, stream, state);
- if (type == "word") override = "tag";
- else if (type == "hash") override = "builtin";
- return "at";
- };
- states.interpolation = function(type, stream, state) {
- if (type == "}") return popContext(state);
- if (type == "{" || type == ";") return popAndPass(type, stream, state);
- if (type == "word") override = "variable";
- else if (type != "variable" && type != "(" && type != ")") override = "error";
- return "interpolation";
- };
- return {
- startState: function(base) {
- return {tokenize: null,
- state: inline ? "block" : "top",
- stateArg: null,
- context: new Context(inline ? "block" : "top", base || 0, null)};
- },
- token: function(stream, state) {
- if (!state.tokenize && stream.eatSpace()) return null;
- var style = (state.tokenize || tokenBase)(stream, state);
- if (style && typeof style == "object") {
- type = style[1];
- style = style[0];
- }
- override = style;
- if (type != "comment")
- state.state = states[state.state](type, stream, state);
- return override;
- },
- indent: function(state, textAfter) {
- var cx = state.context, ch = textAfter && textAfter.charAt(0);
- var indent = cx.indent;
- if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
- if (cx.prev) {
- if (ch == "}" && (cx.type == "block" || cx.type == "top" ||
- cx.type == "interpolation" || cx.type == "restricted_atBlock")) {
- // Resume indentation from parent context.
- cx = cx.prev;
- indent = cx.indent;
- } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
- ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
- // Dedent relative to current context.
- indent = Math.max(0, cx.indent - indentUnit);
- }
- }
- return indent;
- },
- electricChars: "}",
- blockCommentStart: "/*",
- blockCommentEnd: "*/",
- blockCommentContinue: " * ",
- lineComment: lineComment,
- fold: "brace"
- };
- });
- function keySet(array) {
- var keys = {};
- for (var i = 0; i < array.length; ++i) {
- keys[array[i].toLowerCase()] = true;
- }
- return keys;
- }
- var documentTypes_ = [
- "domain", "regexp", "url", "url-prefix"
- ], documentTypes = keySet(documentTypes_);
- var mediaTypes_ = [
- "all", "aural", "braille", "handheld", "print", "projection", "screen",
- "tty", "tv", "embossed"
- ], mediaTypes = keySet(mediaTypes_);
- var mediaFeatures_ = [
- "width", "min-width", "max-width", "height", "min-height", "max-height",
- "device-width", "min-device-width", "max-device-width", "device-height",
- "min-device-height", "max-device-height", "aspect-ratio",
- "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
- "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
- "max-color", "color-index", "min-color-index", "max-color-index",
- "monochrome", "min-monochrome", "max-monochrome", "resolution",
- "min-resolution", "max-resolution", "scan", "grid", "orientation",
- "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
- "pointer", "any-pointer", "hover", "any-hover", "prefers-color-scheme",
- "dynamic-range", "video-dynamic-range"
- ], mediaFeatures = keySet(mediaFeatures_);
- var mediaValueKeywords_ = [
- "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
- "interlace", "progressive",
- "dark", "light",
- "standard", "high"
- ], mediaValueKeywords = keySet(mediaValueKeywords_);
- var propertyKeywords_ = [
- "align-content", "align-items", "align-self", "alignment-adjust",
- "alignment-baseline", "all", "anchor-point", "animation", "animation-delay",
- "animation-direction", "animation-duration", "animation-fill-mode",
- "animation-iteration-count", "animation-name", "animation-play-state",
- "animation-timing-function", "appearance", "azimuth", "backdrop-filter",
- "backface-visibility", "background", "background-attachment",
- "background-blend-mode", "background-clip", "background-color",
- "background-image", "background-origin", "background-position",
- "background-position-x", "background-position-y", "background-repeat",
- "background-size", "baseline-shift", "binding", "bleed", "block-size",
- "bookmark-label", "bookmark-level", "bookmark-state", "bookmark-target",
- "border", "border-bottom", "border-bottom-color", "border-bottom-left-radius",
- "border-bottom-right-radius", "border-bottom-style", "border-bottom-width",
- "border-collapse", "border-color", "border-image", "border-image-outset",
- "border-image-repeat", "border-image-slice", "border-image-source",
- "border-image-width", "border-left", "border-left-color", "border-left-style",
- "border-left-width", "border-radius", "border-right", "border-right-color",
- "border-right-style", "border-right-width", "border-spacing", "border-style",
- "border-top", "border-top-color", "border-top-left-radius",
- "border-top-right-radius", "border-top-style", "border-top-width",
- "border-width", "bottom", "box-decoration-break", "box-shadow", "box-sizing",
- "break-after", "break-before", "break-inside", "caption-side", "caret-color",
- "clear", "clip", "color", "color-profile", "column-count", "column-fill",
- "column-gap", "column-rule", "column-rule-color", "column-rule-style",
- "column-rule-width", "column-span", "column-width", "columns", "contain",
- "content", "counter-increment", "counter-reset", "crop", "cue", "cue-after",
- "cue-before", "cursor", "direction", "display", "dominant-baseline",
- "drop-initial-after-adjust", "drop-initial-after-align",
- "drop-initial-before-adjust", "drop-initial-before-align", "drop-initial-size",
- "drop-initial-value", "elevation", "empty-cells", "fit", "fit-content", "fit-position",
- "flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow",
- "flex-shrink", "flex-wrap", "float", "float-offset", "flow-from", "flow-into",
- "font", "font-family", "font-feature-settings", "font-kerning",
- "font-language-override", "font-optical-sizing", "font-size",
- "font-size-adjust", "font-stretch", "font-style", "font-synthesis",
- "font-variant", "font-variant-alternates", "font-variant-caps",
- "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric",
- "font-variant-position", "font-variation-settings", "font-weight", "gap",
- "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows",
- "grid-column", "grid-column-end", "grid-column-gap", "grid-column-start",
- "grid-gap", "grid-row", "grid-row-end", "grid-row-gap", "grid-row-start",
- "grid-template", "grid-template-areas", "grid-template-columns",
- "grid-template-rows", "hanging-punctuation", "height", "hyphens", "icon",
- "image-orientation", "image-rendering", "image-resolution", "inline-box-align",
- "inset", "inset-block", "inset-block-end", "inset-block-start", "inset-inline",
- "inset-inline-end", "inset-inline-start", "isolation", "justify-content",
- "justify-items", "justify-self", "left", "letter-spacing", "line-break",
- "line-height", "line-height-step", "line-stacking", "line-stacking-ruby",
- "line-stacking-shift", "line-stacking-strategy", "list-style",
- "list-style-image", "list-style-position", "list-style-type", "margin",
- "margin-bottom", "margin-left", "margin-right", "margin-top", "marks",
- "marquee-direction", "marquee-loop", "marquee-play-count", "marquee-speed",
- "marquee-style", "mask-clip", "mask-composite", "mask-image", "mask-mode",
- "mask-origin", "mask-position", "mask-repeat", "mask-size","mask-type",
- "max-block-size", "max-height", "max-inline-size",
- "max-width", "min-block-size", "min-height", "min-inline-size", "min-width",
- "mix-blend-mode", "move-to", "nav-down", "nav-index", "nav-left", "nav-right",
- "nav-up", "object-fit", "object-position", "offset", "offset-anchor",
- "offset-distance", "offset-path", "offset-position", "offset-rotate",
- "opacity", "order", "orphans", "outline", "outline-color", "outline-offset",
- "outline-style", "outline-width", "overflow", "overflow-style",
- "overflow-wrap", "overflow-x", "overflow-y", "padding", "padding-bottom",
- "padding-left", "padding-right", "padding-top", "page", "page-break-after",
- "page-break-before", "page-break-inside", "page-policy", "pause",
- "pause-after", "pause-before", "perspective", "perspective-origin", "pitch",
- "pitch-range", "place-content", "place-items", "place-self", "play-during",
- "position", "presentation-level", "punctuation-trim", "quotes",
- "region-break-after", "region-break-before", "region-break-inside",
- "region-fragment", "rendering-intent", "resize", "rest", "rest-after",
- "rest-before", "richness", "right", "rotate", "rotation", "rotation-point",
- "row-gap", "ruby-align", "ruby-overhang", "ruby-position", "ruby-span",
- "scale", "scroll-behavior", "scroll-margin", "scroll-margin-block",
- "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-bottom",
- "scroll-margin-inline", "scroll-margin-inline-end",
- "scroll-margin-inline-start", "scroll-margin-left", "scroll-margin-right",
- "scroll-margin-top", "scroll-padding", "scroll-padding-block",
- "scroll-padding-block-end", "scroll-padding-block-start",
- "scroll-padding-bottom", "scroll-padding-inline", "scroll-padding-inline-end",
- "scroll-padding-inline-start", "scroll-padding-left", "scroll-padding-right",
- "scroll-padding-top", "scroll-snap-align", "scroll-snap-type",
- "shape-image-threshold", "shape-inside", "shape-margin", "shape-outside",
- "size", "speak", "speak-as", "speak-header", "speak-numeral",
- "speak-punctuation", "speech-rate", "stress", "string-set", "tab-size",
- "table-layout", "target", "target-name", "target-new", "target-position",
- "text-align", "text-align-last", "text-combine-upright", "text-decoration",
- "text-decoration-color", "text-decoration-line", "text-decoration-skip",
- "text-decoration-skip-ink", "text-decoration-style", "text-emphasis",
- "text-emphasis-color", "text-emphasis-position", "text-emphasis-style",
- "text-height", "text-indent", "text-justify", "text-orientation",
- "text-outline", "text-overflow", "text-rendering", "text-shadow",
- "text-size-adjust", "text-space-collapse", "text-transform",
- "text-underline-position", "text-wrap", "top", "touch-action", "transform", "transform-origin",
- "transform-style", "transition", "transition-delay", "transition-duration",
- "transition-property", "transition-timing-function", "translate",
- "unicode-bidi", "user-select", "vertical-align", "visibility", "voice-balance",
- "voice-duration", "voice-family", "voice-pitch", "voice-range", "voice-rate",
- "voice-stress", "voice-volume", "volume", "white-space", "widows", "width",
- "will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index",
- // SVG-specific
- "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
- "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
- "color-interpolation", "color-interpolation-filters",
- "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering",
- "marker", "marker-end", "marker-mid", "marker-start", "paint-order", "shape-rendering", "stroke",
- "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin",
- "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering",
- "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal",
- "glyph-orientation-vertical", "text-anchor", "writing-mode",
- ], propertyKeywords = keySet(propertyKeywords_);
- var nonStandardPropertyKeywords_ = [
- "accent-color", "aspect-ratio", "border-block", "border-block-color", "border-block-end",
- "border-block-end-color", "border-block-end-style", "border-block-end-width",
- "border-block-start", "border-block-start-color", "border-block-start-style",
- "border-block-start-width", "border-block-style", "border-block-width",
- "border-inline", "border-inline-color", "border-inline-end",
- "border-inline-end-color", "border-inline-end-style",
- "border-inline-end-width", "border-inline-start", "border-inline-start-color",
- "border-inline-start-style", "border-inline-start-width",
- "border-inline-style", "border-inline-width", "content-visibility", "margin-block",
- "margin-block-end", "margin-block-start", "margin-inline", "margin-inline-end",
- "margin-inline-start", "overflow-anchor", "overscroll-behavior", "padding-block", "padding-block-end",
- "padding-block-start", "padding-inline", "padding-inline-end",
- "padding-inline-start", "scroll-snap-stop", "scrollbar-3d-light-color",
- "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
- "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
- "scrollbar-track-color", "searchfield-cancel-button", "searchfield-decoration",
- "searchfield-results-button", "searchfield-results-decoration", "shape-inside", "zoom"
- ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
- var fontProperties_ = [
- "font-display", "font-family", "src", "unicode-range", "font-variant",
- "font-feature-settings", "font-stretch", "font-weight", "font-style"
- ], fontProperties = keySet(fontProperties_);
- var counterDescriptors_ = [
- "additive-symbols", "fallback", "negative", "pad", "prefix", "range",
- "speak-as", "suffix", "symbols", "system"
- ], counterDescriptors = keySet(counterDescriptors_);
- var colorKeywords_ = [
- "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
- "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
- "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
- "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
- "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen",
- "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
- "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet",
- "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick",
- "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
- "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
- "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
- "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
- "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink",
- "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey",
- "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
- "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
- "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
- "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin",
- "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered",
- "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred",
- "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
- "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
- "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
- "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan",
- "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
- "whitesmoke", "yellow", "yellowgreen"
- ], colorKeywords = keySet(colorKeywords_);
- var valueKeywords_ = [
- "above", "absolute", "activeborder", "additive", "activecaption", "afar",
- "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate",
- "always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
- "arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page",
- "avoid-region", "axis-pan", "background", "backwards", "baseline", "below", "bidi-override", "binary",
- "bengali", "blink", "block", "block-axis", "blur", "bold", "bolder", "border", "border-box",
- "both", "bottom", "break", "break-all", "break-word", "brightness", "bullets", "button", "button-bevel",
- "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
- "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
- "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
- "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
- "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
- "compact", "condensed", "conic-gradient", "contain", "content", "contents",
- "content-box", "context-menu", "continuous", "contrast", "copy", "counter", "counters", "cover", "crop",
- "cross", "crosshair", "cubic-bezier", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
- "decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
- "destination-in", "destination-out", "destination-over", "devanagari", "difference",
- "disc", "discard", "disclosure-closed", "disclosure-open", "document",
- "dot-dash", "dot-dot-dash",
- "dotted", "double", "down", "drop-shadow", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
- "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
- "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
- "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
- "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
- "ethiopic-halehame-gez", "ethiopic-halehame-om-et",
- "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
- "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
- "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
- "extra-expanded", "fantasy", "fast", "fill", "fill-box", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
- "forwards", "from", "geometricPrecision", "georgian", "grayscale", "graytext", "grid", "groove",
- "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
- "help", "hidden", "hide", "higher", "highlight", "highlighttext",
- "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "hue-rotate", "icon", "ignore",
- "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
- "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
- "inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
- "italic", "japanese-formal", "japanese-informal", "justify", "kannada",
- "katakana", "katakana-iroha", "keep-all", "khmer",
- "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
- "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten",
- "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
- "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
- "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
- "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "manipulation", "match", "matrix", "matrix3d",
- "media-controls-background", "media-current-time-display",
- "media-fullscreen-button", "media-mute-button", "media-play-button",
- "media-return-to-realtime-button", "media-rewind-button",
- "media-seek-back-button", "media-seek-forward-button", "media-slider",
- "media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
- "media-volume-slider-container", "media-volume-sliderthumb", "medium",
- "menu", "menulist", "menulist-button", "menulist-text",
- "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
- "mix", "mongolian", "monospace", "move", "multiple", "multiple_mask_images", "multiply", "myanmar", "n-resize",
- "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
- "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
- "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "opacity", "open-quote",
- "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
- "outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
- "painted", "page", "paused", "persian", "perspective", "pinch-zoom", "plus-darker", "plus-lighter",
- "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d",
- "progress", "push-button", "radial-gradient", "radio", "read-only",
- "read-write", "read-write-plaintext-only", "rectangle", "region",
- "relative", "repeat", "repeating-linear-gradient", "repeating-radial-gradient",
- "repeating-conic-gradient", "repeat-x", "repeat-y", "reset", "reverse",
- "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
- "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
- "s-resize", "sans-serif", "saturate", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
- "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
- "searchfield-cancel-button", "searchfield-decoration",
- "searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
- "semi-condensed", "semi-expanded", "separate", "sepia", "serif", "show", "sidama",
- "simp-chinese-formal", "simp-chinese-informal", "single",
- "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
- "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
- "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
- "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
- "square-button", "start", "static", "status-bar", "stretch", "stroke", "stroke-box", "sub",
- "subpixel-antialiased", "svg_masks", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
- "table-caption", "table-cell", "table-column", "table-column-group",
- "table-footer-group", "table-header-group", "table-row", "table-row-group",
- "tamil",
- "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
- "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
- "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
- "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
- "trad-chinese-formal", "trad-chinese-informal", "transform",
- "translate", "translate3d", "translateX", "translateY", "translateZ",
- "transparent", "ultra-condensed", "ultra-expanded", "underline", "unidirectional-pan", "unset", "up",
- "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
- "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
- "var", "vertical", "vertical-text", "view-box", "visible", "visibleFill", "visiblePainted",
- "visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
- "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor",
- "xx-large", "xx-small"
- ], valueKeywords = keySet(valueKeywords_);
- var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)
- .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)
- .concat(valueKeywords_);
- CodeMirror.registerHelper("hintWords", "css", allWords);
- function tokenCComment(stream, state) {
- var maybeEnd = false, ch;
- while ((ch = stream.next()) != null) {
- if (maybeEnd && ch == "/") {
- state.tokenize = null;
- break;
- }
- maybeEnd = (ch == "*");
- }
- return ["comment", "comment"];
- }
- CodeMirror.defineMIME("text/css", {
- documentTypes: documentTypes,
- mediaTypes: mediaTypes,
- mediaFeatures: mediaFeatures,
- mediaValueKeywords: mediaValueKeywords,
- propertyKeywords: propertyKeywords,
- nonStandardPropertyKeywords: nonStandardPropertyKeywords,
- fontProperties: fontProperties,
- counterDescriptors: counterDescriptors,
- colorKeywords: colorKeywords,
- valueKeywords: valueKeywords,
- tokenHooks: {
- "/": function(stream, state) {
- if (!stream.eat("*")) return false;
- state.tokenize = tokenCComment;
- return tokenCComment(stream, state);
- }
- },
- name: "css"
- });
- CodeMirror.defineMIME("text/x-scss", {
- mediaTypes: mediaTypes,
- mediaFeatures: mediaFeatures,
- mediaValueKeywords: mediaValueKeywords,
- propertyKeywords: propertyKeywords,
- nonStandardPropertyKeywords: nonStandardPropertyKeywords,
- colorKeywords: colorKeywords,
- valueKeywords: valueKeywords,
- fontProperties: fontProperties,
- allowNested: true,
- lineComment: "//",
- tokenHooks: {
- "/": function(stream, state) {
- if (stream.eat("/")) {
- stream.skipToEnd();
- return ["comment", "comment"];
- } else if (stream.eat("*")) {
- state.tokenize = tokenCComment;
- return tokenCComment(stream, state);
- } else {
- return ["operator", "operator"];
- }
- },
- ":": function(stream) {
- if (stream.match(/^\s*\{/, false))
- return [null, null]
- return false;
- },
- "$": function(stream) {
- stream.match(/^[\w-]+/);
- if (stream.match(/^\s*:/, false))
- return ["variable-2", "variable-definition"];
- return ["variable-2", "variable"];
- },
- "#": function(stream) {
- if (!stream.eat("{")) return false;
- return [null, "interpolation"];
- }
- },
- name: "css",
- helperType: "scss"
- });
- CodeMirror.defineMIME("text/x-less", {
- mediaTypes: mediaTypes,
- mediaFeatures: mediaFeatures,
- mediaValueKeywords: mediaValueKeywords,
- propertyKeywords: propertyKeywords,
- nonStandardPropertyKeywords: nonStandardPropertyKeywords,
- colorKeywords: colorKeywords,
- valueKeywords: valueKeywords,
- fontProperties: fontProperties,
- allowNested: true,
- lineComment: "//",
- tokenHooks: {
- "/": function(stream, state) {
- if (stream.eat("/")) {
- stream.skipToEnd();
- return ["comment", "comment"];
- } else if (stream.eat("*")) {
- state.tokenize = tokenCComment;
- return tokenCComment(stream, state);
- } else {
- return ["operator", "operator"];
- }
- },
- "@": function(stream) {
- if (stream.eat("{")) return [null, "interpolation"];
- if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, false)) return false;
- stream.eatWhile(/[\w\\\-]/);
- if (stream.match(/^\s*:/, false))
- return ["variable-2", "variable-definition"];
- return ["variable-2", "variable"];
- },
- "&": function() {
- return ["atom", "atom"];
- }
- },
- name: "css",
- helperType: "less"
- });
- CodeMirror.defineMIME("text/x-gss", {
- documentTypes: documentTypes,
- mediaTypes: mediaTypes,
- mediaFeatures: mediaFeatures,
- propertyKeywords: propertyKeywords,
- nonStandardPropertyKeywords: nonStandardPropertyKeywords,
- fontProperties: fontProperties,
- counterDescriptors: counterDescriptors,
- colorKeywords: colorKeywords,
- valueKeywords: valueKeywords,
- supportsAtComponent: true,
- tokenHooks: {
- "/": function(stream, state) {
- if (!stream.eat("*")) return false;
- state.tokenize = tokenCComment;
- return tokenCComment(stream, state);
- }
- },
- name: "css",
- helperType: "gss"
- });
- });
- /***/ }),
- /***/ 42425:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631), __webpack_require__(49047), __webpack_require__(14146));
- else {}
- })(function(CodeMirror) {
- "use strict";
- var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i
- CodeMirror.defineMode("gfm", function(config, modeConfig) {
- var codeDepth = 0;
- function blankLine(state) {
- state.code = false;
- return null;
- }
- var gfmOverlay = {
- startState: function() {
- return {
- code: false,
- codeBlock: false,
- ateSpace: false
- };
- },
- copyState: function(s) {
- return {
- code: s.code,
- codeBlock: s.codeBlock,
- ateSpace: s.ateSpace
- };
- },
- token: function(stream, state) {
- state.combineTokens = null;
- // Hack to prevent formatting override inside code blocks (block and inline)
- if (state.codeBlock) {
- if (stream.match(/^```+/)) {
- state.codeBlock = false;
- return null;
- }
- stream.skipToEnd();
- return null;
- }
- if (stream.sol()) {
- state.code = false;
- }
- if (stream.sol() && stream.match(/^```+/)) {
- stream.skipToEnd();
- state.codeBlock = true;
- return null;
- }
- // If this block is changed, it may need to be updated in Markdown mode
- if (stream.peek() === '`') {
- stream.next();
- var before = stream.pos;
- stream.eatWhile('`');
- var difference = 1 + stream.pos - before;
- if (!state.code) {
- codeDepth = difference;
- state.code = true;
- } else {
- if (difference === codeDepth) { // Must be exact
- state.code = false;
- }
- }
- return null;
- } else if (state.code) {
- stream.next();
- return null;
- }
- // Check if space. If so, links can be formatted later on
- if (stream.eatSpace()) {
- state.ateSpace = true;
- return null;
- }
- if (stream.sol() || state.ateSpace) {
- state.ateSpace = false;
- if (modeConfig.gitHubSpice !== false) {
- if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/)) {
- // User/Project@SHA
- // User@SHA
- // SHA
- state.combineTokens = true;
- return "link";
- } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
- // User/Project#Num
- // User#Num
- // #Num
- state.combineTokens = true;
- return "link";
- }
- }
- }
- if (stream.match(urlRE) &&
- stream.string.slice(stream.start - 2, stream.start) != "](" &&
- (stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) {
- // URLs
- // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
- // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine
- // And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL
- state.combineTokens = true;
- return "link";
- }
- stream.next();
- return null;
- },
- blankLine: blankLine
- };
- var markdownConfig = {
- taskLists: true,
- strikethrough: true,
- emoji: true
- };
- for (var attr in modeConfig) {
- markdownConfig[attr] = modeConfig[attr];
- }
- markdownConfig.name = "markdown";
- return CodeMirror.overlayMode(CodeMirror.getMode(config, markdownConfig), gfmOverlay);
- }, "markdown");
- CodeMirror.defineMIME("text/x-gfm", "gfm");
- });
- /***/ }),
- /***/ 16531:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631), __webpack_require__(29589), __webpack_require__(96876), __webpack_require__(36629));
- else {}
- })(function(CodeMirror) {
- "use strict";
- var defaultTags = {
- script: [
- ["lang", /(javascript|babel)/i, "javascript"],
- ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, "javascript"],
- ["type", /./, "text/plain"],
- [null, null, "javascript"]
- ],
- style: [
- ["lang", /^css$/i, "css"],
- ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"],
- ["type", /./, "text/plain"],
- [null, null, "css"]
- ]
- };
- function maybeBackup(stream, pat, style) {
- var cur = stream.current(), close = cur.search(pat);
- if (close > -1) {
- stream.backUp(cur.length - close);
- } else if (cur.match(/<\/?$/)) {
- stream.backUp(cur.length);
- if (!stream.match(pat, false)) stream.match(cur);
- }
- return style;
- }
- var attrRegexpCache = {};
- function getAttrRegexp(attr) {
- var regexp = attrRegexpCache[attr];
- if (regexp) return regexp;
- return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*");
- }
- function getAttrValue(text, attr) {
- var match = text.match(getAttrRegexp(attr))
- return match ? /^\s*(.*?)\s*$/.exec(match[2])[1] : ""
- }
- function getTagRegexp(tagName, anchored) {
- return new RegExp((anchored ? "^" : "") + "<\/\\s*" + tagName + "\\s*>", "i");
- }
- function addTags(from, to) {
- for (var tag in from) {
- var dest = to[tag] || (to[tag] = []);
- var source = from[tag];
- for (var i = source.length - 1; i >= 0; i--)
- dest.unshift(source[i])
- }
- }
- function findMatchingMode(tagInfo, tagText) {
- for (var i = 0; i < tagInfo.length; i++) {
- var spec = tagInfo[i];
- if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2];
- }
- }
- CodeMirror.defineMode("htmlmixed", function (config, parserConfig) {
- var htmlMode = CodeMirror.getMode(config, {
- name: "xml",
- htmlMode: true,
- multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
- multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag,
- allowMissingTagName: parserConfig.allowMissingTagName,
- });
- var tags = {};
- var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes;
- addTags(defaultTags, tags);
- if (configTags) addTags(configTags, tags);
- if (configScript) for (var i = configScript.length - 1; i >= 0; i--)
- tags.script.unshift(["type", configScript[i].matches, configScript[i].mode])
- function html(stream, state) {
- var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName
- if (tag && !/[<>\s\/]/.test(stream.current()) &&
- (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) &&
- tags.hasOwnProperty(tagName)) {
- state.inTag = tagName + " "
- } else if (state.inTag && tag && />$/.test(stream.current())) {
- var inTag = /^([\S]+) (.*)/.exec(state.inTag)
- state.inTag = null
- var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2])
- var mode = CodeMirror.getMode(config, modeSpec)
- var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false);
- state.token = function (stream, state) {
- if (stream.match(endTagA, false)) {
- state.token = html;
- state.localState = state.localMode = null;
- return null;
- }
- return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));
- };
- state.localMode = mode;
- state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, "", ""));
- } else if (state.inTag) {
- state.inTag += stream.current()
- if (stream.eol()) state.inTag += " "
- }
- return style;
- };
- return {
- startState: function () {
- var state = CodeMirror.startState(htmlMode);
- return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};
- },
- copyState: function (state) {
- var local;
- if (state.localState) {
- local = CodeMirror.copyState(state.localMode, state.localState);
- }
- return {token: state.token, inTag: state.inTag,
- localMode: state.localMode, localState: local,
- htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
- },
- token: function (stream, state) {
- return state.token(stream, state);
- },
- indent: function (state, textAfter, line) {
- if (!state.localMode || /^\s*<\//.test(textAfter))
- return htmlMode.indent(state.htmlState, textAfter, line);
- else if (state.localMode.indent)
- return state.localMode.indent(state.localState, textAfter, line);
- else
- return CodeMirror.Pass;
- },
- innerMode: function (state) {
- return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
- }
- };
- }, "xml", "javascript", "css");
- CodeMirror.defineMIME("text/html", "htmlmixed");
- });
- /***/ }),
- /***/ 96876:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.defineMode("javascript", function(config, parserConfig) {
- var indentUnit = config.indentUnit;
- var statementIndent = parserConfig.statementIndent;
- var jsonldMode = parserConfig.jsonld;
- var jsonMode = parserConfig.json || jsonldMode;
- var trackScope = parserConfig.trackScope !== false
- var isTS = parserConfig.typescript;
- var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
- // Tokenizer
- var keywords = function(){
- function kw(type) {return {type: type, style: "keyword"};}
- var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
- var operator = kw("operator"), atom = {type: "atom", style: "atom"};
- return {
- "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
- "return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C,
- "debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"),
- "function": kw("function"), "catch": kw("catch"),
- "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
- "in": operator, "typeof": operator, "instanceof": operator,
- "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
- "this": kw("this"), "class": kw("class"), "super": kw("atom"),
- "yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
- "await": C
- };
- }();
- var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
- var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
- function readRegexp(stream) {
- var escaped = false, next, inSet = false;
- while ((next = stream.next()) != null) {
- if (!escaped) {
- if (next == "/" && !inSet) return;
- if (next == "[") inSet = true;
- else if (inSet && next == "]") inSet = false;
- }
- escaped = !escaped && next == "\\";
- }
- }
- // Used as scratch variables to communicate multiple values without
- // consing up tons of objects.
- var type, content;
- function ret(tp, style, cont) {
- type = tp; content = cont;
- return style;
- }
- function tokenBase(stream, state) {
- var ch = stream.next();
- if (ch == '"' || ch == "'") {
- state.tokenize = tokenString(ch);
- return state.tokenize(stream, state);
- } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) {
- return ret("number", "number");
- } else if (ch == "." && stream.match("..")) {
- return ret("spread", "meta");
- } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
- return ret(ch);
- } else if (ch == "=" && stream.eat(">")) {
- return ret("=>", "operator");
- } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {
- return ret("number", "number");
- } else if (/\d/.test(ch)) {
- stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);
- return ret("number", "number");
- } else if (ch == "/") {
- if (stream.eat("*")) {
- state.tokenize = tokenComment;
- return tokenComment(stream, state);
- } else if (stream.eat("/")) {
- stream.skipToEnd();
- return ret("comment", "comment");
- } else if (expressionAllowed(stream, state, 1)) {
- readRegexp(stream);
- stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);
- return ret("regexp", "string-2");
- } else {
- stream.eat("=");
- return ret("operator", "operator", stream.current());
- }
- } else if (ch == "`") {
- state.tokenize = tokenQuasi;
- return tokenQuasi(stream, state);
- } else if (ch == "#" && stream.peek() == "!") {
- stream.skipToEnd();
- return ret("meta", "meta");
- } else if (ch == "#" && stream.eatWhile(wordRE)) {
- return ret("variable", "property")
- } else if (ch == "<" && stream.match("!--") ||
- (ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start)))) {
- stream.skipToEnd()
- return ret("comment", "comment")
- } else if (isOperatorChar.test(ch)) {
- if (ch != ">" || !state.lexical || state.lexical.type != ">") {
- if (stream.eat("=")) {
- if (ch == "!" || ch == "=") stream.eat("=")
- } else if (/[<>*+\-|&?]/.test(ch)) {
- stream.eat(ch)
- if (ch == ">") stream.eat(ch)
- }
- }
- if (ch == "?" && stream.eat(".")) return ret(".")
- return ret("operator", "operator", stream.current());
- } else if (wordRE.test(ch)) {
- stream.eatWhile(wordRE);
- var word = stream.current()
- if (state.lastType != ".") {
- if (keywords.propertyIsEnumerable(word)) {
- var kw = keywords[word]
- return ret(kw.type, kw.style, word)
- }
- if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
- return ret("async", "keyword", word)
- }
- return ret("variable", "variable", word)
- }
- }
- function tokenString(quote) {
- return function(stream, state) {
- var escaped = false, next;
- if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){
- state.tokenize = tokenBase;
- return ret("jsonld-keyword", "meta");
- }
- while ((next = stream.next()) != null) {
- if (next == quote && !escaped) break;
- escaped = !escaped && next == "\\";
- }
- if (!escaped) state.tokenize = tokenBase;
- return ret("string", "string");
- };
- }
- function tokenComment(stream, state) {
- var maybeEnd = false, ch;
- while (ch = stream.next()) {
- if (ch == "/" && maybeEnd) {
- state.tokenize = tokenBase;
- break;
- }
- maybeEnd = (ch == "*");
- }
- return ret("comment", "comment");
- }
- function tokenQuasi(stream, state) {
- var escaped = false, next;
- while ((next = stream.next()) != null) {
- if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
- state.tokenize = tokenBase;
- break;
- }
- escaped = !escaped && next == "\\";
- }
- return ret("quasi", "string-2", stream.current());
- }
- var brackets = "([{}])";
- // This is a crude lookahead trick to try and notice that we're
- // parsing the argument patterns for a fat-arrow function before we
- // actually hit the arrow token. It only works if the arrow is on
- // the same line as the arguments and there's no strange noise
- // (comments) in between. Fallback is to only notice when we hit the
- // arrow, and not declare the arguments as locals for the arrow
- // body.
- function findFatArrow(stream, state) {
- if (state.fatArrowAt) state.fatArrowAt = null;
- var arrow = stream.string.indexOf("=>", stream.start);
- if (arrow < 0) return;
- if (isTS) { // Try to skip TypeScript return type declarations after the arguments
- var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow))
- if (m) arrow = m.index
- }
- var depth = 0, sawSomething = false;
- for (var pos = arrow - 1; pos >= 0; --pos) {
- var ch = stream.string.charAt(pos);
- var bracket = brackets.indexOf(ch);
- if (bracket >= 0 && bracket < 3) {
- if (!depth) { ++pos; break; }
- if (--depth == 0) { if (ch == "(") sawSomething = true; break; }
- } else if (bracket >= 3 && bracket < 6) {
- ++depth;
- } else if (wordRE.test(ch)) {
- sawSomething = true;
- } else if (/["'\/`]/.test(ch)) {
- for (;; --pos) {
- if (pos == 0) return
- var next = stream.string.charAt(pos - 1)
- if (next == ch && stream.string.charAt(pos - 2) != "\\") { pos--; break }
- }
- } else if (sawSomething && !depth) {
- ++pos;
- break;
- }
- }
- if (sawSomething && !depth) state.fatArrowAt = pos;
- }
- // Parser
- var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true,
- "regexp": true, "this": true, "import": true, "jsonld-keyword": true};
- function JSLexical(indented, column, type, align, prev, info) {
- this.indented = indented;
- this.column = column;
- this.type = type;
- this.prev = prev;
- this.info = info;
- if (align != null) this.align = align;
- }
- function inScope(state, varname) {
- if (!trackScope) return false
- for (var v = state.localVars; v; v = v.next)
- if (v.name == varname) return true;
- for (var cx = state.context; cx; cx = cx.prev) {
- for (var v = cx.vars; v; v = v.next)
- if (v.name == varname) return true;
- }
- }
- function parseJS(state, style, type, content, stream) {
- var cc = state.cc;
- // Communicate our context to the combinators.
- // (Less wasteful than consing up a hundred closures on every call.)
- cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;
- if (!state.lexical.hasOwnProperty("align"))
- state.lexical.align = true;
- while(true) {
- var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
- if (combinator(type, content)) {
- while(cc.length && cc[cc.length - 1].lex)
- cc.pop()();
- if (cx.marked) return cx.marked;
- if (type == "variable" && inScope(state, content)) return "variable-2";
- return style;
- }
- }
- }
- // Combinator utils
- var cx = {state: null, column: null, marked: null, cc: null};
- function pass() {
- for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
- }
- function cont() {
- pass.apply(null, arguments);
- return true;
- }
- function inList(name, list) {
- for (var v = list; v; v = v.next) if (v.name == name) return true
- return false;
- }
- function register(varname) {
- var state = cx.state;
- cx.marked = "def";
- if (!trackScope) return
- if (state.context) {
- if (state.lexical.info == "var" && state.context && state.context.block) {
- // FIXME function decls are also not block scoped
- var newContext = registerVarScoped(varname, state.context)
- if (newContext != null) {
- state.context = newContext
- return
- }
- } else if (!inList(varname, state.localVars)) {
- state.localVars = new Var(varname, state.localVars)
- return
- }
- }
- // Fall through means this is global
- if (parserConfig.globalVars && !inList(varname, state.globalVars))
- state.globalVars = new Var(varname, state.globalVars)
- }
- function registerVarScoped(varname, context) {
- if (!context) {
- return null
- } else if (context.block) {
- var inner = registerVarScoped(varname, context.prev)
- if (!inner) return null
- if (inner == context.prev) return context
- return new Context(inner, context.vars, true)
- } else if (inList(varname, context.vars)) {
- return context
- } else {
- return new Context(context.prev, new Var(varname, context.vars), false)
- }
- }
- function isModifier(name) {
- return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly"
- }
- // Combinators
- function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }
- function Var(name, next) { this.name = name; this.next = next }
- var defaultVars = new Var("this", new Var("arguments", null))
- function pushcontext() {
- cx.state.context = new Context(cx.state.context, cx.state.localVars, false)
- cx.state.localVars = defaultVars
- }
- function pushblockcontext() {
- cx.state.context = new Context(cx.state.context, cx.state.localVars, true)
- cx.state.localVars = null
- }
- pushcontext.lex = pushblockcontext.lex = true
- function popcontext() {
- cx.state.localVars = cx.state.context.vars
- cx.state.context = cx.state.context.prev
- }
- popcontext.lex = true
- function pushlex(type, info) {
- var result = function() {
- var state = cx.state, indent = state.indented;
- if (state.lexical.type == "stat") indent = state.lexical.indented;
- else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
- indent = outer.indented;
- state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);
- };
- result.lex = true;
- return result;
- }
- function poplex() {
- var state = cx.state;
- if (state.lexical.prev) {
- if (state.lexical.type == ")")
- state.indented = state.lexical.indented;
- state.lexical = state.lexical.prev;
- }
- }
- poplex.lex = true;
- function expect(wanted) {
- function exp(type) {
- if (type == wanted) return cont();
- else if (wanted == ";" || type == "}" || type == ")" || type == "]") return pass();
- else return cont(exp);
- };
- return exp;
- }
- function statement(type, value) {
- if (type == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex);
- if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex);
- if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
- if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex);
- if (type == "debugger") return cont(expect(";"));
- if (type == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext);
- if (type == ";") return cont();
- if (type == "if") {
- if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
- cx.state.cc.pop()();
- return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
- }
- if (type == "function") return cont(functiondef);
- if (type == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex);
- if (type == "class" || (isTS && value == "interface")) {
- cx.marked = "keyword"
- return cont(pushlex("form", type == "class" ? type : value), className, poplex)
- }
- if (type == "variable") {
- if (isTS && value == "declare") {
- cx.marked = "keyword"
- return cont(statement)
- } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
- cx.marked = "keyword"
- if (value == "enum") return cont(enumdef);
- else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";"));
- else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
- } else if (isTS && value == "namespace") {
- cx.marked = "keyword"
- return cont(pushlex("form"), expression, statement, poplex)
- } else if (isTS && value == "abstract") {
- cx.marked = "keyword"
- return cont(statement)
- } else {
- return cont(pushlex("stat"), maybelabel);
- }
- }
- if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext,
- block, poplex, poplex, popcontext);
- if (type == "case") return cont(expression, expect(":"));
- if (type == "default") return cont(expect(":"));
- if (type == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);
- if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
- if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
- if (type == "async") return cont(statement)
- if (value == "@") return cont(expression, statement)
- return pass(pushlex("stat"), expression, expect(";"), poplex);
- }
- function maybeCatchBinding(type) {
- if (type == "(") return cont(funarg, expect(")"))
- }
- function expression(type, value) {
- return expressionInner(type, value, false);
- }
- function expressionNoComma(type, value) {
- return expressionInner(type, value, true);
- }
- function parenExpr(type) {
- if (type != "(") return pass()
- return cont(pushlex(")"), maybeexpression, expect(")"), poplex)
- }
- function expressionInner(type, value, noComma) {
- if (cx.state.fatArrowAt == cx.stream.start) {
- var body = noComma ? arrowBodyNoComma : arrowBody;
- if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
- else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
- }
- var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
- if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
- if (type == "function") return cont(functiondef, maybeop);
- if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); }
- if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression);
- if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
- if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
- if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
- if (type == "{") return contCommasep(objprop, "}", null, maybeop);
- if (type == "quasi") return pass(quasi, maybeop);
- if (type == "new") return cont(maybeTarget(noComma));
- return cont();
- }
- function maybeexpression(type) {
- if (type.match(/[;\}\)\],]/)) return pass();
- return pass(expression);
- }
- function maybeoperatorComma(type, value) {
- if (type == ",") return cont(maybeexpression);
- return maybeoperatorNoComma(type, value, false);
- }
- function maybeoperatorNoComma(type, value, noComma) {
- var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
- var expr = noComma == false ? expression : expressionNoComma;
- if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
- if (type == "operator") {
- if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
- if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false))
- return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
- if (value == "?") return cont(expression, expect(":"), expr);
- return cont(expr);
- }
- if (type == "quasi") { return pass(quasi, me); }
- if (type == ";") return;
- if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
- if (type == ".") return cont(property, me);
- if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
- if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) }
- if (type == "regexp") {
- cx.state.lastType = cx.marked = "operator"
- cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)
- return cont(expr)
- }
- }
- function quasi(type, value) {
- if (type != "quasi") return pass();
- if (value.slice(value.length - 2) != "${") return cont(quasi);
- return cont(maybeexpression, continueQuasi);
- }
- function continueQuasi(type) {
- if (type == "}") {
- cx.marked = "string-2";
- cx.state.tokenize = tokenQuasi;
- return cont(quasi);
- }
- }
- function arrowBody(type) {
- findFatArrow(cx.stream, cx.state);
- return pass(type == "{" ? statement : expression);
- }
- function arrowBodyNoComma(type) {
- findFatArrow(cx.stream, cx.state);
- return pass(type == "{" ? statement : expressionNoComma);
- }
- function maybeTarget(noComma) {
- return function(type) {
- if (type == ".") return cont(noComma ? targetNoComma : target);
- else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)
- else return pass(noComma ? expressionNoComma : expression);
- };
- }
- function target(_, value) {
- if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
- }
- function targetNoComma(_, value) {
- if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
- }
- function maybelabel(type) {
- if (type == ":") return cont(poplex, statement);
- return pass(maybeoperatorComma, expect(";"), poplex);
- }
- function property(type) {
- if (type == "variable") {cx.marked = "property"; return cont();}
- }
- function objprop(type, value) {
- if (type == "async") {
- cx.marked = "property";
- return cont(objprop);
- } else if (type == "variable" || cx.style == "keyword") {
- cx.marked = "property";
- if (value == "get" || value == "set") return cont(getterSetter);
- var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params
- if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false)))
- cx.state.fatArrowAt = cx.stream.pos + m[0].length
- return cont(afterprop);
- } else if (type == "number" || type == "string") {
- cx.marked = jsonldMode ? "property" : (cx.style + " property");
- return cont(afterprop);
- } else if (type == "jsonld-keyword") {
- return cont(afterprop);
- } else if (isTS && isModifier(value)) {
- cx.marked = "keyword"
- return cont(objprop)
- } else if (type == "[") {
- return cont(expression, maybetype, expect("]"), afterprop);
- } else if (type == "spread") {
- return cont(expressionNoComma, afterprop);
- } else if (value == "*") {
- cx.marked = "keyword";
- return cont(objprop);
- } else if (type == ":") {
- return pass(afterprop)
- }
- }
- function getterSetter(type) {
- if (type != "variable") return pass(afterprop);
- cx.marked = "property";
- return cont(functiondef);
- }
- function afterprop(type) {
- if (type == ":") return cont(expressionNoComma);
- if (type == "(") return pass(functiondef);
- }
- function commasep(what, end, sep) {
- function proceed(type, value) {
- if (sep ? sep.indexOf(type) > -1 : type == ",") {
- var lex = cx.state.lexical;
- if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
- return cont(function(type, value) {
- if (type == end || value == end) return pass()
- return pass(what)
- }, proceed);
- }
- if (type == end || value == end) return cont();
- if (sep && sep.indexOf(";") > -1) return pass(what)
- return cont(expect(end));
- }
- return function(type, value) {
- if (type == end || value == end) return cont();
- return pass(what, proceed);
- };
- }
- function contCommasep(what, end, info) {
- for (var i = 3; i < arguments.length; i++)
- cx.cc.push(arguments[i]);
- return cont(pushlex(end, info), commasep(what, end), poplex);
- }
- function block(type) {
- if (type == "}") return cont();
- return pass(statement, block);
- }
- function maybetype(type, value) {
- if (isTS) {
- if (type == ":") return cont(typeexpr);
- if (value == "?") return cont(maybetype);
- }
- }
- function maybetypeOrIn(type, value) {
- if (isTS && (type == ":" || value == "in")) return cont(typeexpr)
- }
- function mayberettype(type) {
- if (isTS && type == ":") {
- if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr)
- else return cont(typeexpr)
- }
- }
- function isKW(_, value) {
- if (value == "is") {
- cx.marked = "keyword"
- return cont()
- }
- }
- function typeexpr(type, value) {
- if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") {
- cx.marked = "keyword"
- return cont(value == "typeof" ? expressionNoComma : typeexpr)
- }
- if (type == "variable" || value == "void") {
- cx.marked = "type"
- return cont(afterType)
- }
- if (value == "|" || value == "&") return cont(typeexpr)
- if (type == "string" || type == "number" || type == "atom") return cont(afterType);
- if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
- if (type == "{") return cont(pushlex("}"), typeprops, poplex, afterType)
- if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType)
- if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
- if (type == "quasi") { return pass(quasiType, afterType); }
- }
- function maybeReturnType(type) {
- if (type == "=>") return cont(typeexpr)
- }
- function typeprops(type) {
- if (type.match(/[\}\)\]]/)) return cont()
- if (type == "," || type == ";") return cont(typeprops)
- return pass(typeprop, typeprops)
- }
- function typeprop(type, value) {
- if (type == "variable" || cx.style == "keyword") {
- cx.marked = "property"
- return cont(typeprop)
- } else if (value == "?" || type == "number" || type == "string") {
- return cont(typeprop)
- } else if (type == ":") {
- return cont(typeexpr)
- } else if (type == "[") {
- return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop)
- } else if (type == "(") {
- return pass(functiondecl, typeprop)
- } else if (!type.match(/[;\}\)\],]/)) {
- return cont()
- }
- }
- function quasiType(type, value) {
- if (type != "quasi") return pass();
- if (value.slice(value.length - 2) != "${") return cont(quasiType);
- return cont(typeexpr, continueQuasiType);
- }
- function continueQuasiType(type) {
- if (type == "}") {
- cx.marked = "string-2";
- cx.state.tokenize = tokenQuasi;
- return cont(quasiType);
- }
- }
- function typearg(type, value) {
- if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg)
- if (type == ":") return cont(typeexpr)
- if (type == "spread") return cont(typearg)
- return pass(typeexpr)
- }
- function afterType(type, value) {
- if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
- if (value == "|" || type == "." || value == "&") return cont(typeexpr)
- if (type == "[") return cont(typeexpr, expect("]"), afterType)
- if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) }
- if (value == "?") return cont(typeexpr, expect(":"), typeexpr)
- }
- function maybeTypeArgs(_, value) {
- if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
- }
- function typeparam() {
- return pass(typeexpr, maybeTypeDefault)
- }
- function maybeTypeDefault(_, value) {
- if (value == "=") return cont(typeexpr)
- }
- function vardef(_, value) {
- if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)}
- return pass(pattern, maybetype, maybeAssign, vardefCont);
- }
- function pattern(type, value) {
- if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) }
- if (type == "variable") { register(value); return cont(); }
- if (type == "spread") return cont(pattern);
- if (type == "[") return contCommasep(eltpattern, "]");
- if (type == "{") return contCommasep(proppattern, "}");
- }
- function proppattern(type, value) {
- if (type == "variable" && !cx.stream.match(/^\s*:/, false)) {
- register(value);
- return cont(maybeAssign);
- }
- if (type == "variable") cx.marked = "property";
- if (type == "spread") return cont(pattern);
- if (type == "}") return pass();
- if (type == "[") return cont(expression, expect(']'), expect(':'), proppattern);
- return cont(expect(":"), pattern, maybeAssign);
- }
- function eltpattern() {
- return pass(pattern, maybeAssign)
- }
- function maybeAssign(_type, value) {
- if (value == "=") return cont(expressionNoComma);
- }
- function vardefCont(type) {
- if (type == ",") return cont(vardef);
- }
- function maybeelse(type, value) {
- if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
- }
- function forspec(type, value) {
- if (value == "await") return cont(forspec);
- if (type == "(") return cont(pushlex(")"), forspec1, poplex);
- }
- function forspec1(type) {
- if (type == "var") return cont(vardef, forspec2);
- if (type == "variable") return cont(forspec2);
- return pass(forspec2)
- }
- function forspec2(type, value) {
- if (type == ")") return cont()
- if (type == ";") return cont(forspec2)
- if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression, forspec2) }
- return pass(expression, forspec2)
- }
- function functiondef(type, value) {
- if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
- if (type == "variable") {register(value); return cont(functiondef);}
- if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
- if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef)
- }
- function functiondecl(type, value) {
- if (value == "*") {cx.marked = "keyword"; return cont(functiondecl);}
- if (type == "variable") {register(value); return cont(functiondecl);}
- if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext);
- if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl)
- }
- function typename(type, value) {
- if (type == "keyword" || type == "variable") {
- cx.marked = "type"
- return cont(typename)
- } else if (value == "<") {
- return cont(pushlex(">"), commasep(typeparam, ">"), poplex)
- }
- }
- function funarg(type, value) {
- if (value == "@") cont(expression, funarg)
- if (type == "spread") return cont(funarg);
- if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); }
- if (isTS && type == "this") return cont(maybetype, maybeAssign)
- return pass(pattern, maybetype, maybeAssign);
- }
- function classExpression(type, value) {
- // Class expressions may have an optional name.
- if (type == "variable") return className(type, value);
- return classNameAfter(type, value);
- }
- function className(type, value) {
- if (type == "variable") {register(value); return cont(classNameAfter);}
- }
- function classNameAfter(type, value) {
- if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter)
- if (value == "extends" || value == "implements" || (isTS && type == ",")) {
- if (value == "implements") cx.marked = "keyword";
- return cont(isTS ? typeexpr : expression, classNameAfter);
- }
- if (type == "{") return cont(pushlex("}"), classBody, poplex);
- }
- function classBody(type, value) {
- if (type == "async" ||
- (type == "variable" &&
- (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) &&
- cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) {
- cx.marked = "keyword";
- return cont(classBody);
- }
- if (type == "variable" || cx.style == "keyword") {
- cx.marked = "property";
- return cont(classfield, classBody);
- }
- if (type == "number" || type == "string") return cont(classfield, classBody);
- if (type == "[")
- return cont(expression, maybetype, expect("]"), classfield, classBody)
- if (value == "*") {
- cx.marked = "keyword";
- return cont(classBody);
- }
- if (isTS && type == "(") return pass(functiondecl, classBody)
- if (type == ";" || type == ",") return cont(classBody);
- if (type == "}") return cont();
- if (value == "@") return cont(expression, classBody)
- }
- function classfield(type, value) {
- if (value == "!") return cont(classfield)
- if (value == "?") return cont(classfield)
- if (type == ":") return cont(typeexpr, maybeAssign)
- if (value == "=") return cont(expressionNoComma)
- var context = cx.state.lexical.prev, isInterface = context && context.info == "interface"
- return pass(isInterface ? functiondecl : functiondef)
- }
- function afterExport(type, value) {
- if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
- if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
- if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
- return pass(statement);
- }
- function exportField(type, value) {
- if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); }
- if (type == "variable") return pass(expressionNoComma, exportField);
- }
- function afterImport(type) {
- if (type == "string") return cont();
- if (type == "(") return pass(expression);
- if (type == ".") return pass(maybeoperatorComma);
- return pass(importSpec, maybeMoreImports, maybeFrom);
- }
- function importSpec(type, value) {
- if (type == "{") return contCommasep(importSpec, "}");
- if (type == "variable") register(value);
- if (value == "*") cx.marked = "keyword";
- return cont(maybeAs);
- }
- function maybeMoreImports(type) {
- if (type == ",") return cont(importSpec, maybeMoreImports)
- }
- function maybeAs(_type, value) {
- if (value == "as") { cx.marked = "keyword"; return cont(importSpec); }
- }
- function maybeFrom(_type, value) {
- if (value == "from") { cx.marked = "keyword"; return cont(expression); }
- }
- function arrayLiteral(type) {
- if (type == "]") return cont();
- return pass(commasep(expressionNoComma, "]"));
- }
- function enumdef() {
- return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex)
- }
- function enummember() {
- return pass(pattern, maybeAssign);
- }
- function isContinuedStatement(state, textAfter) {
- return state.lastType == "operator" || state.lastType == "," ||
- isOperatorChar.test(textAfter.charAt(0)) ||
- /[,.]/.test(textAfter.charAt(0));
- }
- function expressionAllowed(stream, state, backUp) {
- return state.tokenize == tokenBase &&
- /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
- (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
- }
- // Interface
- return {
- startState: function(basecolumn) {
- var state = {
- tokenize: tokenBase,
- lastType: "sof",
- cc: [],
- lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
- localVars: parserConfig.localVars,
- context: parserConfig.localVars && new Context(null, null, false),
- indented: basecolumn || 0
- };
- if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
- state.globalVars = parserConfig.globalVars;
- return state;
- },
- token: function(stream, state) {
- if (stream.sol()) {
- if (!state.lexical.hasOwnProperty("align"))
- state.lexical.align = false;
- state.indented = stream.indentation();
- findFatArrow(stream, state);
- }
- if (state.tokenize != tokenComment && stream.eatSpace()) return null;
- var style = state.tokenize(stream, state);
- if (type == "comment") return style;
- state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
- return parseJS(state, style, type, content, stream);
- },
- indent: function(state, textAfter) {
- if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;
- if (state.tokenize != tokenBase) return 0;
- var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top
- // Kludge to prevent 'maybelse' from blocking lexical scope pops
- if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
- var c = state.cc[i];
- if (c == poplex) lexical = lexical.prev;
- else if (c != maybeelse && c != popcontext) break;
- }
- while ((lexical.type == "stat" || lexical.type == "form") &&
- (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
- (top == maybeoperatorComma || top == maybeoperatorNoComma) &&
- !/^[,\.=+\-*:?[\(]/.test(textAfter))))
- lexical = lexical.prev;
- if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
- lexical = lexical.prev;
- var type = lexical.type, closing = firstChar == type;
- if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0);
- else if (type == "form" && firstChar == "{") return lexical.indented;
- else if (type == "form") return lexical.indented + indentUnit;
- else if (type == "stat")
- return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);
- else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
- return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
- else if (lexical.align) return lexical.column + (closing ? 0 : 1);
- else return lexical.indented + (closing ? 0 : indentUnit);
- },
- electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
- blockCommentStart: jsonMode ? null : "/*",
- blockCommentEnd: jsonMode ? null : "*/",
- blockCommentContinue: jsonMode ? null : " * ",
- lineComment: jsonMode ? null : "//",
- fold: "brace",
- closeBrackets: "()[]{}''\"\"``",
- helperType: jsonMode ? "json" : "javascript",
- jsonldMode: jsonldMode,
- jsonMode: jsonMode,
- expressionAllowed: expressionAllowed,
- skipExpression: function(state) {
- parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null))
- }
- };
- });
- CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);
- CodeMirror.defineMIME("text/javascript", "javascript");
- CodeMirror.defineMIME("text/ecmascript", "javascript");
- CodeMirror.defineMIME("application/javascript", "javascript");
- CodeMirror.defineMIME("application/x-javascript", "javascript");
- CodeMirror.defineMIME("application/ecmascript", "javascript");
- CodeMirror.defineMIME("application/json", { name: "javascript", json: true });
- CodeMirror.defineMIME("application/x-json", { name: "javascript", json: true });
- CodeMirror.defineMIME("application/manifest+json", { name: "javascript", json: true })
- CodeMirror.defineMIME("application/ld+json", { name: "javascript", jsonld: true });
- CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
- CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
- });
- /***/ }),
- /***/ 49047:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631), __webpack_require__(29589), __webpack_require__(52539));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
- var htmlMode = CodeMirror.getMode(cmCfg, "text/html");
- var htmlModeMissing = htmlMode.name == "null"
- function getMode(name) {
- if (CodeMirror.findModeByName) {
- var found = CodeMirror.findModeByName(name);
- if (found) name = found.mime || found.mimes[0];
- }
- var mode = CodeMirror.getMode(cmCfg, name);
- return mode.name == "null" ? null : mode;
- }
- // Should characters that affect highlighting be highlighted separate?
- // Does not include characters that will be output (such as `1.` and `-` for lists)
- if (modeCfg.highlightFormatting === undefined)
- modeCfg.highlightFormatting = false;
- // Maximum number of nested blockquotes. Set to 0 for infinite nesting.
- // Excess `>` will emit `error` token.
- if (modeCfg.maxBlockquoteDepth === undefined)
- modeCfg.maxBlockquoteDepth = 0;
- // Turn on task lists? ("- [ ] " and "- [x] ")
- if (modeCfg.taskLists === undefined) modeCfg.taskLists = false;
- // Turn on strikethrough syntax
- if (modeCfg.strikethrough === undefined)
- modeCfg.strikethrough = false;
- if (modeCfg.emoji === undefined)
- modeCfg.emoji = false;
- if (modeCfg.fencedCodeBlockHighlighting === undefined)
- modeCfg.fencedCodeBlockHighlighting = true;
- if (modeCfg.fencedCodeBlockDefaultMode === undefined)
- modeCfg.fencedCodeBlockDefaultMode = 'text/plain';
- if (modeCfg.xml === undefined)
- modeCfg.xml = true;
- // Allow token types to be overridden by user-provided token types.
- if (modeCfg.tokenTypeOverrides === undefined)
- modeCfg.tokenTypeOverrides = {};
- var tokenTypes = {
- header: "header",
- code: "comment",
- quote: "quote",
- list1: "variable-2",
- list2: "variable-3",
- list3: "keyword",
- hr: "hr",
- image: "image",
- imageAltText: "image-alt-text",
- imageMarker: "image-marker",
- formatting: "formatting",
- linkInline: "link",
- linkEmail: "link",
- linkText: "link",
- linkHref: "string",
- em: "em",
- strong: "strong",
- strikethrough: "strikethrough",
- emoji: "builtin"
- };
- for (var tokenType in tokenTypes) {
- if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) {
- tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType];
- }
- }
- var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/
- , listRE = /^(?:[*\-+]|^[0-9]+([.)]))\s+/
- , taskListRE = /^\[(x| )\](?=\s)/i // Must follow listRE
- , atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/
- , setextHeaderRE = /^ {0,3}(?:\={1,}|-{2,})\s*$/
- , textRE = /^[^#!\[\]*_\\<>` "'(~:]+/
- , fencedCodeRE = /^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/
- , linkDefRE = /^\s*\[[^\]]+?\]:.*$/ // naive link-definition
- , punctuation = /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/
- , expandedTab = " " // CommonMark specifies tab as 4 spaces
- function switchInline(stream, state, f) {
- state.f = state.inline = f;
- return f(stream, state);
- }
- function switchBlock(stream, state, f) {
- state.f = state.block = f;
- return f(stream, state);
- }
- function lineIsEmpty(line) {
- return !line || !/\S/.test(line.string)
- }
- // Blocks
- function blankLine(state) {
- // Reset linkTitle state
- state.linkTitle = false;
- state.linkHref = false;
- state.linkText = false;
- // Reset EM state
- state.em = false;
- // Reset STRONG state
- state.strong = false;
- // Reset strikethrough state
- state.strikethrough = false;
- // Reset state.quote
- state.quote = 0;
- // Reset state.indentedCode
- state.indentedCode = false;
- if (state.f == htmlBlock) {
- var exit = htmlModeMissing
- if (!exit) {
- var inner = CodeMirror.innerMode(htmlMode, state.htmlState)
- exit = inner.mode.name == "xml" && inner.state.tagStart === null &&
- (!inner.state.context && inner.state.tokenize.isInText)
- }
- if (exit) {
- state.f = inlineNormal;
- state.block = blockNormal;
- state.htmlState = null;
- }
- }
- // Reset state.trailingSpace
- state.trailingSpace = 0;
- state.trailingSpaceNewLine = false;
- // Mark this line as blank
- state.prevLine = state.thisLine
- state.thisLine = {stream: null}
- return null;
- }
- function blockNormal(stream, state) {
- var firstTokenOnLine = stream.column() === state.indentation;
- var prevLineLineIsEmpty = lineIsEmpty(state.prevLine.stream);
- var prevLineIsIndentedCode = state.indentedCode;
- var prevLineIsHr = state.prevLine.hr;
- var prevLineIsList = state.list !== false;
- var maxNonCodeIndentation = (state.listStack[state.listStack.length - 1] || 0) + 3;
- state.indentedCode = false;
- var lineIndentation = state.indentation;
- // compute once per line (on first token)
- if (state.indentationDiff === null) {
- state.indentationDiff = state.indentation;
- if (prevLineIsList) {
- state.list = null;
- // While this list item's marker's indentation is less than the deepest
- // list item's content's indentation,pop the deepest list item
- // indentation off the stack, and update block indentation state
- while (lineIndentation < state.listStack[state.listStack.length - 1]) {
- state.listStack.pop();
- if (state.listStack.length) {
- state.indentation = state.listStack[state.listStack.length - 1];
- // less than the first list's indent -> the line is no longer a list
- } else {
- state.list = false;
- }
- }
- if (state.list !== false) {
- state.indentationDiff = lineIndentation - state.listStack[state.listStack.length - 1]
- }
- }
- }
- // not comprehensive (currently only for setext detection purposes)
- var allowsInlineContinuation = (
- !prevLineLineIsEmpty && !prevLineIsHr && !state.prevLine.header &&
- (!prevLineIsList || !prevLineIsIndentedCode) &&
- !state.prevLine.fencedCodeEnd
- );
- var isHr = (state.list === false || prevLineIsHr || prevLineLineIsEmpty) &&
- state.indentation <= maxNonCodeIndentation && stream.match(hrRE);
- var match = null;
- if (state.indentationDiff >= 4 && (prevLineIsIndentedCode || state.prevLine.fencedCodeEnd ||
- state.prevLine.header || prevLineLineIsEmpty)) {
- stream.skipToEnd();
- state.indentedCode = true;
- return tokenTypes.code;
- } else if (stream.eatSpace()) {
- return null;
- } else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(atxHeaderRE)) && match[1].length <= 6) {
- state.quote = 0;
- state.header = match[1].length;
- state.thisLine.header = true;
- if (modeCfg.highlightFormatting) state.formatting = "header";
- state.f = state.inline;
- return getType(state);
- } else if (state.indentation <= maxNonCodeIndentation && stream.eat('>')) {
- state.quote = firstTokenOnLine ? 1 : state.quote + 1;
- if (modeCfg.highlightFormatting) state.formatting = "quote";
- stream.eatSpace();
- return getType(state);
- } else if (!isHr && !state.setext && firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(listRE))) {
- var listType = match[1] ? "ol" : "ul";
- state.indentation = lineIndentation + stream.current().length;
- state.list = true;
- state.quote = 0;
- // Add this list item's content's indentation to the stack
- state.listStack.push(state.indentation);
- // Reset inline styles which shouldn't propagate across list items
- state.em = false;
- state.strong = false;
- state.code = false;
- state.strikethrough = false;
- if (modeCfg.taskLists && stream.match(taskListRE, false)) {
- state.taskList = true;
- }
- state.f = state.inline;
- if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType];
- return getType(state);
- } else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(fencedCodeRE, true))) {
- state.quote = 0;
- state.fencedEndRE = new RegExp(match[1] + "+ *$");
- // try switching mode
- state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2] || modeCfg.fencedCodeBlockDefaultMode );
- if (state.localMode) state.localState = CodeMirror.startState(state.localMode);
- state.f = state.block = local;
- if (modeCfg.highlightFormatting) state.formatting = "code-block";
- state.code = -1
- return getType(state);
- // SETEXT has lowest block-scope precedence after HR, so check it after
- // the others (code, blockquote, list...)
- } else if (
- // if setext set, indicates line after ---/===
- state.setext || (
- // line before ---/===
- (!allowsInlineContinuation || !prevLineIsList) && !state.quote && state.list === false &&
- !state.code && !isHr && !linkDefRE.test(stream.string) &&
- (match = stream.lookAhead(1)) && (match = match.match(setextHeaderRE))
- )
- ) {
- if ( !state.setext ) {
- state.header = match[0].charAt(0) == '=' ? 1 : 2;
- state.setext = state.header;
- } else {
- state.header = state.setext;
- // has no effect on type so we can reset it now
- state.setext = 0;
- stream.skipToEnd();
- if (modeCfg.highlightFormatting) state.formatting = "header";
- }
- state.thisLine.header = true;
- state.f = state.inline;
- return getType(state);
- } else if (isHr) {
- stream.skipToEnd();
- state.hr = true;
- state.thisLine.hr = true;
- return tokenTypes.hr;
- } else if (stream.peek() === '[') {
- return switchInline(stream, state, footnoteLink);
- }
- return switchInline(stream, state, state.inline);
- }
- function htmlBlock(stream, state) {
- var style = htmlMode.token(stream, state.htmlState);
- if (!htmlModeMissing) {
- var inner = CodeMirror.innerMode(htmlMode, state.htmlState)
- if ((inner.mode.name == "xml" && inner.state.tagStart === null &&
- (!inner.state.context && inner.state.tokenize.isInText)) ||
- (state.md_inside && stream.current().indexOf(">") > -1)) {
- state.f = inlineNormal;
- state.block = blockNormal;
- state.htmlState = null;
- }
- }
- return style;
- }
- function local(stream, state) {
- var currListInd = state.listStack[state.listStack.length - 1] || 0;
- var hasExitedList = state.indentation < currListInd;
- var maxFencedEndInd = currListInd + 3;
- if (state.fencedEndRE && state.indentation <= maxFencedEndInd && (hasExitedList || stream.match(state.fencedEndRE))) {
- if (modeCfg.highlightFormatting) state.formatting = "code-block";
- var returnType;
- if (!hasExitedList) returnType = getType(state)
- state.localMode = state.localState = null;
- state.block = blockNormal;
- state.f = inlineNormal;
- state.fencedEndRE = null;
- state.code = 0
- state.thisLine.fencedCodeEnd = true;
- if (hasExitedList) return switchBlock(stream, state, state.block);
- return returnType;
- } else if (state.localMode) {
- return state.localMode.token(stream, state.localState);
- } else {
- stream.skipToEnd();
- return tokenTypes.code;
- }
- }
- // Inline
- function getType(state) {
- var styles = [];
- if (state.formatting) {
- styles.push(tokenTypes.formatting);
- if (typeof state.formatting === "string") state.formatting = [state.formatting];
- for (var i = 0; i < state.formatting.length; i++) {
- styles.push(tokenTypes.formatting + "-" + state.formatting[i]);
- if (state.formatting[i] === "header") {
- styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header);
- }
- // Add `formatting-quote` and `formatting-quote-#` for blockquotes
- // Add `error` instead if the maximum blockquote nesting depth is passed
- if (state.formatting[i] === "quote") {
- if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
- styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote);
- } else {
- styles.push("error");
- }
- }
- }
- }
- if (state.taskOpen) {
- styles.push("meta");
- return styles.length ? styles.join(' ') : null;
- }
- if (state.taskClosed) {
- styles.push("property");
- return styles.length ? styles.join(' ') : null;
- }
- if (state.linkHref) {
- styles.push(tokenTypes.linkHref, "url");
- } else { // Only apply inline styles to non-url text
- if (state.strong) { styles.push(tokenTypes.strong); }
- if (state.em) { styles.push(tokenTypes.em); }
- if (state.strikethrough) { styles.push(tokenTypes.strikethrough); }
- if (state.emoji) { styles.push(tokenTypes.emoji); }
- if (state.linkText) { styles.push(tokenTypes.linkText); }
- if (state.code) { styles.push(tokenTypes.code); }
- if (state.image) { styles.push(tokenTypes.image); }
- if (state.imageAltText) { styles.push(tokenTypes.imageAltText, "link"); }
- if (state.imageMarker) { styles.push(tokenTypes.imageMarker); }
- }
- if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); }
- if (state.quote) {
- styles.push(tokenTypes.quote);
- // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth
- if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
- styles.push(tokenTypes.quote + "-" + state.quote);
- } else {
- styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth);
- }
- }
- if (state.list !== false) {
- var listMod = (state.listStack.length - 1) % 3;
- if (!listMod) {
- styles.push(tokenTypes.list1);
- } else if (listMod === 1) {
- styles.push(tokenTypes.list2);
- } else {
- styles.push(tokenTypes.list3);
- }
- }
- if (state.trailingSpaceNewLine) {
- styles.push("trailing-space-new-line");
- } else if (state.trailingSpace) {
- styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b"));
- }
- return styles.length ? styles.join(' ') : null;
- }
- function handleText(stream, state) {
- if (stream.match(textRE, true)) {
- return getType(state);
- }
- return undefined;
- }
- function inlineNormal(stream, state) {
- var style = state.text(stream, state);
- if (typeof style !== 'undefined')
- return style;
- if (state.list) { // List marker (*, +, -, 1., etc)
- state.list = null;
- return getType(state);
- }
- if (state.taskList) {
- var taskOpen = stream.match(taskListRE, true)[1] === " ";
- if (taskOpen) state.taskOpen = true;
- else state.taskClosed = true;
- if (modeCfg.highlightFormatting) state.formatting = "task";
- state.taskList = false;
- return getType(state);
- }
- state.taskOpen = false;
- state.taskClosed = false;
- if (state.header && stream.match(/^#+$/, true)) {
- if (modeCfg.highlightFormatting) state.formatting = "header";
- return getType(state);
- }
- var ch = stream.next();
- // Matches link titles present on next line
- if (state.linkTitle) {
- state.linkTitle = false;
- var matchCh = ch;
- if (ch === '(') {
- matchCh = ')';
- }
- matchCh = (matchCh+'').replace(/([.?*+^\[\]\\(){}|-])/g, "\\$1");
- var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
- if (stream.match(new RegExp(regex), true)) {
- return tokenTypes.linkHref;
- }
- }
- // If this block is changed, it may need to be updated in GFM mode
- if (ch === '`') {
- var previousFormatting = state.formatting;
- if (modeCfg.highlightFormatting) state.formatting = "code";
- stream.eatWhile('`');
- var count = stream.current().length
- if (state.code == 0 && (!state.quote || count == 1)) {
- state.code = count
- return getType(state)
- } else if (count == state.code) { // Must be exact
- var t = getType(state)
- state.code = 0
- return t
- } else {
- state.formatting = previousFormatting
- return getType(state)
- }
- } else if (state.code) {
- return getType(state);
- }
- if (ch === '\\') {
- stream.next();
- if (modeCfg.highlightFormatting) {
- var type = getType(state);
- var formattingEscape = tokenTypes.formatting + "-escape";
- return type ? type + " " + formattingEscape : formattingEscape;
- }
- }
- if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
- state.imageMarker = true;
- state.image = true;
- if (modeCfg.highlightFormatting) state.formatting = "image";
- return getType(state);
- }
- if (ch === '[' && state.imageMarker && stream.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/, false)) {
- state.imageMarker = false;
- state.imageAltText = true
- if (modeCfg.highlightFormatting) state.formatting = "image";
- return getType(state);
- }
- if (ch === ']' && state.imageAltText) {
- if (modeCfg.highlightFormatting) state.formatting = "image";
- var type = getType(state);
- state.imageAltText = false;
- state.image = false;
- state.inline = state.f = linkHref;
- return type;
- }
- if (ch === '[' && !state.image) {
- if (state.linkText && stream.match(/^.*?\]/)) return getType(state)
- state.linkText = true;
- if (modeCfg.highlightFormatting) state.formatting = "link";
- return getType(state);
- }
- if (ch === ']' && state.linkText) {
- if (modeCfg.highlightFormatting) state.formatting = "link";
- var type = getType(state);
- state.linkText = false;
- state.inline = state.f = stream.match(/\(.*?\)| ?\[.*?\]/, false) ? linkHref : inlineNormal
- return type;
- }
- if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) {
- state.f = state.inline = linkInline;
- if (modeCfg.highlightFormatting) state.formatting = "link";
- var type = getType(state);
- if (type){
- type += " ";
- } else {
- type = "";
- }
- return type + tokenTypes.linkInline;
- }
- if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) {
- state.f = state.inline = linkInline;
- if (modeCfg.highlightFormatting) state.formatting = "link";
- var type = getType(state);
- if (type){
- type += " ";
- } else {
- type = "";
- }
- return type + tokenTypes.linkEmail;
- }
- if (modeCfg.xml && ch === '<' && stream.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i, false)) {
- var end = stream.string.indexOf(">", stream.pos);
- if (end != -1) {
- var atts = stream.string.substring(stream.start, end);
- if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true;
- }
- stream.backUp(1);
- state.htmlState = CodeMirror.startState(htmlMode);
- return switchBlock(stream, state, htmlBlock);
- }
- if (modeCfg.xml && ch === '<' && stream.match(/^\/\w*?>/)) {
- state.md_inside = false;
- return "tag";
- } else if (ch === "*" || ch === "_") {
- var len = 1, before = stream.pos == 1 ? " " : stream.string.charAt(stream.pos - 2)
- while (len < 3 && stream.eat(ch)) len++
- var after = stream.peek() || " "
- // See http://spec.commonmark.org/0.27/#emphasis-and-strong-emphasis
- var leftFlanking = !/\s/.test(after) && (!punctuation.test(after) || /\s/.test(before) || punctuation.test(before))
- var rightFlanking = !/\s/.test(before) && (!punctuation.test(before) || /\s/.test(after) || punctuation.test(after))
- var setEm = null, setStrong = null
- if (len % 2) { // Em
- if (!state.em && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
- setEm = true
- else if (state.em == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
- setEm = false
- }
- if (len > 1) { // Strong
- if (!state.strong && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
- setStrong = true
- else if (state.strong == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
- setStrong = false
- }
- if (setStrong != null || setEm != null) {
- if (modeCfg.highlightFormatting) state.formatting = setEm == null ? "strong" : setStrong == null ? "em" : "strong em"
- if (setEm === true) state.em = ch
- if (setStrong === true) state.strong = ch
- var t = getType(state)
- if (setEm === false) state.em = false
- if (setStrong === false) state.strong = false
- return t
- }
- } else if (ch === ' ') {
- if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces
- if (stream.peek() === ' ') { // Surrounded by spaces, ignore
- return getType(state);
- } else { // Not surrounded by spaces, back up pointer
- stream.backUp(1);
- }
- }
- }
- if (modeCfg.strikethrough) {
- if (ch === '~' && stream.eatWhile(ch)) {
- if (state.strikethrough) {// Remove strikethrough
- if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
- var t = getType(state);
- state.strikethrough = false;
- return t;
- } else if (stream.match(/^[^\s]/, false)) {// Add strikethrough
- state.strikethrough = true;
- if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
- return getType(state);
- }
- } else if (ch === ' ') {
- if (stream.match('~~', true)) { // Probably surrounded by space
- if (stream.peek() === ' ') { // Surrounded by spaces, ignore
- return getType(state);
- } else { // Not surrounded by spaces, back up pointer
- stream.backUp(2);
- }
- }
- }
- }
- if (modeCfg.emoji && ch === ":" && stream.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)) {
- state.emoji = true;
- if (modeCfg.highlightFormatting) state.formatting = "emoji";
- var retType = getType(state);
- state.emoji = false;
- return retType;
- }
- if (ch === ' ') {
- if (stream.match(/^ +$/, false)) {
- state.trailingSpace++;
- } else if (state.trailingSpace) {
- state.trailingSpaceNewLine = true;
- }
- }
- return getType(state);
- }
- function linkInline(stream, state) {
- var ch = stream.next();
- if (ch === ">") {
- state.f = state.inline = inlineNormal;
- if (modeCfg.highlightFormatting) state.formatting = "link";
- var type = getType(state);
- if (type){
- type += " ";
- } else {
- type = "";
- }
- return type + tokenTypes.linkInline;
- }
- stream.match(/^[^>]+/, true);
- return tokenTypes.linkInline;
- }
- function linkHref(stream, state) {
- // Check if space, and return NULL if so (to avoid marking the space)
- if(stream.eatSpace()){
- return null;
- }
- var ch = stream.next();
- if (ch === '(' || ch === '[') {
- state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]");
- if (modeCfg.highlightFormatting) state.formatting = "link-string";
- state.linkHref = true;
- return getType(state);
- }
- return 'error';
- }
- var linkRE = {
- ")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,
- "]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/
- }
- function getLinkHrefInside(endChar) {
- return function(stream, state) {
- var ch = stream.next();
- if (ch === endChar) {
- state.f = state.inline = inlineNormal;
- if (modeCfg.highlightFormatting) state.formatting = "link-string";
- var returnState = getType(state);
- state.linkHref = false;
- return returnState;
- }
- stream.match(linkRE[endChar])
- state.linkHref = true;
- return getType(state);
- };
- }
- function footnoteLink(stream, state) {
- if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) {
- state.f = footnoteLinkInside;
- stream.next(); // Consume [
- if (modeCfg.highlightFormatting) state.formatting = "link";
- state.linkText = true;
- return getType(state);
- }
- return switchInline(stream, state, inlineNormal);
- }
- function footnoteLinkInside(stream, state) {
- if (stream.match(']:', true)) {
- state.f = state.inline = footnoteUrl;
- if (modeCfg.highlightFormatting) state.formatting = "link";
- var returnType = getType(state);
- state.linkText = false;
- return returnType;
- }
- stream.match(/^([^\]\\]|\\.)+/, true);
- return tokenTypes.linkText;
- }
- function footnoteUrl(stream, state) {
- // Check if space, and return NULL if so (to avoid marking the space)
- if(stream.eatSpace()){
- return null;
- }
- // Match URL
- stream.match(/^[^\s]+/, true);
- // Check for link title
- if (stream.peek() === undefined) { // End of line, set flag to check next line
- state.linkTitle = true;
- } else { // More content on line, check if link title
- stream.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/, true);
- }
- state.f = state.inline = inlineNormal;
- return tokenTypes.linkHref + " url";
- }
- var mode = {
- startState: function() {
- return {
- f: blockNormal,
- prevLine: {stream: null},
- thisLine: {stream: null},
- block: blockNormal,
- htmlState: null,
- indentation: 0,
- inline: inlineNormal,
- text: handleText,
- formatting: false,
- linkText: false,
- linkHref: false,
- linkTitle: false,
- code: 0,
- em: false,
- strong: false,
- header: 0,
- setext: 0,
- hr: false,
- taskList: false,
- list: false,
- listStack: [],
- quote: 0,
- trailingSpace: 0,
- trailingSpaceNewLine: false,
- strikethrough: false,
- emoji: false,
- fencedEndRE: null
- };
- },
- copyState: function(s) {
- return {
- f: s.f,
- prevLine: s.prevLine,
- thisLine: s.thisLine,
- block: s.block,
- htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
- indentation: s.indentation,
- localMode: s.localMode,
- localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null,
- inline: s.inline,
- text: s.text,
- formatting: false,
- linkText: s.linkText,
- linkTitle: s.linkTitle,
- linkHref: s.linkHref,
- code: s.code,
- em: s.em,
- strong: s.strong,
- strikethrough: s.strikethrough,
- emoji: s.emoji,
- header: s.header,
- setext: s.setext,
- hr: s.hr,
- taskList: s.taskList,
- list: s.list,
- listStack: s.listStack.slice(0),
- quote: s.quote,
- indentedCode: s.indentedCode,
- trailingSpace: s.trailingSpace,
- trailingSpaceNewLine: s.trailingSpaceNewLine,
- md_inside: s.md_inside,
- fencedEndRE: s.fencedEndRE
- };
- },
- token: function(stream, state) {
- // Reset state.formatting
- state.formatting = false;
- if (stream != state.thisLine.stream) {
- state.header = 0;
- state.hr = false;
- if (stream.match(/^\s*$/, true)) {
- blankLine(state);
- return null;
- }
- state.prevLine = state.thisLine
- state.thisLine = {stream: stream}
- // Reset state.taskList
- state.taskList = false;
- // Reset state.trailingSpace
- state.trailingSpace = 0;
- state.trailingSpaceNewLine = false;
- if (!state.localState) {
- state.f = state.block;
- if (state.f != htmlBlock) {
- var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, expandedTab).length;
- state.indentation = indentation;
- state.indentationDiff = null;
- if (indentation > 0) return null;
- }
- }
- }
- return state.f(stream, state);
- },
- innerMode: function(state) {
- if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode};
- if (state.localState) return {state: state.localState, mode: state.localMode};
- return {state: state, mode: mode};
- },
- indent: function(state, textAfter, line) {
- if (state.block == htmlBlock && htmlMode.indent) return htmlMode.indent(state.htmlState, textAfter, line)
- if (state.localState && state.localMode.indent) return state.localMode.indent(state.localState, textAfter, line)
- return CodeMirror.Pass
- },
- blankLine: blankLine,
- getType: getType,
- blockCommentStart: "<!--",
- blockCommentEnd: "-->",
- closeBrackets: "()[]{}''\"\"``",
- fold: "markdown"
- };
- return mode;
- }, "xml");
- CodeMirror.defineMIME("text/markdown", "markdown");
- CodeMirror.defineMIME("text/x-markdown", "markdown");
- });
- /***/ }),
- /***/ 52539:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.modeInfo = [
- {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
- {name: "PGP", mimes: ["application/pgp", "application/pgp-encrypted", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["asc", "pgp", "sig"]},
- {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]},
- {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
- {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
- {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h", "ino"]},
- {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
- {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy", "cbl"]},
- {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp", "cs"]},
- {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]},
- {name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]},
- {name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
- {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists\.txt$/},
- {name: "CoffeeScript", mimes: ["application/vnd.coffeescript", "text/coffeescript", "text/x-coffeescript"], mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
- {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
- {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
- {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
- {name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]},
- {name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
- {name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
- {name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
- {name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]},
- {name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]},
- {name: "Django", mime: "text/x-django", mode: "django"},
- {name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/},
- {name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]},
- {name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
- {name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
- {name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
- {name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]},
- {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
- {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
- {name: "Embedded JavaScript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
- {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
- {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
- {name: "Esper", mime: "text/x-esper", mode: "sql"},
- {name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
- {name: "FCL", mime: "text/x-fcl", mode: "fcl"},
- {name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
- {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90", "f95"]},
- {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
- {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
- {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
- {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history)\.md$/i},
- {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
- {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"], file: /^Jenkinsfile$/},
- {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
- {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
- {name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]},
- {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
- {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
- {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
- {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm", "handlebars", "hbs"], alias: ["xhtml"]},
- {name: "HTTP", mime: "message/http", mode: "http"},
- {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]},
- {name: "Pug", mime: "text/x-pug", mode: "pug", ext: ["jade", "pug"], alias: ["jade"]},
- {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]},
- {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]},
- {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"],
- mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
- {name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
- {name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
- {name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
- {name: "Jinja2", mime: "text/jinja2", mode: "jinja2", ext: ["j2", "jinja", "jinja2"]},
- {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"], alias: ["jl"]},
- {name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
- {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
- {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
- {name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]},
- {name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]},
- {name: "mIRC", mime: "text/mirc", mode: "mirc"},
- {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
- {name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb", "wl", "wls"]},
- {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
- {name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]},
- {name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
- {name: "mbox", mime: "application/mbox", mode: "mbox", ext: ["mbox"]},
- {name: "MySQL", mime: "text/x-mysql", mode: "sql"},
- {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
- {name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
- {name: "NTriples", mimes: ["application/n-triples", "application/n-quads", "text/n-triples"],
- mode: "ntriples", ext: ["nt", "nq"]},
- {name: "Objective-C", mime: "text/x-objectivec", mode: "clike", ext: ["m"], alias: ["objective-c", "objc"]},
- {name: "Objective-C++", mime: "text/x-objectivec++", mode: "clike", ext: ["mm"], alias: ["objective-c++", "objc++"]},
- {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
- {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
- {name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]},
- {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
- {name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]},
- {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
- {name: "PHP", mimes: ["text/x-php", "application/x-httpd-php", "application/x-httpd-php-open"], mode: "php", ext: ["php", "php3", "php4", "php5", "php7", "phtml"]},
- {name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
- {name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
- {name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
- {name: "PostgreSQL", mime: "text/x-pgsql", mode: "sql"},
- {name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"]},
- {name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
- {name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]},
- {name: "Python", mime: "text/x-python", mode: "python", ext: ["BUILD", "bzl", "py", "pyw"], file: /^(BUCK|BUILD)$/},
- {name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
- {name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
- {name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r", "R"], alias: ["rscript"]},
- {name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]},
- {name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"},
- {name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]},
- {name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]},
- {name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]},
- {name: "SAS", mime: "text/x-sas", mode: "sas", ext: ["sas"]},
- {name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]},
- {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
- {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
- {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
- {name: "Shell", mimes: ["text/x-sh", "application/x-sh"], mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
- {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
- {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
- {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
- {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]},
- {name: "Solr", mime: "text/x-solr", mode: "solr"},
- {name: "SML", mime: "text/x-sml", mode: "mllike", ext: ["sml", "sig", "fun", "smackspec"]},
- {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]},
- {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
- {name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
- {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
- {name: "SQLite", mime: "text/x-sqlite", mode: "sql"},
- {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
- {name: "Stylus", mime: "text/x-styl", mode: "stylus", ext: ["styl"]},
- {name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
- {name: "sTeX", mime: "text/x-stex", mode: "stex"},
- {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx", "tex"], alias: ["tex"]},
- {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v", "sv", "svh"]},
- {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
- {name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]},
- {name: "TiddlyWiki", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
- {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
- {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
- {name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
- {name: "troff", mime: "text/troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
- {name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]},
- {name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
- {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
- {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
- {name: "TypeScript-JSX", mime: "text/typescript-jsx", mode: "jsx", ext: ["tsx"], alias: ["tsx"]},
- {name: "Twig", mime: "text/x-twig", mode: "twig"},
- {name: "Web IDL", mime: "text/x-webidl", mode: "webidl", ext: ["webidl"]},
- {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
- {name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
- {name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
- {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]},
- {name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]},
- {name: "Vue.js Component", mimes: ["script/x-vue", "text/x-vue"], mode: "vue", ext: ["vue"]},
- {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd", "svg"], alias: ["rss", "wsdl", "xsd"]},
- {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]},
- {name: "Yacas", mime: "text/x-yacas", mode: "yacas", ext: ["ys"]},
- {name: "YAML", mimes: ["text/x-yaml", "text/yaml"], mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]},
- {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]},
- {name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]},
- {name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]},
- {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]},
- {name: "WebAssembly", mime: "text/webassembly", mode: "wast", ext: ["wat", "wast"]},
- ];
- // Ensure all modes have a mime property for backwards compatibility
- for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
- var info = CodeMirror.modeInfo[i];
- if (info.mimes) info.mime = info.mimes[0];
- }
- CodeMirror.findModeByMIME = function(mime) {
- mime = mime.toLowerCase();
- for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
- var info = CodeMirror.modeInfo[i];
- if (info.mime == mime) return info;
- if (info.mimes) for (var j = 0; j < info.mimes.length; j++)
- if (info.mimes[j] == mime) return info;
- }
- if (/\+xml$/.test(mime)) return CodeMirror.findModeByMIME("application/xml")
- if (/\+json$/.test(mime)) return CodeMirror.findModeByMIME("application/json")
- };
- CodeMirror.findModeByExtension = function(ext) {
- ext = ext.toLowerCase();
- for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
- var info = CodeMirror.modeInfo[i];
- if (info.ext) for (var j = 0; j < info.ext.length; j++)
- if (info.ext[j] == ext) return info;
- }
- };
- CodeMirror.findModeByFileName = function(filename) {
- for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
- var info = CodeMirror.modeInfo[i];
- if (info.file && info.file.test(filename)) return info;
- }
- var dot = filename.lastIndexOf(".");
- var ext = dot > -1 && filename.substring(dot + 1, filename.length);
- if (ext) return CodeMirror.findModeByExtension(ext);
- };
- CodeMirror.findModeByName = function(name) {
- name = name.toLowerCase();
- for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
- var info = CodeMirror.modeInfo[i];
- if (info.name.toLowerCase() == name) return info;
- if (info.alias) for (var j = 0; j < info.alias.length; j++)
- if (info.alias[j].toLowerCase() == name) return info;
- }
- };
- });
- /***/ }),
- /***/ 36702:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631), __webpack_require__(16531), __webpack_require__(99762));
- else {}
- })(function(CodeMirror) {
- "use strict";
- function keywords(str) {
- var obj = {}, words = str.split(" ");
- for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
- return obj;
- }
- // Helper for phpString
- function matchSequence(list, end, escapes) {
- if (list.length == 0) return phpString(end);
- return function (stream, state) {
- var patterns = list[0];
- for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) {
- state.tokenize = matchSequence(list.slice(1), end);
- return patterns[i][1];
- }
- state.tokenize = phpString(end, escapes);
- return "string";
- };
- }
- function phpString(closing, escapes) {
- return function(stream, state) { return phpString_(stream, state, closing, escapes); };
- }
- function phpString_(stream, state, closing, escapes) {
- // "Complex" syntax
- if (escapes !== false && stream.match("${", false) || stream.match("{$", false)) {
- state.tokenize = null;
- return "string";
- }
- // Simple syntax
- if (escapes !== false && stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) {
- // After the variable name there may appear array or object operator.
- if (stream.match("[", false)) {
- // Match array operator
- state.tokenize = matchSequence([
- [["[", null]],
- [[/\d[\w\.]*/, "number"],
- [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"],
- [/[\w\$]+/, "variable"]],
- [["]", null]]
- ], closing, escapes);
- }
- if (stream.match(/^->\w/, false)) {
- // Match object operator
- state.tokenize = matchSequence([
- [["->", null]],
- [[/[\w]+/, "variable"]]
- ], closing, escapes);
- }
- return "variable-2";
- }
- var escaped = false;
- // Normal string
- while (!stream.eol() &&
- (escaped || escapes === false ||
- (!stream.match("{$", false) &&
- !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) {
- if (!escaped && stream.match(closing)) {
- state.tokenize = null;
- state.tokStack.pop(); state.tokStack.pop();
- break;
- }
- escaped = stream.next() == "\\" && !escaped;
- }
- return "string";
- }
- var phpKeywords = "abstract and array as break case catch class clone const continue declare default " +
- "do else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final " +
- "for foreach function global goto if implements interface instanceof namespace " +
- "new or private protected public static switch throw trait try use var while xor " +
- "die echo empty exit eval include include_once isset list require require_once return " +
- "print unset __halt_compiler self static parent yield insteadof finally readonly match";
- var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__";
- var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage memory_get_peak_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";
- CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" "));
- CodeMirror.registerHelper("wordChars", "php", /[\w$]/);
- var phpConfig = {
- name: "clike",
- helperType: "php",
- keywords: keywords(phpKeywords),
- blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"),
- defKeywords: keywords("class enum function interface namespace trait"),
- atoms: keywords(phpAtoms),
- builtin: keywords(phpBuiltin),
- multiLineStrings: true,
- hooks: {
- "$": function(stream) {
- stream.eatWhile(/[\w\$_]/);
- return "variable-2";
- },
- "<": function(stream, state) {
- var before;
- if (before = stream.match(/^<<\s*/)) {
- var quoted = stream.eat(/['"]/);
- stream.eatWhile(/[\w\.]/);
- var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1));
- if (quoted) stream.eat(quoted);
- if (delim) {
- (state.tokStack || (state.tokStack = [])).push(delim, 0);
- state.tokenize = phpString(delim, quoted != "'");
- return "string";
- }
- }
- return false;
- },
- "#": function(stream) {
- while (!stream.eol() && !stream.match("?>", false)) stream.next();
- return "comment";
- },
- "/": function(stream) {
- if (stream.eat("/")) {
- while (!stream.eol() && !stream.match("?>", false)) stream.next();
- return "comment";
- }
- return false;
- },
- '"': function(_stream, state) {
- (state.tokStack || (state.tokStack = [])).push('"', 0);
- state.tokenize = phpString('"');
- return "string";
- },
- "{": function(_stream, state) {
- if (state.tokStack && state.tokStack.length)
- state.tokStack[state.tokStack.length - 1]++;
- return false;
- },
- "}": function(_stream, state) {
- if (state.tokStack && state.tokStack.length > 0 &&
- !--state.tokStack[state.tokStack.length - 1]) {
- state.tokenize = phpString(state.tokStack[state.tokStack.length - 2]);
- }
- return false;
- }
- }
- };
- CodeMirror.defineMode("php", function(config, parserConfig) {
- var htmlMode = CodeMirror.getMode(config, (parserConfig && parserConfig.htmlMode) || "text/html");
- var phpMode = CodeMirror.getMode(config, phpConfig);
- function dispatch(stream, state) {
- var isPHP = state.curMode == phpMode;
- if (stream.sol() && state.pending && state.pending != '"' && state.pending != "'") state.pending = null;
- if (!isPHP) {
- if (stream.match(/^<\?\w*/)) {
- state.curMode = phpMode;
- if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, "", ""))
- state.curState = state.php;
- return "meta";
- }
- if (state.pending == '"' || state.pending == "'") {
- while (!stream.eol() && stream.next() != state.pending) {}
- var style = "string";
- } else if (state.pending && stream.pos < state.pending.end) {
- stream.pos = state.pending.end;
- var style = state.pending.style;
- } else {
- var style = htmlMode.token(stream, state.curState);
- }
- if (state.pending) state.pending = null;
- var cur = stream.current(), openPHP = cur.search(/<\?/), m;
- if (openPHP != -1) {
- if (style == "string" && (m = cur.match(/[\'\"]$/)) && !/\?>/.test(cur)) state.pending = m[0];
- else state.pending = {end: stream.pos, style: style};
- stream.backUp(cur.length - openPHP);
- }
- return style;
- } else if (isPHP && state.php.tokenize == null && stream.match("?>")) {
- state.curMode = htmlMode;
- state.curState = state.html;
- if (!state.php.context.prev) state.php = null;
- return "meta";
- } else {
- return phpMode.token(stream, state.curState);
- }
- }
- return {
- startState: function() {
- var html = CodeMirror.startState(htmlMode)
- var php = parserConfig.startOpen ? CodeMirror.startState(phpMode) : null
- return {html: html,
- php: php,
- curMode: parserConfig.startOpen ? phpMode : htmlMode,
- curState: parserConfig.startOpen ? php : html,
- pending: null};
- },
- copyState: function(state) {
- var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html),
- php = state.php, phpNew = php && CodeMirror.copyState(phpMode, php), cur;
- if (state.curMode == htmlMode) cur = htmlNew;
- else cur = phpNew;
- return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur,
- pending: state.pending};
- },
- token: dispatch,
- indent: function(state, textAfter, line) {
- if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) ||
- (state.curMode == phpMode && /^\?>/.test(textAfter)))
- return htmlMode.indent(state.html, textAfter, line);
- return state.curMode.indent(state.curState, textAfter, line);
- },
- blockCommentStart: "/*",
- blockCommentEnd: "*/",
- lineComment: "//",
- innerMode: function(state) { return {state: state.curState, mode: state.curMode}; }
- };
- }, "htmlmixed", "clike");
- CodeMirror.defineMIME("application/x-httpd-php", "php");
- CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true});
- CodeMirror.defineMIME("text/x-php", phpConfig);
- });
- /***/ }),
- /***/ 81201:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631), __webpack_require__(36629));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.defineMode("sass", function(config) {
- var cssMode = CodeMirror.mimeModes["text/css"];
- var propertyKeywords = cssMode.propertyKeywords || {},
- colorKeywords = cssMode.colorKeywords || {},
- valueKeywords = cssMode.valueKeywords || {},
- fontProperties = cssMode.fontProperties || {};
- function tokenRegexp(words) {
- return new RegExp("^" + words.join("|"));
- }
- var keywords = ["true", "false", "null", "auto"];
- var keywordsRegexp = new RegExp("^" + keywords.join("|"));
- var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-",
- "\\!=", "/", "\\*", "%", "and", "or", "not", ";","\\{","\\}",":"];
- var opRegexp = tokenRegexp(operators);
- var pseudoElementsRegexp = /^::?[a-zA-Z_][\w\-]*/;
- var word;
- function isEndLine(stream) {
- return !stream.peek() || stream.match(/\s+$/, false);
- }
- function urlTokens(stream, state) {
- var ch = stream.peek();
- if (ch === ")") {
- stream.next();
- state.tokenizer = tokenBase;
- return "operator";
- } else if (ch === "(") {
- stream.next();
- stream.eatSpace();
- return "operator";
- } else if (ch === "'" || ch === '"') {
- state.tokenizer = buildStringTokenizer(stream.next());
- return "string";
- } else {
- state.tokenizer = buildStringTokenizer(")", false);
- return "string";
- }
- }
- function comment(indentation, multiLine) {
- return function(stream, state) {
- if (stream.sol() && stream.indentation() <= indentation) {
- state.tokenizer = tokenBase;
- return tokenBase(stream, state);
- }
- if (multiLine && stream.skipTo("*/")) {
- stream.next();
- stream.next();
- state.tokenizer = tokenBase;
- } else {
- stream.skipToEnd();
- }
- return "comment";
- };
- }
- function buildStringTokenizer(quote, greedy) {
- if (greedy == null) { greedy = true; }
- function stringTokenizer(stream, state) {
- var nextChar = stream.next();
- var peekChar = stream.peek();
- var previousChar = stream.string.charAt(stream.pos-2);
- var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\"));
- if (endingString) {
- if (nextChar !== quote && greedy) { stream.next(); }
- if (isEndLine(stream)) {
- state.cursorHalf = 0;
- }
- state.tokenizer = tokenBase;
- return "string";
- } else if (nextChar === "#" && peekChar === "{") {
- state.tokenizer = buildInterpolationTokenizer(stringTokenizer);
- stream.next();
- return "operator";
- } else {
- return "string";
- }
- }
- return stringTokenizer;
- }
- function buildInterpolationTokenizer(currentTokenizer) {
- return function(stream, state) {
- if (stream.peek() === "}") {
- stream.next();
- state.tokenizer = currentTokenizer;
- return "operator";
- } else {
- return tokenBase(stream, state);
- }
- };
- }
- function indent(state) {
- if (state.indentCount == 0) {
- state.indentCount++;
- var lastScopeOffset = state.scopes[0].offset;
- var currentOffset = lastScopeOffset + config.indentUnit;
- state.scopes.unshift({ offset:currentOffset });
- }
- }
- function dedent(state) {
- if (state.scopes.length == 1) return;
- state.scopes.shift();
- }
- function tokenBase(stream, state) {
- var ch = stream.peek();
- // Comment
- if (stream.match("/*")) {
- state.tokenizer = comment(stream.indentation(), true);
- return state.tokenizer(stream, state);
- }
- if (stream.match("//")) {
- state.tokenizer = comment(stream.indentation(), false);
- return state.tokenizer(stream, state);
- }
- // Interpolation
- if (stream.match("#{")) {
- state.tokenizer = buildInterpolationTokenizer(tokenBase);
- return "operator";
- }
- // Strings
- if (ch === '"' || ch === "'") {
- stream.next();
- state.tokenizer = buildStringTokenizer(ch);
- return "string";
- }
- if(!state.cursorHalf){// state.cursorHalf === 0
- // first half i.e. before : for key-value pairs
- // including selectors
- if (ch === "-") {
- if (stream.match(/^-\w+-/)) {
- return "meta";
- }
- }
- if (ch === ".") {
- stream.next();
- if (stream.match(/^[\w-]+/)) {
- indent(state);
- return "qualifier";
- } else if (stream.peek() === "#") {
- indent(state);
- return "tag";
- }
- }
- if (ch === "#") {
- stream.next();
- // ID selectors
- if (stream.match(/^[\w-]+/)) {
- indent(state);
- return "builtin";
- }
- if (stream.peek() === "#") {
- indent(state);
- return "tag";
- }
- }
- // Variables
- if (ch === "$") {
- stream.next();
- stream.eatWhile(/[\w-]/);
- return "variable-2";
- }
- // Numbers
- if (stream.match(/^-?[0-9\.]+/))
- return "number";
- // Units
- if (stream.match(/^(px|em|in)\b/))
- return "unit";
- if (stream.match(keywordsRegexp))
- return "keyword";
- if (stream.match(/^url/) && stream.peek() === "(") {
- state.tokenizer = urlTokens;
- return "atom";
- }
- if (ch === "=") {
- // Match shortcut mixin definition
- if (stream.match(/^=[\w-]+/)) {
- indent(state);
- return "meta";
- }
- }
- if (ch === "+") {
- // Match shortcut mixin definition
- if (stream.match(/^\+[\w-]+/)){
- return "variable-3";
- }
- }
- if(ch === "@"){
- if(stream.match('@extend')){
- if(!stream.match(/\s*[\w]/))
- dedent(state);
- }
- }
- // Indent Directives
- if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)) {
- indent(state);
- return "def";
- }
- // Other Directives
- if (ch === "@") {
- stream.next();
- stream.eatWhile(/[\w-]/);
- return "def";
- }
- if (stream.eatWhile(/[\w-]/)){
- if(stream.match(/ *: *[\w-\+\$#!\("']/,false)){
- word = stream.current().toLowerCase();
- var prop = state.prevProp + "-" + word;
- if (propertyKeywords.hasOwnProperty(prop)) {
- return "property";
- } else if (propertyKeywords.hasOwnProperty(word)) {
- state.prevProp = word;
- return "property";
- } else if (fontProperties.hasOwnProperty(word)) {
- return "property";
- }
- return "tag";
- }
- else if(stream.match(/ *:/,false)){
- indent(state);
- state.cursorHalf = 1;
- state.prevProp = stream.current().toLowerCase();
- return "property";
- }
- else if(stream.match(/ *,/,false)){
- return "tag";
- }
- else{
- indent(state);
- return "tag";
- }
- }
- if(ch === ":"){
- if (stream.match(pseudoElementsRegexp)){ // could be a pseudo-element
- return "variable-3";
- }
- stream.next();
- state.cursorHalf=1;
- return "operator";
- }
- } // cursorHalf===0 ends here
- else{
- if (ch === "#") {
- stream.next();
- // Hex numbers
- if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){
- if (isEndLine(stream)) {
- state.cursorHalf = 0;
- }
- return "number";
- }
- }
- // Numbers
- if (stream.match(/^-?[0-9\.]+/)){
- if (isEndLine(stream)) {
- state.cursorHalf = 0;
- }
- return "number";
- }
- // Units
- if (stream.match(/^(px|em|in)\b/)){
- if (isEndLine(stream)) {
- state.cursorHalf = 0;
- }
- return "unit";
- }
- if (stream.match(keywordsRegexp)){
- if (isEndLine(stream)) {
- state.cursorHalf = 0;
- }
- return "keyword";
- }
- if (stream.match(/^url/) && stream.peek() === "(") {
- state.tokenizer = urlTokens;
- if (isEndLine(stream)) {
- state.cursorHalf = 0;
- }
- return "atom";
- }
- // Variables
- if (ch === "$") {
- stream.next();
- stream.eatWhile(/[\w-]/);
- if (isEndLine(stream)) {
- state.cursorHalf = 0;
- }
- return "variable-2";
- }
- // bang character for !important, !default, etc.
- if (ch === "!") {
- stream.next();
- state.cursorHalf = 0;
- return stream.match(/^[\w]+/) ? "keyword": "operator";
- }
- if (stream.match(opRegexp)){
- if (isEndLine(stream)) {
- state.cursorHalf = 0;
- }
- return "operator";
- }
- // attributes
- if (stream.eatWhile(/[\w-]/)) {
- if (isEndLine(stream)) {
- state.cursorHalf = 0;
- }
- word = stream.current().toLowerCase();
- if (valueKeywords.hasOwnProperty(word)) {
- return "atom";
- } else if (colorKeywords.hasOwnProperty(word)) {
- return "keyword";
- } else if (propertyKeywords.hasOwnProperty(word)) {
- state.prevProp = stream.current().toLowerCase();
- return "property";
- } else {
- return "tag";
- }
- }
- //stream.eatSpace();
- if (isEndLine(stream)) {
- state.cursorHalf = 0;
- return null;
- }
- } // else ends here
- if (stream.match(opRegexp))
- return "operator";
- // If we haven't returned by now, we move 1 character
- // and return an error
- stream.next();
- return null;
- }
- function tokenLexer(stream, state) {
- if (stream.sol()) state.indentCount = 0;
- var style = state.tokenizer(stream, state);
- var current = stream.current();
- if (current === "@return" || current === "}"){
- dedent(state);
- }
- if (style !== null) {
- var startOfToken = stream.pos - current.length;
- var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount);
- var newScopes = [];
- for (var i = 0; i < state.scopes.length; i++) {
- var scope = state.scopes[i];
- if (scope.offset <= withCurrentIndent)
- newScopes.push(scope);
- }
- state.scopes = newScopes;
- }
- return style;
- }
- return {
- startState: function() {
- return {
- tokenizer: tokenBase,
- scopes: [{offset: 0, type: "sass"}],
- indentCount: 0,
- cursorHalf: 0, // cursor half tells us if cursor lies after (1)
- // or before (0) colon (well... more or less)
- definedVars: [],
- definedMixins: []
- };
- },
- token: function(stream, state) {
- var style = tokenLexer(stream, state);
- state.lastToken = { style: style, content: stream.current() };
- return style;
- },
- indent: function(state) {
- return state.scopes[0].offset;
- },
- blockCommentStart: "/*",
- blockCommentEnd: "*/",
- lineComment: "//",
- fold: "indent"
- };
- }, "css");
- CodeMirror.defineMIME("text/x-sass", "sass");
- });
- /***/ }),
- /***/ 54702:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631), __webpack_require__(87093));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.defineMode("twig:inner", function() {
- var keywords = ["and", "as", "autoescape", "endautoescape", "block", "do", "endblock", "else", "elseif", "extends", "for", "endfor", "embed", "endembed", "filter", "endfilter", "flush", "from", "if", "endif", "in", "is", "include", "import", "not", "or", "set", "spaceless", "endspaceless", "with", "endwith", "trans", "endtrans", "blocktrans", "endblocktrans", "macro", "endmacro", "use", "verbatim", "endverbatim"],
- operator = /^[+\-*&%=<>!?|~^]/,
- sign = /^[:\[\(\{]/,
- atom = ["true", "false", "null", "empty", "defined", "divisibleby", "divisible by", "even", "odd", "iterable", "sameas", "same as"],
- number = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
- keywords = new RegExp("((" + keywords.join(")|(") + "))\\b");
- atom = new RegExp("((" + atom.join(")|(") + "))\\b");
- function tokenBase (stream, state) {
- var ch = stream.peek();
- //Comment
- if (state.incomment) {
- if (!stream.skipTo("#}")) {
- stream.skipToEnd();
- } else {
- stream.eatWhile(/\#|}/);
- state.incomment = false;
- }
- return "comment";
- //Tag
- } else if (state.intag) {
- //After operator
- if (state.operator) {
- state.operator = false;
- if (stream.match(atom)) {
- return "atom";
- }
- if (stream.match(number)) {
- return "number";
- }
- }
- //After sign
- if (state.sign) {
- state.sign = false;
- if (stream.match(atom)) {
- return "atom";
- }
- if (stream.match(number)) {
- return "number";
- }
- }
- if (state.instring) {
- if (ch == state.instring) {
- state.instring = false;
- }
- stream.next();
- return "string";
- } else if (ch == "'" || ch == '"') {
- state.instring = ch;
- stream.next();
- return "string";
- } else if (stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) {
- state.intag = false;
- return "tag";
- } else if (stream.match(operator)) {
- state.operator = true;
- return "operator";
- } else if (stream.match(sign)) {
- state.sign = true;
- } else {
- if (stream.eat(" ") || stream.sol()) {
- if (stream.match(keywords)) {
- return "keyword";
- }
- if (stream.match(atom)) {
- return "atom";
- }
- if (stream.match(number)) {
- return "number";
- }
- if (stream.sol()) {
- stream.next();
- }
- } else {
- stream.next();
- }
- }
- return "variable";
- } else if (stream.eat("{")) {
- if (stream.eat("#")) {
- state.incomment = true;
- if (!stream.skipTo("#}")) {
- stream.skipToEnd();
- } else {
- stream.eatWhile(/\#|}/);
- state.incomment = false;
- }
- return "comment";
- //Open tag
- } else if (ch = stream.eat(/\{|%/)) {
- //Cache close tag
- state.intag = ch;
- if (ch == "{") {
- state.intag = "}";
- }
- stream.eat("-");
- return "tag";
- }
- }
- stream.next();
- };
- return {
- startState: function () {
- return {};
- },
- token: function (stream, state) {
- return tokenBase(stream, state);
- }
- };
- });
- CodeMirror.defineMode("twig", function(config, parserConfig) {
- var twigInner = CodeMirror.getMode(config, "twig:inner");
- if (!parserConfig || !parserConfig.base) return twigInner;
- return CodeMirror.multiplexingMode(
- CodeMirror.getMode(config, parserConfig.base), {
- open: /\{[{#%]/, close: /[}#%]\}/, mode: twigInner, parseDelimiters: true
- }
- );
- });
- CodeMirror.defineMIME("text/x-twig", "twig");
- });
- /***/ }),
- /***/ 29589:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- var htmlConfig = {
- autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
- 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
- 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
- 'track': true, 'wbr': true, 'menuitem': true},
- implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
- 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
- 'th': true, 'tr': true},
- contextGrabbers: {
- 'dd': {'dd': true, 'dt': true},
- 'dt': {'dd': true, 'dt': true},
- 'li': {'li': true},
- 'option': {'option': true, 'optgroup': true},
- 'optgroup': {'optgroup': true},
- 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
- 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
- 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
- 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
- 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
- 'rp': {'rp': true, 'rt': true},
- 'rt': {'rp': true, 'rt': true},
- 'tbody': {'tbody': true, 'tfoot': true},
- 'td': {'td': true, 'th': true},
- 'tfoot': {'tbody': true},
- 'th': {'td': true, 'th': true},
- 'thead': {'tbody': true, 'tfoot': true},
- 'tr': {'tr': true}
- },
- doNotIndent: {"pre": true},
- allowUnquoted: true,
- allowMissing: true,
- caseFold: true
- }
- var xmlConfig = {
- autoSelfClosers: {},
- implicitlyClosed: {},
- contextGrabbers: {},
- doNotIndent: {},
- allowUnquoted: false,
- allowMissing: false,
- allowMissingTagName: false,
- caseFold: false
- }
- CodeMirror.defineMode("xml", function(editorConf, config_) {
- var indentUnit = editorConf.indentUnit
- var config = {}
- var defaults = config_.htmlMode ? htmlConfig : xmlConfig
- for (var prop in defaults) config[prop] = defaults[prop]
- for (var prop in config_) config[prop] = config_[prop]
- // Return variables for tokenizers
- var type, setStyle;
- function inText(stream, state) {
- function chain(parser) {
- state.tokenize = parser;
- return parser(stream, state);
- }
- var ch = stream.next();
- if (ch == "<") {
- if (stream.eat("!")) {
- if (stream.eat("[")) {
- if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
- else return null;
- } else if (stream.match("--")) {
- return chain(inBlock("comment", "-->"));
- } else if (stream.match("DOCTYPE", true, true)) {
- stream.eatWhile(/[\w\._\-]/);
- return chain(doctype(1));
- } else {
- return null;
- }
- } else if (stream.eat("?")) {
- stream.eatWhile(/[\w\._\-]/);
- state.tokenize = inBlock("meta", "?>");
- return "meta";
- } else {
- type = stream.eat("/") ? "closeTag" : "openTag";
- state.tokenize = inTag;
- return "tag bracket";
- }
- } else if (ch == "&") {
- var ok;
- if (stream.eat("#")) {
- if (stream.eat("x")) {
- ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
- } else {
- ok = stream.eatWhile(/[\d]/) && stream.eat(";");
- }
- } else {
- ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
- }
- return ok ? "atom" : "error";
- } else {
- stream.eatWhile(/[^&<]/);
- return null;
- }
- }
- inText.isInText = true;
- function inTag(stream, state) {
- var ch = stream.next();
- if (ch == ">" || (ch == "/" && stream.eat(">"))) {
- state.tokenize = inText;
- type = ch == ">" ? "endTag" : "selfcloseTag";
- return "tag bracket";
- } else if (ch == "=") {
- type = "equals";
- return null;
- } else if (ch == "<") {
- state.tokenize = inText;
- state.state = baseState;
- state.tagName = state.tagStart = null;
- var next = state.tokenize(stream, state);
- return next ? next + " tag error" : "tag error";
- } else if (/[\'\"]/.test(ch)) {
- state.tokenize = inAttribute(ch);
- state.stringStartCol = stream.column();
- return state.tokenize(stream, state);
- } else {
- stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
- return "word";
- }
- }
- function inAttribute(quote) {
- var closure = function(stream, state) {
- while (!stream.eol()) {
- if (stream.next() == quote) {
- state.tokenize = inTag;
- break;
- }
- }
- return "string";
- };
- closure.isInAttribute = true;
- return closure;
- }
- function inBlock(style, terminator) {
- return function(stream, state) {
- while (!stream.eol()) {
- if (stream.match(terminator)) {
- state.tokenize = inText;
- break;
- }
- stream.next();
- }
- return style;
- }
- }
- function doctype(depth) {
- return function(stream, state) {
- var ch;
- while ((ch = stream.next()) != null) {
- if (ch == "<") {
- state.tokenize = doctype(depth + 1);
- return state.tokenize(stream, state);
- } else if (ch == ">") {
- if (depth == 1) {
- state.tokenize = inText;
- break;
- } else {
- state.tokenize = doctype(depth - 1);
- return state.tokenize(stream, state);
- }
- }
- }
- return "meta";
- };
- }
- function lower(tagName) {
- return tagName && tagName.toLowerCase();
- }
- function Context(state, tagName, startOfLine) {
- this.prev = state.context;
- this.tagName = tagName || "";
- this.indent = state.indented;
- this.startOfLine = startOfLine;
- if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
- this.noIndent = true;
- }
- function popContext(state) {
- if (state.context) state.context = state.context.prev;
- }
- function maybePopContext(state, nextTagName) {
- var parentTagName;
- while (true) {
- if (!state.context) {
- return;
- }
- parentTagName = state.context.tagName;
- if (!config.contextGrabbers.hasOwnProperty(lower(parentTagName)) ||
- !config.contextGrabbers[lower(parentTagName)].hasOwnProperty(lower(nextTagName))) {
- return;
- }
- popContext(state);
- }
- }
- function baseState(type, stream, state) {
- if (type == "openTag") {
- state.tagStart = stream.column();
- return tagNameState;
- } else if (type == "closeTag") {
- return closeTagNameState;
- } else {
- return baseState;
- }
- }
- function tagNameState(type, stream, state) {
- if (type == "word") {
- state.tagName = stream.current();
- setStyle = "tag";
- return attrState;
- } else if (config.allowMissingTagName && type == "endTag") {
- setStyle = "tag bracket";
- return attrState(type, stream, state);
- } else {
- setStyle = "error";
- return tagNameState;
- }
- }
- function closeTagNameState(type, stream, state) {
- if (type == "word") {
- var tagName = stream.current();
- if (state.context && state.context.tagName != tagName &&
- config.implicitlyClosed.hasOwnProperty(lower(state.context.tagName)))
- popContext(state);
- if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
- setStyle = "tag";
- return closeState;
- } else {
- setStyle = "tag error";
- return closeStateErr;
- }
- } else if (config.allowMissingTagName && type == "endTag") {
- setStyle = "tag bracket";
- return closeState(type, stream, state);
- } else {
- setStyle = "error";
- return closeStateErr;
- }
- }
- function closeState(type, _stream, state) {
- if (type != "endTag") {
- setStyle = "error";
- return closeState;
- }
- popContext(state);
- return baseState;
- }
- function closeStateErr(type, stream, state) {
- setStyle = "error";
- return closeState(type, stream, state);
- }
- function attrState(type, _stream, state) {
- if (type == "word") {
- setStyle = "attribute";
- return attrEqState;
- } else if (type == "endTag" || type == "selfcloseTag") {
- var tagName = state.tagName, tagStart = state.tagStart;
- state.tagName = state.tagStart = null;
- if (type == "selfcloseTag" ||
- config.autoSelfClosers.hasOwnProperty(lower(tagName))) {
- maybePopContext(state, tagName);
- } else {
- maybePopContext(state, tagName);
- state.context = new Context(state, tagName, tagStart == state.indented);
- }
- return baseState;
- }
- setStyle = "error";
- return attrState;
- }
- function attrEqState(type, stream, state) {
- if (type == "equals") return attrValueState;
- if (!config.allowMissing) setStyle = "error";
- return attrState(type, stream, state);
- }
- function attrValueState(type, stream, state) {
- if (type == "string") return attrContinuedState;
- if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
- setStyle = "error";
- return attrState(type, stream, state);
- }
- function attrContinuedState(type, stream, state) {
- if (type == "string") return attrContinuedState;
- return attrState(type, stream, state);
- }
- return {
- startState: function(baseIndent) {
- var state = {tokenize: inText,
- state: baseState,
- indented: baseIndent || 0,
- tagName: null, tagStart: null,
- context: null}
- if (baseIndent != null) state.baseIndent = baseIndent
- return state
- },
- token: function(stream, state) {
- if (!state.tagName && stream.sol())
- state.indented = stream.indentation();
- if (stream.eatSpace()) return null;
- type = null;
- var style = state.tokenize(stream, state);
- if ((style || type) && style != "comment") {
- setStyle = null;
- state.state = state.state(type || style, stream, state);
- if (setStyle)
- style = setStyle == "error" ? style + " error" : setStyle;
- }
- return style;
- },
- indent: function(state, textAfter, fullLine) {
- var context = state.context;
- // Indent multi-line strings (e.g. css).
- if (state.tokenize.isInAttribute) {
- if (state.tagStart == state.indented)
- return state.stringStartCol + 1;
- else
- return state.indented + indentUnit;
- }
- if (context && context.noIndent) return CodeMirror.Pass;
- if (state.tokenize != inTag && state.tokenize != inText)
- return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
- // Indent the starts of attribute names.
- if (state.tagName) {
- if (config.multilineTagIndentPastTag !== false)
- return state.tagStart + state.tagName.length + 2;
- else
- return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
- }
- if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
- var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
- if (tagAfter && tagAfter[1]) { // Closing tag spotted
- while (context) {
- if (context.tagName == tagAfter[2]) {
- context = context.prev;
- break;
- } else if (config.implicitlyClosed.hasOwnProperty(lower(context.tagName))) {
- context = context.prev;
- } else {
- break;
- }
- }
- } else if (tagAfter) { // Opening tag spotted
- while (context) {
- var grabbers = config.contextGrabbers[lower(context.tagName)];
- if (grabbers && grabbers.hasOwnProperty(lower(tagAfter[2])))
- context = context.prev;
- else
- break;
- }
- }
- while (context && context.prev && !context.startOfLine)
- context = context.prev;
- if (context) return context.indent + indentUnit;
- else return state.baseIndent || 0;
- },
- electricInput: /<\/[\s\w:]+>$/,
- blockCommentStart: "<!--",
- blockCommentEnd: "-->",
- configuration: config.htmlMode ? "html" : "xml",
- helperType: config.htmlMode ? "html" : "xml",
- skipAttribute: function(state) {
- if (state.state == attrValueState)
- state.state = attrState
- },
- xmlCurrentTag: function(state) {
- return state.tagName ? {name: state.tagName, close: state.type == "closeTag"} : null
- },
- xmlCurrentContext: function(state) {
- var context = []
- for (var cx = state.context; cx; cx = cx.prev)
- context.push(cx.tagName)
- return context.reverse()
- }
- };
- });
- CodeMirror.defineMIME("text/xml", "xml");
- CodeMirror.defineMIME("application/xml", "xml");
- if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
- CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
- });
- /***/ }),
- /***/ 53631:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // CodeMirror, copyright (c) by Marijn Haverbeke and others
- // Distributed under an MIT license: https://codemirror.net/LICENSE
- (function(mod) {
- if (true) // CommonJS
- mod(__webpack_require__(4631));
- else {}
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.defineMode("yaml", function() {
- var cons = ['true', 'false', 'on', 'off', 'yes', 'no'];
- var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i');
- return {
- token: function(stream, state) {
- var ch = stream.peek();
- var esc = state.escaped;
- state.escaped = false;
- /* comments */
- if (ch == "#" && (stream.pos == 0 || /\s/.test(stream.string.charAt(stream.pos - 1)))) {
- stream.skipToEnd();
- return "comment";
- }
- if (stream.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))
- return "string";
- if (state.literal && stream.indentation() > state.keyCol) {
- stream.skipToEnd(); return "string";
- } else if (state.literal) { state.literal = false; }
- if (stream.sol()) {
- state.keyCol = 0;
- state.pair = false;
- state.pairStart = false;
- /* document start */
- if(stream.match('---')) { return "def"; }
- /* document end */
- if (stream.match('...')) { return "def"; }
- /* array list item */
- if (stream.match(/\s*-\s+/)) { return 'meta'; }
- }
- /* inline pairs/lists */
- if (stream.match(/^(\{|\}|\[|\])/)) {
- if (ch == '{')
- state.inlinePairs++;
- else if (ch == '}')
- state.inlinePairs--;
- else if (ch == '[')
- state.inlineList++;
- else
- state.inlineList--;
- return 'meta';
- }
- /* list separator */
- if (state.inlineList > 0 && !esc && ch == ',') {
- stream.next();
- return 'meta';
- }
- /* pairs separator */
- if (state.inlinePairs > 0 && !esc && ch == ',') {
- state.keyCol = 0;
- state.pair = false;
- state.pairStart = false;
- stream.next();
- return 'meta';
- }
- /* start of value of a pair */
- if (state.pairStart) {
- /* block literals */
- if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; };
- /* references */
- if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; }
- /* numbers */
- if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; }
- if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; }
- /* keywords */
- if (stream.match(keywordRegex)) { return 'keyword'; }
- }
- /* pairs (associative arrays) -> key */
- if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)) {
- state.pair = true;
- state.keyCol = stream.indentation();
- return "atom";
- }
- if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; }
- /* nothing found, continue */
- state.pairStart = false;
- state.escaped = (ch == '\\');
- stream.next();
- return null;
- },
- startState: function() {
- return {
- pair: false,
- pairStart: false,
- keyCol: 0,
- inlinePairs: 0,
- inlineList: 0,
- literal: false,
- escaped: false
- };
- },
- lineComment: "#",
- fold: "indent"
- };
- });
- CodeMirror.defineMIME("text/x-yaml", "yaml");
- CodeMirror.defineMIME("text/yaml", "yaml");
- });
- /***/ }),
- /***/ 16266:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(95767);
- __webpack_require__(68132);
- __webpack_require__(48388);
- __webpack_require__(37470);
- __webpack_require__(94882);
- __webpack_require__(41520);
- __webpack_require__(27476);
- __webpack_require__(79622);
- __webpack_require__(89375);
- __webpack_require__(43533);
- __webpack_require__(84672);
- __webpack_require__(64157);
- __webpack_require__(35095);
- __webpack_require__(49892);
- __webpack_require__(75115);
- __webpack_require__(99176);
- __webpack_require__(68838);
- __webpack_require__(96253);
- __webpack_require__(39730);
- __webpack_require__(6059);
- __webpack_require__(48377);
- __webpack_require__(71084);
- __webpack_require__(64299);
- __webpack_require__(11246);
- __webpack_require__(30726);
- __webpack_require__(1901);
- __webpack_require__(75972);
- __webpack_require__(53403);
- __webpack_require__(92516);
- __webpack_require__(49371);
- __webpack_require__(86479);
- __webpack_require__(91736);
- __webpack_require__(51889);
- __webpack_require__(65177);
- __webpack_require__(81246);
- __webpack_require__(76503);
- __webpack_require__(66786);
- __webpack_require__(50932);
- __webpack_require__(57526);
- __webpack_require__(21591);
- __webpack_require__(9073);
- __webpack_require__(80347);
- __webpack_require__(30579);
- __webpack_require__(4669);
- __webpack_require__(67710);
- __webpack_require__(45789);
- __webpack_require__(33514);
- __webpack_require__(99978);
- __webpack_require__(58472);
- __webpack_require__(86946);
- __webpack_require__(35068);
- __webpack_require__(413);
- __webpack_require__(50191);
- __webpack_require__(98306);
- __webpack_require__(64564);
- __webpack_require__(39115);
- __webpack_require__(29539);
- __webpack_require__(96620);
- __webpack_require__(62850);
- __webpack_require__(10823);
- __webpack_require__(17732);
- __webpack_require__(40856);
- __webpack_require__(80703);
- __webpack_require__(91539);
- __webpack_require__(5292);
- __webpack_require__(45177);
- __webpack_require__(73694);
- __webpack_require__(37648);
- __webpack_require__(27795);
- __webpack_require__(4531);
- __webpack_require__(23605);
- __webpack_require__(6780);
- __webpack_require__(69937);
- __webpack_require__(10511);
- __webpack_require__(81822);
- __webpack_require__(19977);
- __webpack_require__(91031);
- __webpack_require__(46331);
- __webpack_require__(41560);
- __webpack_require__(20774);
- __webpack_require__(30522);
- __webpack_require__(58295);
- __webpack_require__(87842);
- __webpack_require__(50110);
- __webpack_require__(20075);
- __webpack_require__(24336);
- __webpack_require__(19371);
- __webpack_require__(98837);
- __webpack_require__(26773);
- __webpack_require__(15745);
- __webpack_require__(33057);
- __webpack_require__(3750);
- __webpack_require__(23369);
- __webpack_require__(99564);
- __webpack_require__(32000);
- __webpack_require__(48977);
- __webpack_require__(52310);
- __webpack_require__(94899);
- __webpack_require__(31842);
- __webpack_require__(56997);
- __webpack_require__(83946);
- __webpack_require__(18269);
- __webpack_require__(66108);
- __webpack_require__(76774);
- __webpack_require__(21466);
- __webpack_require__(59357);
- __webpack_require__(76142);
- __webpack_require__(51876);
- __webpack_require__(40851);
- __webpack_require__(88416);
- __webpack_require__(98184);
- __webpack_require__(30147);
- __webpack_require__(59192);
- __webpack_require__(30142);
- __webpack_require__(1786);
- __webpack_require__(75368);
- __webpack_require__(46964);
- __webpack_require__(62152);
- __webpack_require__(74821);
- __webpack_require__(79103);
- __webpack_require__(81303);
- __webpack_require__(83318);
- __webpack_require__(70162);
- __webpack_require__(33834);
- __webpack_require__(21572);
- __webpack_require__(82139);
- __webpack_require__(10685);
- __webpack_require__(85535);
- __webpack_require__(17347);
- __webpack_require__(83049);
- __webpack_require__(96633);
- __webpack_require__(68989);
- __webpack_require__(78270);
- __webpack_require__(64510);
- __webpack_require__(73984);
- __webpack_require__(75769);
- __webpack_require__(50055);
- __webpack_require__(96014);
- module.exports = __webpack_require__(25645);
- /***/ }),
- /***/ 70911:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(1268);
- module.exports = __webpack_require__(25645).Array.flatMap;
- /***/ }),
- /***/ 10990:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(62773);
- module.exports = __webpack_require__(25645).Array.includes;
- /***/ }),
- /***/ 15434:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(83276);
- module.exports = __webpack_require__(25645).Object.entries;
- /***/ }),
- /***/ 78051:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(98351);
- module.exports = __webpack_require__(25645).Object.getOwnPropertyDescriptors;
- /***/ }),
- /***/ 38250:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(96409);
- module.exports = __webpack_require__(25645).Object.values;
- /***/ }),
- /***/ 54952:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- __webpack_require__(40851);
- __webpack_require__(9865);
- module.exports = __webpack_require__(25645).Promise["finally"];
- /***/ }),
- /***/ 6197:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(92770);
- module.exports = __webpack_require__(25645).String.padEnd;
- /***/ }),
- /***/ 14160:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(41784);
- module.exports = __webpack_require__(25645).String.padStart;
- /***/ }),
- /***/ 54039:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(94325);
- module.exports = __webpack_require__(25645).String.trimRight;
- /***/ }),
- /***/ 96728:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(65869);
- module.exports = __webpack_require__(25645).String.trimLeft;
- /***/ }),
- /***/ 93568:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(79665);
- module.exports = (__webpack_require__(28787).f)('asyncIterator');
- /***/ }),
- /***/ 40115:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(34579);
- module.exports = __webpack_require__(11327).global;
- /***/ }),
- /***/ 85663:
- /***/ ((module) => {
- module.exports = function (it) {
- if (typeof it != 'function') throw TypeError(it + ' is not a function!');
- return it;
- };
- /***/ }),
- /***/ 12159:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(36727);
- module.exports = function (it) {
- if (!isObject(it)) throw TypeError(it + ' is not an object!');
- return it;
- };
- /***/ }),
- /***/ 11327:
- /***/ ((module) => {
- var core = module.exports = { version: '2.6.11' };
- if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
- /***/ }),
- /***/ 19216:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // optional / simple context binding
- var aFunction = __webpack_require__(85663);
- module.exports = function (fn, that, length) {
- aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- case 1: return function (a) {
- return fn.call(that, a);
- };
- case 2: return function (a, b) {
- return fn.call(that, a, b);
- };
- case 3: return function (a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function (/* ...args */) {
- return fn.apply(that, arguments);
- };
- };
- /***/ }),
- /***/ 89666:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // Thank's IE8 for his funny defineProperty
- module.exports = !__webpack_require__(7929)(function () {
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
- });
- /***/ }),
- /***/ 97467:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(36727);
- var document = (__webpack_require__(33938).document);
- // typeof document.createElement is 'object' in old IE
- var is = isObject(document) && isObject(document.createElement);
- module.exports = function (it) {
- return is ? document.createElement(it) : {};
- };
- /***/ }),
- /***/ 83856:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(33938);
- var core = __webpack_require__(11327);
- var ctx = __webpack_require__(19216);
- var hide = __webpack_require__(41818);
- var has = __webpack_require__(27069);
- var PROTOTYPE = 'prototype';
- var $export = function (type, name, source) {
- var IS_FORCED = type & $export.F;
- var IS_GLOBAL = type & $export.G;
- var IS_STATIC = type & $export.S;
- var IS_PROTO = type & $export.P;
- var IS_BIND = type & $export.B;
- var IS_WRAP = type & $export.W;
- var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
- var expProto = exports[PROTOTYPE];
- var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
- var key, own, out;
- if (IS_GLOBAL) source = name;
- for (key in source) {
- // contains in native
- own = !IS_FORCED && target && target[key] !== undefined;
- if (own && has(exports, key)) continue;
- // export native or passed
- out = own ? target[key] : source[key];
- // prevent global pollution for namespaces
- exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
- // bind timers to global for call from export context
- : IS_BIND && own ? ctx(out, global)
- // wrap global constructors for prevent change them in library
- : IS_WRAP && target[key] == out ? (function (C) {
- var F = function (a, b, c) {
- if (this instanceof C) {
- switch (arguments.length) {
- case 0: return new C();
- case 1: return new C(a);
- case 2: return new C(a, b);
- } return new C(a, b, c);
- } return C.apply(this, arguments);
- };
- F[PROTOTYPE] = C[PROTOTYPE];
- return F;
- // make static versions for prototype methods
- })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
- // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
- if (IS_PROTO) {
- (exports.virtual || (exports.virtual = {}))[key] = out;
- // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
- if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
- }
- }
- };
- // type bitmap
- $export.F = 1; // forced
- $export.G = 2; // global
- $export.S = 4; // static
- $export.P = 8; // proto
- $export.B = 16; // bind
- $export.W = 32; // wrap
- $export.U = 64; // safe
- $export.R = 128; // real proto method for `library`
- module.exports = $export;
- /***/ }),
- /***/ 7929:
- /***/ ((module) => {
- module.exports = function (exec) {
- try {
- return !!exec();
- } catch (e) {
- return true;
- }
- };
- /***/ }),
- /***/ 33938:
- /***/ ((module) => {
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self
- // eslint-disable-next-line no-new-func
- : Function('return this')();
- if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
- /***/ }),
- /***/ 27069:
- /***/ ((module) => {
- var hasOwnProperty = {}.hasOwnProperty;
- module.exports = function (it, key) {
- return hasOwnProperty.call(it, key);
- };
- /***/ }),
- /***/ 41818:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var dP = __webpack_require__(4743);
- var createDesc = __webpack_require__(83101);
- module.exports = __webpack_require__(89666) ? function (object, key, value) {
- return dP.f(object, key, createDesc(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
- /***/ }),
- /***/ 33758:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- module.exports = !__webpack_require__(89666) && !__webpack_require__(7929)(function () {
- return Object.defineProperty(__webpack_require__(97467)('div'), 'a', { get: function () { return 7; } }).a != 7;
- });
- /***/ }),
- /***/ 36727:
- /***/ ((module) => {
- module.exports = function (it) {
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
- /***/ }),
- /***/ 4743:
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- var anObject = __webpack_require__(12159);
- var IE8_DOM_DEFINE = __webpack_require__(33758);
- var toPrimitive = __webpack_require__(33206);
- var dP = Object.defineProperty;
- exports.f = __webpack_require__(89666) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPrimitive(P, true);
- anObject(Attributes);
- if (IE8_DOM_DEFINE) try {
- return dP(O, P, Attributes);
- } catch (e) { /* empty */ }
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
- };
- /***/ }),
- /***/ 83101:
- /***/ ((module) => {
- module.exports = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
- /***/ }),
- /***/ 33206:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 7.1.1 ToPrimitive(input [, PreferredType])
- var isObject = __webpack_require__(36727);
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
- // and the second argument - flag - preferred type is a string
- module.exports = function (it, S) {
- if (!isObject(it)) return it;
- var fn, val;
- if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
- if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
- if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
- throw TypeError("Can't convert object to primitive value");
- };
- /***/ }),
- /***/ 34579:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // https://github.com/tc39/proposal-global
- var $export = __webpack_require__(83856);
- $export($export.G, { global: __webpack_require__(33938) });
- /***/ }),
- /***/ 24963:
- /***/ ((module) => {
- module.exports = function (it) {
- if (typeof it != 'function') throw TypeError(it + ' is not a function!');
- return it;
- };
- /***/ }),
- /***/ 83365:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var cof = __webpack_require__(92032);
- module.exports = function (it, msg) {
- if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);
- return +it;
- };
- /***/ }),
- /***/ 17722:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 22.1.3.31 Array.prototype[@@unscopables]
- var UNSCOPABLES = __webpack_require__(86314)('unscopables');
- var ArrayProto = Array.prototype;
- if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(87728)(ArrayProto, UNSCOPABLES, {});
- module.exports = function (key) {
- ArrayProto[UNSCOPABLES][key] = true;
- };
- /***/ }),
- /***/ 76793:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var at = __webpack_require__(24496)(true);
- // `AdvanceStringIndex` abstract operation
- // https://tc39.github.io/ecma262/#sec-advancestringindex
- module.exports = function (S, index, unicode) {
- return index + (unicode ? at(S, index).length : 1);
- };
- /***/ }),
- /***/ 83328:
- /***/ ((module) => {
- module.exports = function (it, Constructor, name, forbiddenField) {
- if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
- throw TypeError(name + ': incorrect invocation!');
- } return it;
- };
- /***/ }),
- /***/ 27007:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(55286);
- module.exports = function (it) {
- if (!isObject(it)) throw TypeError(it + ' is not an object!');
- return it;
- };
- /***/ }),
- /***/ 5216:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
- var toObject = __webpack_require__(20508);
- var toAbsoluteIndex = __webpack_require__(92337);
- var toLength = __webpack_require__(10875);
- module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
- var O = toObject(this);
- var len = toLength(O.length);
- var to = toAbsoluteIndex(target, len);
- var from = toAbsoluteIndex(start, len);
- var end = arguments.length > 2 ? arguments[2] : undefined;
- var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
- var inc = 1;
- if (from < to && to < from + count) {
- inc = -1;
- from += count - 1;
- to += count - 1;
- }
- while (count-- > 0) {
- if (from in O) O[to] = O[from];
- else delete O[to];
- to += inc;
- from += inc;
- } return O;
- };
- /***/ }),
- /***/ 46852:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
- var toObject = __webpack_require__(20508);
- var toAbsoluteIndex = __webpack_require__(92337);
- var toLength = __webpack_require__(10875);
- module.exports = function fill(value /* , start = 0, end = @length */) {
- var O = toObject(this);
- var length = toLength(O.length);
- var aLen = arguments.length;
- var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
- var end = aLen > 2 ? arguments[2] : undefined;
- var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
- while (endPos > index) O[index++] = value;
- return O;
- };
- /***/ }),
- /***/ 79315:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // false -> Array#indexOf
- // true -> Array#includes
- var toIObject = __webpack_require__(22110);
- var toLength = __webpack_require__(10875);
- var toAbsoluteIndex = __webpack_require__(92337);
- module.exports = function (IS_INCLUDES) {
- return function ($this, el, fromIndex) {
- var O = toIObject($this);
- var length = toLength(O.length);
- var index = toAbsoluteIndex(fromIndex, length);
- var value;
- // Array#includes uses SameValueZero equality algorithm
- // eslint-disable-next-line no-self-compare
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
- // eslint-disable-next-line no-self-compare
- if (value != value) return true;
- // Array#indexOf ignores holes, Array#includes - not
- } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
- if (O[index] === el) return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
- };
- /***/ }),
- /***/ 10050:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 0 -> Array#forEach
- // 1 -> Array#map
- // 2 -> Array#filter
- // 3 -> Array#some
- // 4 -> Array#every
- // 5 -> Array#find
- // 6 -> Array#findIndex
- var ctx = __webpack_require__(741);
- var IObject = __webpack_require__(49797);
- var toObject = __webpack_require__(20508);
- var toLength = __webpack_require__(10875);
- var asc = __webpack_require__(16886);
- module.exports = function (TYPE, $create) {
- var IS_MAP = TYPE == 1;
- var IS_FILTER = TYPE == 2;
- var IS_SOME = TYPE == 3;
- var IS_EVERY = TYPE == 4;
- var IS_FIND_INDEX = TYPE == 6;
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- var create = $create || asc;
- return function ($this, callbackfn, that) {
- var O = toObject($this);
- var self = IObject(O);
- var f = ctx(callbackfn, that, 3);
- var length = toLength(self.length);
- var index = 0;
- var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
- var val, res;
- for (;length > index; index++) if (NO_HOLES || index in self) {
- val = self[index];
- res = f(val, index, O);
- if (TYPE) {
- if (IS_MAP) result[index] = res; // map
- else if (res) switch (TYPE) {
- case 3: return true; // some
- case 5: return val; // find
- case 6: return index; // findIndex
- case 2: result.push(val); // filter
- } else if (IS_EVERY) return false; // every
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
- };
- };
- /***/ }),
- /***/ 37628:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var aFunction = __webpack_require__(24963);
- var toObject = __webpack_require__(20508);
- var IObject = __webpack_require__(49797);
- var toLength = __webpack_require__(10875);
- module.exports = function (that, callbackfn, aLen, memo, isRight) {
- aFunction(callbackfn);
- var O = toObject(that);
- var self = IObject(O);
- var length = toLength(O.length);
- var index = isRight ? length - 1 : 0;
- var i = isRight ? -1 : 1;
- if (aLen < 2) for (;;) {
- if (index in self) {
- memo = self[index];
- index += i;
- break;
- }
- index += i;
- if (isRight ? index < 0 : length <= index) {
- throw TypeError('Reduce of empty array with no initial value');
- }
- }
- for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
- memo = callbackfn(memo, self[index], index, O);
- }
- return memo;
- };
- /***/ }),
- /***/ 42736:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(55286);
- var isArray = __webpack_require__(4302);
- var SPECIES = __webpack_require__(86314)('species');
- module.exports = function (original) {
- var C;
- if (isArray(original)) {
- C = original.constructor;
- // cross-realm fallback
- if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
- if (isObject(C)) {
- C = C[SPECIES];
- if (C === null) C = undefined;
- }
- } return C === undefined ? Array : C;
- };
- /***/ }),
- /***/ 16886:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
- var speciesConstructor = __webpack_require__(42736);
- module.exports = function (original, length) {
- return new (speciesConstructor(original))(length);
- };
- /***/ }),
- /***/ 34398:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var aFunction = __webpack_require__(24963);
- var isObject = __webpack_require__(55286);
- var invoke = __webpack_require__(97242);
- var arraySlice = [].slice;
- var factories = {};
- var construct = function (F, len, args) {
- if (!(len in factories)) {
- for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
- // eslint-disable-next-line no-new-func
- factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
- } return factories[len](F, args);
- };
- module.exports = Function.bind || function bind(that /* , ...args */) {
- var fn = aFunction(this);
- var partArgs = arraySlice.call(arguments, 1);
- var bound = function (/* args... */) {
- var args = partArgs.concat(arraySlice.call(arguments));
- return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
- };
- if (isObject(fn.prototype)) bound.prototype = fn.prototype;
- return bound;
- };
- /***/ }),
- /***/ 41488:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // getting tag from 19.1.3.6 Object.prototype.toString()
- var cof = __webpack_require__(92032);
- var TAG = __webpack_require__(86314)('toStringTag');
- // ES3 wrong here
- var ARG = cof(function () { return arguments; }()) == 'Arguments';
- // fallback for IE11 Script Access Denied error
- var tryGet = function (it, key) {
- try {
- return it[key];
- } catch (e) { /* empty */ }
- };
- module.exports = function (it) {
- var O, T, B;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
- // @@toStringTag case
- : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
- // builtinTag case
- : ARG ? cof(O)
- // ES3 arguments fallback
- : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
- };
- /***/ }),
- /***/ 92032:
- /***/ ((module) => {
- var toString = {}.toString;
- module.exports = function (it) {
- return toString.call(it).slice(8, -1);
- };
- /***/ }),
- /***/ 9824:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var dP = (__webpack_require__(99275).f);
- var create = __webpack_require__(42503);
- var redefineAll = __webpack_require__(24408);
- var ctx = __webpack_require__(741);
- var anInstance = __webpack_require__(83328);
- var forOf = __webpack_require__(3531);
- var $iterDefine = __webpack_require__(42923);
- var step = __webpack_require__(15436);
- var setSpecies = __webpack_require__(2974);
- var DESCRIPTORS = __webpack_require__(67057);
- var fastKey = (__webpack_require__(84728).fastKey);
- var validate = __webpack_require__(1616);
- var SIZE = DESCRIPTORS ? '_s' : 'size';
- var getEntry = function (that, key) {
- // fast case
- var index = fastKey(key);
- var entry;
- if (index !== 'F') return that._i[index];
- // frozen object case
- for (entry = that._f; entry; entry = entry.n) {
- if (entry.k == key) return entry;
- }
- };
- module.exports = {
- getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
- var C = wrapper(function (that, iterable) {
- anInstance(that, C, NAME, '_i');
- that._t = NAME; // collection type
- that._i = create(null); // index
- that._f = undefined; // first entry
- that._l = undefined; // last entry
- that[SIZE] = 0; // size
- if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
- });
- redefineAll(C.prototype, {
- // 23.1.3.1 Map.prototype.clear()
- // 23.2.3.2 Set.prototype.clear()
- clear: function clear() {
- for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
- entry.r = true;
- if (entry.p) entry.p = entry.p.n = undefined;
- delete data[entry.i];
- }
- that._f = that._l = undefined;
- that[SIZE] = 0;
- },
- // 23.1.3.3 Map.prototype.delete(key)
- // 23.2.3.4 Set.prototype.delete(value)
- 'delete': function (key) {
- var that = validate(this, NAME);
- var entry = getEntry(that, key);
- if (entry) {
- var next = entry.n;
- var prev = entry.p;
- delete that._i[entry.i];
- entry.r = true;
- if (prev) prev.n = next;
- if (next) next.p = prev;
- if (that._f == entry) that._f = next;
- if (that._l == entry) that._l = prev;
- that[SIZE]--;
- } return !!entry;
- },
- // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
- // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
- forEach: function forEach(callbackfn /* , that = undefined */) {
- validate(this, NAME);
- var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
- var entry;
- while (entry = entry ? entry.n : this._f) {
- f(entry.v, entry.k, this);
- // revert to the last existing entry
- while (entry && entry.r) entry = entry.p;
- }
- },
- // 23.1.3.7 Map.prototype.has(key)
- // 23.2.3.7 Set.prototype.has(value)
- has: function has(key) {
- return !!getEntry(validate(this, NAME), key);
- }
- });
- if (DESCRIPTORS) dP(C.prototype, 'size', {
- get: function () {
- return validate(this, NAME)[SIZE];
- }
- });
- return C;
- },
- def: function (that, key, value) {
- var entry = getEntry(that, key);
- var prev, index;
- // change existing entry
- if (entry) {
- entry.v = value;
- // create new entry
- } else {
- that._l = entry = {
- i: index = fastKey(key, true), // <- index
- k: key, // <- key
- v: value, // <- value
- p: prev = that._l, // <- previous entry
- n: undefined, // <- next entry
- r: false // <- removed
- };
- if (!that._f) that._f = entry;
- if (prev) prev.n = entry;
- that[SIZE]++;
- // add to index
- if (index !== 'F') that._i[index] = entry;
- } return that;
- },
- getEntry: getEntry,
- setStrong: function (C, NAME, IS_MAP) {
- // add .keys, .values, .entries, [@@iterator]
- // 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
- $iterDefine(C, NAME, function (iterated, kind) {
- this._t = validate(iterated, NAME); // target
- this._k = kind; // kind
- this._l = undefined; // previous
- }, function () {
- var that = this;
- var kind = that._k;
- var entry = that._l;
- // revert to the last existing entry
- while (entry && entry.r) entry = entry.p;
- // get next entry
- if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
- // or finish the iteration
- that._t = undefined;
- return step(1);
- }
- // return step by kind
- if (kind == 'keys') return step(0, entry.k);
- if (kind == 'values') return step(0, entry.v);
- return step(0, [entry.k, entry.v]);
- }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
- // add [@@species], 23.1.2.2, 23.2.2.2
- setSpecies(NAME);
- }
- };
- /***/ }),
- /***/ 23657:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var redefineAll = __webpack_require__(24408);
- var getWeak = (__webpack_require__(84728).getWeak);
- var anObject = __webpack_require__(27007);
- var isObject = __webpack_require__(55286);
- var anInstance = __webpack_require__(83328);
- var forOf = __webpack_require__(3531);
- var createArrayMethod = __webpack_require__(10050);
- var $has = __webpack_require__(79181);
- var validate = __webpack_require__(1616);
- var arrayFind = createArrayMethod(5);
- var arrayFindIndex = createArrayMethod(6);
- var id = 0;
- // fallback for uncaught frozen keys
- var uncaughtFrozenStore = function (that) {
- return that._l || (that._l = new UncaughtFrozenStore());
- };
- var UncaughtFrozenStore = function () {
- this.a = [];
- };
- var findUncaughtFrozen = function (store, key) {
- return arrayFind(store.a, function (it) {
- return it[0] === key;
- });
- };
- UncaughtFrozenStore.prototype = {
- get: function (key) {
- var entry = findUncaughtFrozen(this, key);
- if (entry) return entry[1];
- },
- has: function (key) {
- return !!findUncaughtFrozen(this, key);
- },
- set: function (key, value) {
- var entry = findUncaughtFrozen(this, key);
- if (entry) entry[1] = value;
- else this.a.push([key, value]);
- },
- 'delete': function (key) {
- var index = arrayFindIndex(this.a, function (it) {
- return it[0] === key;
- });
- if (~index) this.a.splice(index, 1);
- return !!~index;
- }
- };
- module.exports = {
- getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
- var C = wrapper(function (that, iterable) {
- anInstance(that, C, NAME, '_i');
- that._t = NAME; // collection type
- that._i = id++; // collection id
- that._l = undefined; // leak store for uncaught frozen objects
- if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
- });
- redefineAll(C.prototype, {
- // 23.3.3.2 WeakMap.prototype.delete(key)
- // 23.4.3.3 WeakSet.prototype.delete(value)
- 'delete': function (key) {
- if (!isObject(key)) return false;
- var data = getWeak(key);
- if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
- return data && $has(data, this._i) && delete data[this._i];
- },
- // 23.3.3.4 WeakMap.prototype.has(key)
- // 23.4.3.4 WeakSet.prototype.has(value)
- has: function has(key) {
- if (!isObject(key)) return false;
- var data = getWeak(key);
- if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
- return data && $has(data, this._i);
- }
- });
- return C;
- },
- def: function (that, key, value) {
- var data = getWeak(anObject(key), true);
- if (data === true) uncaughtFrozenStore(that).set(key, value);
- else data[that._i] = value;
- return that;
- },
- ufstore: uncaughtFrozenStore
- };
- /***/ }),
- /***/ 45795:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var global = __webpack_require__(3816);
- var $export = __webpack_require__(42985);
- var redefine = __webpack_require__(77234);
- var redefineAll = __webpack_require__(24408);
- var meta = __webpack_require__(84728);
- var forOf = __webpack_require__(3531);
- var anInstance = __webpack_require__(83328);
- var isObject = __webpack_require__(55286);
- var fails = __webpack_require__(74253);
- var $iterDetect = __webpack_require__(7462);
- var setToStringTag = __webpack_require__(22943);
- var inheritIfRequired = __webpack_require__(40266);
- module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
- var Base = global[NAME];
- var C = Base;
- var ADDER = IS_MAP ? 'set' : 'add';
- var proto = C && C.prototype;
- var O = {};
- var fixMethod = function (KEY) {
- var fn = proto[KEY];
- redefine(proto, KEY,
- KEY == 'delete' ? function (a) {
- return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'has' ? function has(a) {
- return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'get' ? function get(a) {
- return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
- : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
- );
- };
- if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
- new C().entries().next();
- }))) {
- // create collection constructor
- C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
- redefineAll(C.prototype, methods);
- meta.NEED = true;
- } else {
- var instance = new C();
- // early implementations not supports chaining
- var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
- // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
- var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
- // most early implementations doesn't supports iterables, most modern - not close it correctly
- var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
- // for early implementations -0 and +0 not the same
- var BUGGY_ZERO = !IS_WEAK && fails(function () {
- // V8 ~ Chromium 42- fails only with 5+ elements
- var $instance = new C();
- var index = 5;
- while (index--) $instance[ADDER](index, index);
- return !$instance.has(-0);
- });
- if (!ACCEPT_ITERABLES) {
- C = wrapper(function (target, iterable) {
- anInstance(target, C, NAME);
- var that = inheritIfRequired(new Base(), target, C);
- if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
- return that;
- });
- C.prototype = proto;
- proto.constructor = C;
- }
- if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
- fixMethod('delete');
- fixMethod('has');
- IS_MAP && fixMethod('get');
- }
- if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
- // weak collections should not contains .clear method
- if (IS_WEAK && proto.clear) delete proto.clear;
- }
- setToStringTag(C, NAME);
- O[NAME] = C;
- $export($export.G + $export.W + $export.F * (C != Base), O);
- if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
- return C;
- };
- /***/ }),
- /***/ 25645:
- /***/ ((module) => {
- var core = module.exports = { version: '2.6.11' };
- if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
- /***/ }),
- /***/ 92811:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $defineProperty = __webpack_require__(99275);
- var createDesc = __webpack_require__(90681);
- module.exports = function (object, index, value) {
- if (index in object) $defineProperty.f(object, index, createDesc(0, value));
- else object[index] = value;
- };
- /***/ }),
- /***/ 741:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // optional / simple context binding
- var aFunction = __webpack_require__(24963);
- module.exports = function (fn, that, length) {
- aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- case 1: return function (a) {
- return fn.call(that, a);
- };
- case 2: return function (a, b) {
- return fn.call(that, a, b);
- };
- case 3: return function (a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function (/* ...args */) {
- return fn.apply(that, arguments);
- };
- };
- /***/ }),
- /***/ 53537:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
- var fails = __webpack_require__(74253);
- var getTime = Date.prototype.getTime;
- var $toISOString = Date.prototype.toISOString;
- var lz = function (num) {
- return num > 9 ? num : '0' + num;
- };
- // PhantomJS / old WebKit has a broken implementations
- module.exports = (fails(function () {
- return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
- }) || !fails(function () {
- $toISOString.call(new Date(NaN));
- })) ? function toISOString() {
- if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
- var d = this;
- var y = d.getUTCFullYear();
- var m = d.getUTCMilliseconds();
- var s = y < 0 ? '-' : y > 9999 ? '+' : '';
- return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
- '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
- 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
- ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
- } : $toISOString;
- /***/ }),
- /***/ 870:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var anObject = __webpack_require__(27007);
- var toPrimitive = __webpack_require__(21689);
- var NUMBER = 'number';
- module.exports = function (hint) {
- if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');
- return toPrimitive(anObject(this), hint != NUMBER);
- };
- /***/ }),
- /***/ 91355:
- /***/ ((module) => {
- // 7.2.1 RequireObjectCoercible(argument)
- module.exports = function (it) {
- if (it == undefined) throw TypeError("Can't call method on " + it);
- return it;
- };
- /***/ }),
- /***/ 67057:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // Thank's IE8 for his funny defineProperty
- module.exports = !__webpack_require__(74253)(function () {
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
- });
- /***/ }),
- /***/ 62457:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(55286);
- var document = (__webpack_require__(3816).document);
- // typeof document.createElement is 'object' in old IE
- var is = isObject(document) && isObject(document.createElement);
- module.exports = function (it) {
- return is ? document.createElement(it) : {};
- };
- /***/ }),
- /***/ 74430:
- /***/ ((module) => {
- // IE 8- don't enum bug keys
- module.exports = (
- 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
- ).split(',');
- /***/ }),
- /***/ 5541:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // all enumerable object keys, includes symbols
- var getKeys = __webpack_require__(47184);
- var gOPS = __webpack_require__(64548);
- var pIE = __webpack_require__(14682);
- module.exports = function (it) {
- var result = getKeys(it);
- var getSymbols = gOPS.f;
- if (getSymbols) {
- var symbols = getSymbols(it);
- var isEnum = pIE.f;
- var i = 0;
- var key;
- while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
- } return result;
- };
- /***/ }),
- /***/ 42985:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(3816);
- var core = __webpack_require__(25645);
- var hide = __webpack_require__(87728);
- var redefine = __webpack_require__(77234);
- var ctx = __webpack_require__(741);
- var PROTOTYPE = 'prototype';
- var $export = function (type, name, source) {
- var IS_FORCED = type & $export.F;
- var IS_GLOBAL = type & $export.G;
- var IS_STATIC = type & $export.S;
- var IS_PROTO = type & $export.P;
- var IS_BIND = type & $export.B;
- var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
- var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
- var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
- var key, own, out, exp;
- if (IS_GLOBAL) source = name;
- for (key in source) {
- // contains in native
- own = !IS_FORCED && target && target[key] !== undefined;
- // export native or passed
- out = (own ? target : source)[key];
- // bind timers to global for call from export context
- exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
- // extend global
- if (target) redefine(target, key, out, type & $export.U);
- // export
- if (exports[key] != out) hide(exports, key, exp);
- if (IS_PROTO && expProto[key] != out) expProto[key] = out;
- }
- };
- global.core = core;
- // type bitmap
- $export.F = 1; // forced
- $export.G = 2; // global
- $export.S = 4; // static
- $export.P = 8; // proto
- $export.B = 16; // bind
- $export.W = 32; // wrap
- $export.U = 64; // safe
- $export.R = 128; // real proto method for `library`
- module.exports = $export;
- /***/ }),
- /***/ 8852:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var MATCH = __webpack_require__(86314)('match');
- module.exports = function (KEY) {
- var re = /./;
- try {
- '/./'[KEY](re);
- } catch (e) {
- try {
- re[MATCH] = false;
- return !'/./'[KEY](re);
- } catch (f) { /* empty */ }
- } return true;
- };
- /***/ }),
- /***/ 74253:
- /***/ ((module) => {
- module.exports = function (exec) {
- try {
- return !!exec();
- } catch (e) {
- return true;
- }
- };
- /***/ }),
- /***/ 28082:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- __webpack_require__(18269);
- var redefine = __webpack_require__(77234);
- var hide = __webpack_require__(87728);
- var fails = __webpack_require__(74253);
- var defined = __webpack_require__(91355);
- var wks = __webpack_require__(86314);
- var regexpExec = __webpack_require__(21165);
- var SPECIES = wks('species');
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
- // #replace needs built-in support for named groups.
- // #match works fine because it just return the exec results, even if it has
- // a "grops" property.
- var re = /./;
- re.exec = function () {
- var result = [];
- result.groups = { a: '7' };
- return result;
- };
- return ''.replace(re, '$<a>') !== '7';
- });
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
- var re = /(?:)/;
- var originalExec = re.exec;
- re.exec = function () { return originalExec.apply(this, arguments); };
- var result = 'ab'.split(re);
- return result.length === 2 && result[0] === 'a' && result[1] === 'b';
- })();
- module.exports = function (KEY, length, exec) {
- var SYMBOL = wks(KEY);
- var DELEGATES_TO_SYMBOL = !fails(function () {
- // String methods call symbol-named RegEp methods
- var O = {};
- O[SYMBOL] = function () { return 7; };
- return ''[KEY](O) != 7;
- });
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
- // Symbol-named RegExp methods call .exec
- var execCalled = false;
- var re = /a/;
- re.exec = function () { execCalled = true; return null; };
- if (KEY === 'split') {
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
- // a new one. We need to return the patched regex when creating the new one.
- re.constructor = {};
- re.constructor[SPECIES] = function () { return re; };
- }
- re[SYMBOL]('');
- return !execCalled;
- }) : undefined;
- if (
- !DELEGATES_TO_SYMBOL ||
- !DELEGATES_TO_EXEC ||
- (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
- (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
- ) {
- var nativeRegExpMethod = /./[SYMBOL];
- var fns = exec(
- defined,
- SYMBOL,
- ''[KEY],
- function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
- if (regexp.exec === regexpExec) {
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
- // The native String method already delegates to @@method (this
- // polyfilled function), leasing to infinite recursion.
- // We avoid it by directly calling the native @@method method.
- return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
- }
- return { done: true, value: nativeMethod.call(str, regexp, arg2) };
- }
- return { done: false };
- }
- );
- var strfn = fns[0];
- var rxfn = fns[1];
- redefine(String.prototype, KEY, strfn);
- hide(RegExp.prototype, SYMBOL, length == 2
- // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
- // 21.2.5.11 RegExp.prototype[@@split](string, limit)
- ? function (string, arg) { return rxfn.call(string, this, arg); }
- // 21.2.5.6 RegExp.prototype[@@match](string)
- // 21.2.5.9 RegExp.prototype[@@search](string)
- : function (string) { return rxfn.call(string, this); }
- );
- }
- };
- /***/ }),
- /***/ 53218:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 21.2.5.3 get RegExp.prototype.flags
- var anObject = __webpack_require__(27007);
- module.exports = function () {
- var that = anObject(this);
- var result = '';
- if (that.global) result += 'g';
- if (that.ignoreCase) result += 'i';
- if (that.multiline) result += 'm';
- if (that.unicode) result += 'u';
- if (that.sticky) result += 'y';
- return result;
- };
- /***/ }),
- /***/ 13325:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
- var isArray = __webpack_require__(4302);
- var isObject = __webpack_require__(55286);
- var toLength = __webpack_require__(10875);
- var ctx = __webpack_require__(741);
- var IS_CONCAT_SPREADABLE = __webpack_require__(86314)('isConcatSpreadable');
- function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {
- var targetIndex = start;
- var sourceIndex = 0;
- var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;
- var element, spreadable;
- while (sourceIndex < sourceLen) {
- if (sourceIndex in source) {
- element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
- spreadable = false;
- if (isObject(element)) {
- spreadable = element[IS_CONCAT_SPREADABLE];
- spreadable = spreadable !== undefined ? !!spreadable : isArray(element);
- }
- if (spreadable && depth > 0) {
- targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
- } else {
- if (targetIndex >= 0x1fffffffffffff) throw TypeError();
- target[targetIndex] = element;
- }
- targetIndex++;
- }
- sourceIndex++;
- }
- return targetIndex;
- }
- module.exports = flattenIntoArray;
- /***/ }),
- /***/ 3531:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var ctx = __webpack_require__(741);
- var call = __webpack_require__(28851);
- var isArrayIter = __webpack_require__(86555);
- var anObject = __webpack_require__(27007);
- var toLength = __webpack_require__(10875);
- var getIterFn = __webpack_require__(69002);
- var BREAK = {};
- var RETURN = {};
- var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
- var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
- var f = ctx(fn, that, entries ? 2 : 1);
- var index = 0;
- var length, step, iterator, result;
- if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
- // fast case for arrays with default iterator
- if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
- result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
- if (result === BREAK || result === RETURN) return result;
- } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
- result = call(iterator, f, step.value, entries);
- if (result === BREAK || result === RETURN) return result;
- }
- };
- exports.BREAK = BREAK;
- exports.RETURN = RETURN;
- /***/ }),
- /***/ 40018:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- module.exports = __webpack_require__(3825)('native-function-to-string', Function.toString);
- /***/ }),
- /***/ 3816:
- /***/ ((module) => {
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self
- // eslint-disable-next-line no-new-func
- : Function('return this')();
- if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
- /***/ }),
- /***/ 79181:
- /***/ ((module) => {
- var hasOwnProperty = {}.hasOwnProperty;
- module.exports = function (it, key) {
- return hasOwnProperty.call(it, key);
- };
- /***/ }),
- /***/ 87728:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var dP = __webpack_require__(99275);
- var createDesc = __webpack_require__(90681);
- module.exports = __webpack_require__(67057) ? function (object, key, value) {
- return dP.f(object, key, createDesc(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
- /***/ }),
- /***/ 40639:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var document = (__webpack_require__(3816).document);
- module.exports = document && document.documentElement;
- /***/ }),
- /***/ 1734:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- module.exports = !__webpack_require__(67057) && !__webpack_require__(74253)(function () {
- return Object.defineProperty(__webpack_require__(62457)('div'), 'a', { get: function () { return 7; } }).a != 7;
- });
- /***/ }),
- /***/ 40266:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(55286);
- var setPrototypeOf = (__webpack_require__(27375).set);
- module.exports = function (that, target, C) {
- var S = target.constructor;
- var P;
- if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
- setPrototypeOf(that, P);
- } return that;
- };
- /***/ }),
- /***/ 97242:
- /***/ ((module) => {
- // fast apply, http://jsperf.lnkit.com/fast-apply/5
- module.exports = function (fn, args, that) {
- var un = that === undefined;
- switch (args.length) {
- case 0: return un ? fn()
- : fn.call(that);
- case 1: return un ? fn(args[0])
- : fn.call(that, args[0]);
- case 2: return un ? fn(args[0], args[1])
- : fn.call(that, args[0], args[1]);
- case 3: return un ? fn(args[0], args[1], args[2])
- : fn.call(that, args[0], args[1], args[2]);
- case 4: return un ? fn(args[0], args[1], args[2], args[3])
- : fn.call(that, args[0], args[1], args[2], args[3]);
- } return fn.apply(that, args);
- };
- /***/ }),
- /***/ 49797:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
- var cof = __webpack_require__(92032);
- // eslint-disable-next-line no-prototype-builtins
- module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
- return cof(it) == 'String' ? it.split('') : Object(it);
- };
- /***/ }),
- /***/ 86555:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // check on default Array iterator
- var Iterators = __webpack_require__(87234);
- var ITERATOR = __webpack_require__(86314)('iterator');
- var ArrayProto = Array.prototype;
- module.exports = function (it) {
- return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
- };
- /***/ }),
- /***/ 4302:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 7.2.2 IsArray(argument)
- var cof = __webpack_require__(92032);
- module.exports = Array.isArray || function isArray(arg) {
- return cof(arg) == 'Array';
- };
- /***/ }),
- /***/ 18367:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 20.1.2.3 Number.isInteger(number)
- var isObject = __webpack_require__(55286);
- var floor = Math.floor;
- module.exports = function isInteger(it) {
- return !isObject(it) && isFinite(it) && floor(it) === it;
- };
- /***/ }),
- /***/ 55286:
- /***/ ((module) => {
- module.exports = function (it) {
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
- /***/ }),
- /***/ 55364:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 7.2.8 IsRegExp(argument)
- var isObject = __webpack_require__(55286);
- var cof = __webpack_require__(92032);
- var MATCH = __webpack_require__(86314)('match');
- module.exports = function (it) {
- var isRegExp;
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
- };
- /***/ }),
- /***/ 28851:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // call something on iterator step with safe closing on error
- var anObject = __webpack_require__(27007);
- module.exports = function (iterator, fn, value, entries) {
- try {
- return entries ? fn(anObject(value)[0], value[1]) : fn(value);
- // 7.4.6 IteratorClose(iterator, completion)
- } catch (e) {
- var ret = iterator['return'];
- if (ret !== undefined) anObject(ret.call(iterator));
- throw e;
- }
- };
- /***/ }),
- /***/ 49988:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var create = __webpack_require__(42503);
- var descriptor = __webpack_require__(90681);
- var setToStringTag = __webpack_require__(22943);
- var IteratorPrototype = {};
- // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
- __webpack_require__(87728)(IteratorPrototype, __webpack_require__(86314)('iterator'), function () { return this; });
- module.exports = function (Constructor, NAME, next) {
- Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
- setToStringTag(Constructor, NAME + ' Iterator');
- };
- /***/ }),
- /***/ 42923:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var LIBRARY = __webpack_require__(4461);
- var $export = __webpack_require__(42985);
- var redefine = __webpack_require__(77234);
- var hide = __webpack_require__(87728);
- var Iterators = __webpack_require__(87234);
- var $iterCreate = __webpack_require__(49988);
- var setToStringTag = __webpack_require__(22943);
- var getPrototypeOf = __webpack_require__(468);
- var ITERATOR = __webpack_require__(86314)('iterator');
- var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
- var FF_ITERATOR = '@@iterator';
- var KEYS = 'keys';
- var VALUES = 'values';
- var returnThis = function () { return this; };
- module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
- $iterCreate(Constructor, NAME, next);
- var getMethod = function (kind) {
- if (!BUGGY && kind in proto) return proto[kind];
- switch (kind) {
- case KEYS: return function keys() { return new Constructor(this, kind); };
- case VALUES: return function values() { return new Constructor(this, kind); };
- } return function entries() { return new Constructor(this, kind); };
- };
- var TAG = NAME + ' Iterator';
- var DEF_VALUES = DEFAULT == VALUES;
- var VALUES_BUG = false;
- var proto = Base.prototype;
- var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
- var $default = $native || getMethod(DEFAULT);
- var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
- var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
- var methods, key, IteratorPrototype;
- // Fix native
- if ($anyNative) {
- IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
- if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
- // Set @@toStringTag to native iterators
- setToStringTag(IteratorPrototype, TAG, true);
- // fix for some old engines
- if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
- }
- }
- // fix Array#{values, @@iterator}.name in V8 / FF
- if (DEF_VALUES && $native && $native.name !== VALUES) {
- VALUES_BUG = true;
- $default = function values() { return $native.call(this); };
- }
- // Define iterator
- if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
- hide(proto, ITERATOR, $default);
- }
- // Plug for library
- Iterators[NAME] = $default;
- Iterators[TAG] = returnThis;
- if (DEFAULT) {
- methods = {
- values: DEF_VALUES ? $default : getMethod(VALUES),
- keys: IS_SET ? $default : getMethod(KEYS),
- entries: $entries
- };
- if (FORCED) for (key in methods) {
- if (!(key in proto)) redefine(proto, key, methods[key]);
- } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
- }
- return methods;
- };
- /***/ }),
- /***/ 7462:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var ITERATOR = __webpack_require__(86314)('iterator');
- var SAFE_CLOSING = false;
- try {
- var riter = [7][ITERATOR]();
- riter['return'] = function () { SAFE_CLOSING = true; };
- // eslint-disable-next-line no-throw-literal
- Array.from(riter, function () { throw 2; });
- } catch (e) { /* empty */ }
- module.exports = function (exec, skipClosing) {
- if (!skipClosing && !SAFE_CLOSING) return false;
- var safe = false;
- try {
- var arr = [7];
- var iter = arr[ITERATOR]();
- iter.next = function () { return { done: safe = true }; };
- arr[ITERATOR] = function () { return iter; };
- exec(arr);
- } catch (e) { /* empty */ }
- return safe;
- };
- /***/ }),
- /***/ 15436:
- /***/ ((module) => {
- module.exports = function (done, value) {
- return { value: value, done: !!done };
- };
- /***/ }),
- /***/ 87234:
- /***/ ((module) => {
- module.exports = {};
- /***/ }),
- /***/ 4461:
- /***/ ((module) => {
- module.exports = false;
- /***/ }),
- /***/ 13086:
- /***/ ((module) => {
- // 20.2.2.14 Math.expm1(x)
- var $expm1 = Math.expm1;
- module.exports = (!$expm1
- // Old FF bug
- || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
- // Tor Browser bug
- || $expm1(-2e-17) != -2e-17
- ) ? function expm1(x) {
- return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
- } : $expm1;
- /***/ }),
- /***/ 34934:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.16 Math.fround(x)
- var sign = __webpack_require__(61801);
- var pow = Math.pow;
- var EPSILON = pow(2, -52);
- var EPSILON32 = pow(2, -23);
- var MAX32 = pow(2, 127) * (2 - EPSILON32);
- var MIN32 = pow(2, -126);
- var roundTiesToEven = function (n) {
- return n + 1 / EPSILON - 1 / EPSILON;
- };
- module.exports = Math.fround || function fround(x) {
- var $abs = Math.abs(x);
- var $sign = sign(x);
- var a, result;
- if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
- a = (1 + EPSILON32 / EPSILON) * $abs;
- result = a - (a - $abs);
- // eslint-disable-next-line no-self-compare
- if (result > MAX32 || result != result) return $sign * Infinity;
- return $sign * result;
- };
- /***/ }),
- /***/ 46206:
- /***/ ((module) => {
- // 20.2.2.20 Math.log1p(x)
- module.exports = Math.log1p || function log1p(x) {
- return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
- };
- /***/ }),
- /***/ 61801:
- /***/ ((module) => {
- // 20.2.2.28 Math.sign(x)
- module.exports = Math.sign || function sign(x) {
- // eslint-disable-next-line no-self-compare
- return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
- };
- /***/ }),
- /***/ 84728:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var META = __webpack_require__(93953)('meta');
- var isObject = __webpack_require__(55286);
- var has = __webpack_require__(79181);
- var setDesc = (__webpack_require__(99275).f);
- var id = 0;
- var isExtensible = Object.isExtensible || function () {
- return true;
- };
- var FREEZE = !__webpack_require__(74253)(function () {
- return isExtensible(Object.preventExtensions({}));
- });
- var setMeta = function (it) {
- setDesc(it, META, { value: {
- i: 'O' + ++id, // object ID
- w: {} // weak collections IDs
- } });
- };
- var fastKey = function (it, create) {
- // return primitive with prefix
- if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
- if (!has(it, META)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return 'F';
- // not necessary to add metadata
- if (!create) return 'E';
- // add missing metadata
- setMeta(it);
- // return object ID
- } return it[META].i;
- };
- var getWeak = function (it, create) {
- if (!has(it, META)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return true;
- // not necessary to add metadata
- if (!create) return false;
- // add missing metadata
- setMeta(it);
- // return hash weak collections IDs
- } return it[META].w;
- };
- // add metadata on freeze-family methods calling
- var onFreeze = function (it) {
- if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
- return it;
- };
- var meta = module.exports = {
- KEY: META,
- NEED: false,
- fastKey: fastKey,
- getWeak: getWeak,
- onFreeze: onFreeze
- };
- /***/ }),
- /***/ 14351:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(3816);
- var macrotask = (__webpack_require__(74193).set);
- var Observer = global.MutationObserver || global.WebKitMutationObserver;
- var process = global.process;
- var Promise = global.Promise;
- var isNode = __webpack_require__(92032)(process) == 'process';
- module.exports = function () {
- var head, last, notify;
- var flush = function () {
- var parent, fn;
- if (isNode && (parent = process.domain)) parent.exit();
- while (head) {
- fn = head.fn;
- head = head.next;
- try {
- fn();
- } catch (e) {
- if (head) notify();
- else last = undefined;
- throw e;
- }
- } last = undefined;
- if (parent) parent.enter();
- };
- // Node.js
- if (isNode) {
- notify = function () {
- process.nextTick(flush);
- };
- // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
- } else if (Observer && !(global.navigator && global.navigator.standalone)) {
- var toggle = true;
- var node = document.createTextNode('');
- new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
- notify = function () {
- node.data = toggle = !toggle;
- };
- // environments with maybe non-completely correct, but existent Promise
- } else if (Promise && Promise.resolve) {
- // Promise.resolve without an argument throws an error in LG WebOS 2
- var promise = Promise.resolve(undefined);
- notify = function () {
- promise.then(flush);
- };
- // for other environments - macrotask based on:
- // - setImmediate
- // - MessageChannel
- // - window.postMessag
- // - onreadystatechange
- // - setTimeout
- } else {
- notify = function () {
- // strange IE + webpack dev server bug - use .call(global)
- macrotask.call(global, flush);
- };
- }
- return function (fn) {
- var task = { fn: fn, next: undefined };
- if (last) last.next = task;
- if (!head) {
- head = task;
- notify();
- } last = task;
- };
- };
- /***/ }),
- /***/ 43499:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 25.4.1.5 NewPromiseCapability(C)
- var aFunction = __webpack_require__(24963);
- function PromiseCapability(C) {
- var resolve, reject;
- this.promise = new C(function ($$resolve, $$reject) {
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
- resolve = $$resolve;
- reject = $$reject;
- });
- this.resolve = aFunction(resolve);
- this.reject = aFunction(reject);
- }
- module.exports.f = function (C) {
- return new PromiseCapability(C);
- };
- /***/ }),
- /***/ 35345:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 19.1.2.1 Object.assign(target, source, ...)
- var DESCRIPTORS = __webpack_require__(67057);
- var getKeys = __webpack_require__(47184);
- var gOPS = __webpack_require__(64548);
- var pIE = __webpack_require__(14682);
- var toObject = __webpack_require__(20508);
- var IObject = __webpack_require__(49797);
- var $assign = Object.assign;
- // should work with symbols and should have deterministic property order (V8 bug)
- module.exports = !$assign || __webpack_require__(74253)(function () {
- var A = {};
- var B = {};
- // eslint-disable-next-line no-undef
- var S = Symbol();
- var K = 'abcdefghijklmnopqrst';
- A[S] = 7;
- K.split('').forEach(function (k) { B[k] = k; });
- return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
- var T = toObject(target);
- var aLen = arguments.length;
- var index = 1;
- var getSymbols = gOPS.f;
- var isEnum = pIE.f;
- while (aLen > index) {
- var S = IObject(arguments[index++]);
- var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) {
- key = keys[j++];
- if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
- }
- } return T;
- } : $assign;
- /***/ }),
- /***/ 42503:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
- var anObject = __webpack_require__(27007);
- var dPs = __webpack_require__(35588);
- var enumBugKeys = __webpack_require__(74430);
- var IE_PROTO = __webpack_require__(69335)('IE_PROTO');
- var Empty = function () { /* empty */ };
- var PROTOTYPE = 'prototype';
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
- var createDict = function () {
- // Thrash, waste and sodomy: IE GC bug
- var iframe = __webpack_require__(62457)('iframe');
- var i = enumBugKeys.length;
- var lt = '<';
- var gt = '>';
- var iframeDocument;
- iframe.style.display = 'none';
- (__webpack_require__(40639).appendChild)(iframe);
- iframe.src = 'javascript:'; // eslint-disable-line no-script-url
- // createDict = iframe.contentWindow.Object;
- // html.removeChild(iframe);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
- iframeDocument.close();
- createDict = iframeDocument.F;
- while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
- return createDict();
- };
- module.exports = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- Empty[PROTOTYPE] = anObject(O);
- result = new Empty();
- Empty[PROTOTYPE] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO] = O;
- } else result = createDict();
- return Properties === undefined ? result : dPs(result, Properties);
- };
- /***/ }),
- /***/ 99275:
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- var anObject = __webpack_require__(27007);
- var IE8_DOM_DEFINE = __webpack_require__(1734);
- var toPrimitive = __webpack_require__(21689);
- var dP = Object.defineProperty;
- exports.f = __webpack_require__(67057) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPrimitive(P, true);
- anObject(Attributes);
- if (IE8_DOM_DEFINE) try {
- return dP(O, P, Attributes);
- } catch (e) { /* empty */ }
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
- };
- /***/ }),
- /***/ 35588:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var dP = __webpack_require__(99275);
- var anObject = __webpack_require__(27007);
- var getKeys = __webpack_require__(47184);
- module.exports = __webpack_require__(67057) ? Object.defineProperties : function defineProperties(O, Properties) {
- anObject(O);
- var keys = getKeys(Properties);
- var length = keys.length;
- var i = 0;
- var P;
- while (length > i) dP.f(O, P = keys[i++], Properties[P]);
- return O;
- };
- /***/ }),
- /***/ 18693:
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- var pIE = __webpack_require__(14682);
- var createDesc = __webpack_require__(90681);
- var toIObject = __webpack_require__(22110);
- var toPrimitive = __webpack_require__(21689);
- var has = __webpack_require__(79181);
- var IE8_DOM_DEFINE = __webpack_require__(1734);
- var gOPD = Object.getOwnPropertyDescriptor;
- exports.f = __webpack_require__(67057) ? gOPD : function getOwnPropertyDescriptor(O, P) {
- O = toIObject(O);
- P = toPrimitive(P, true);
- if (IE8_DOM_DEFINE) try {
- return gOPD(O, P);
- } catch (e) { /* empty */ }
- if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
- };
- /***/ }),
- /***/ 39327:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
- var toIObject = __webpack_require__(22110);
- var gOPN = (__webpack_require__(20616).f);
- var toString = {}.toString;
- var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
- ? Object.getOwnPropertyNames(window) : [];
- var getWindowNames = function (it) {
- try {
- return gOPN(it);
- } catch (e) {
- return windowNames.slice();
- }
- };
- module.exports.f = function getOwnPropertyNames(it) {
- return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
- };
- /***/ }),
- /***/ 20616:
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
- var $keys = __webpack_require__(60189);
- var hiddenKeys = (__webpack_require__(74430).concat)('length', 'prototype');
- exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return $keys(O, hiddenKeys);
- };
- /***/ }),
- /***/ 64548:
- /***/ ((__unused_webpack_module, exports) => {
- exports.f = Object.getOwnPropertySymbols;
- /***/ }),
- /***/ 468:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
- var has = __webpack_require__(79181);
- var toObject = __webpack_require__(20508);
- var IE_PROTO = __webpack_require__(69335)('IE_PROTO');
- var ObjectProto = Object.prototype;
- module.exports = Object.getPrototypeOf || function (O) {
- O = toObject(O);
- if (has(O, IE_PROTO)) return O[IE_PROTO];
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
- return O.constructor.prototype;
- } return O instanceof Object ? ObjectProto : null;
- };
- /***/ }),
- /***/ 60189:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var has = __webpack_require__(79181);
- var toIObject = __webpack_require__(22110);
- var arrayIndexOf = __webpack_require__(79315)(false);
- var IE_PROTO = __webpack_require__(69335)('IE_PROTO');
- module.exports = function (object, names) {
- var O = toIObject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
- // Don't enum bug & hidden keys
- while (names.length > i) if (has(O, key = names[i++])) {
- ~arrayIndexOf(result, key) || result.push(key);
- }
- return result;
- };
- /***/ }),
- /***/ 47184:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.14 / 15.2.3.14 Object.keys(O)
- var $keys = __webpack_require__(60189);
- var enumBugKeys = __webpack_require__(74430);
- module.exports = Object.keys || function keys(O) {
- return $keys(O, enumBugKeys);
- };
- /***/ }),
- /***/ 14682:
- /***/ ((__unused_webpack_module, exports) => {
- exports.f = {}.propertyIsEnumerable;
- /***/ }),
- /***/ 33160:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // most Object methods by ES6 should accept primitives
- var $export = __webpack_require__(42985);
- var core = __webpack_require__(25645);
- var fails = __webpack_require__(74253);
- module.exports = function (KEY, exec) {
- var fn = (core.Object || {})[KEY] || Object[KEY];
- var exp = {};
- exp[KEY] = exec(fn);
- $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
- };
- /***/ }),
- /***/ 51131:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var DESCRIPTORS = __webpack_require__(67057);
- var getKeys = __webpack_require__(47184);
- var toIObject = __webpack_require__(22110);
- var isEnum = (__webpack_require__(14682).f);
- module.exports = function (isEntries) {
- return function (it) {
- var O = toIObject(it);
- var keys = getKeys(O);
- var length = keys.length;
- var i = 0;
- var result = [];
- var key;
- while (length > i) {
- key = keys[i++];
- if (!DESCRIPTORS || isEnum.call(O, key)) {
- result.push(isEntries ? [key, O[key]] : O[key]);
- }
- }
- return result;
- };
- };
- /***/ }),
- /***/ 57643:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // all object keys, includes non-enumerable and symbols
- var gOPN = __webpack_require__(20616);
- var gOPS = __webpack_require__(64548);
- var anObject = __webpack_require__(27007);
- var Reflect = (__webpack_require__(3816).Reflect);
- module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
- var keys = gOPN.f(anObject(it));
- var getSymbols = gOPS.f;
- return getSymbols ? keys.concat(getSymbols(it)) : keys;
- };
- /***/ }),
- /***/ 47743:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var $parseFloat = (__webpack_require__(3816).parseFloat);
- var $trim = (__webpack_require__(29599).trim);
- module.exports = 1 / $parseFloat(__webpack_require__(84644) + '-0') !== -Infinity ? function parseFloat(str) {
- var string = $trim(String(str), 3);
- var result = $parseFloat(string);
- return result === 0 && string.charAt(0) == '-' ? -0 : result;
- } : $parseFloat;
- /***/ }),
- /***/ 55960:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var $parseInt = (__webpack_require__(3816).parseInt);
- var $trim = (__webpack_require__(29599).trim);
- var ws = __webpack_require__(84644);
- var hex = /^[-+]?0[xX]/;
- module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
- var string = $trim(String(str), 3);
- return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
- } : $parseInt;
- /***/ }),
- /***/ 10188:
- /***/ ((module) => {
- module.exports = function (exec) {
- try {
- return { e: false, v: exec() };
- } catch (e) {
- return { e: true, v: e };
- }
- };
- /***/ }),
- /***/ 50094:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var anObject = __webpack_require__(27007);
- var isObject = __webpack_require__(55286);
- var newPromiseCapability = __webpack_require__(43499);
- module.exports = function (C, x) {
- anObject(C);
- if (isObject(x) && x.constructor === C) return x;
- var promiseCapability = newPromiseCapability.f(C);
- var resolve = promiseCapability.resolve;
- resolve(x);
- return promiseCapability.promise;
- };
- /***/ }),
- /***/ 90681:
- /***/ ((module) => {
- module.exports = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
- /***/ }),
- /***/ 24408:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var redefine = __webpack_require__(77234);
- module.exports = function (target, src, safe) {
- for (var key in src) redefine(target, key, src[key], safe);
- return target;
- };
- /***/ }),
- /***/ 77234:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(3816);
- var hide = __webpack_require__(87728);
- var has = __webpack_require__(79181);
- var SRC = __webpack_require__(93953)('src');
- var $toString = __webpack_require__(40018);
- var TO_STRING = 'toString';
- var TPL = ('' + $toString).split(TO_STRING);
- (__webpack_require__(25645).inspectSource) = function (it) {
- return $toString.call(it);
- };
- (module.exports = function (O, key, val, safe) {
- var isFunction = typeof val == 'function';
- if (isFunction) has(val, 'name') || hide(val, 'name', key);
- if (O[key] === val) return;
- if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
- if (O === global) {
- O[key] = val;
- } else if (!safe) {
- delete O[key];
- hide(O, key, val);
- } else if (O[key]) {
- O[key] = val;
- } else {
- hide(O, key, val);
- }
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
- })(Function.prototype, TO_STRING, function toString() {
- return typeof this == 'function' && this[SRC] || $toString.call(this);
- });
- /***/ }),
- /***/ 27787:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var classof = __webpack_require__(41488);
- var builtinExec = RegExp.prototype.exec;
- // `RegExpExec` abstract operation
- // https://tc39.github.io/ecma262/#sec-regexpexec
- module.exports = function (R, S) {
- var exec = R.exec;
- if (typeof exec === 'function') {
- var result = exec.call(R, S);
- if (typeof result !== 'object') {
- throw new TypeError('RegExp exec method returned something other than an Object or null');
- }
- return result;
- }
- if (classof(R) !== 'RegExp') {
- throw new TypeError('RegExp#exec called on incompatible receiver');
- }
- return builtinExec.call(R, S);
- };
- /***/ }),
- /***/ 21165:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var regexpFlags = __webpack_require__(53218);
- var nativeExec = RegExp.prototype.exec;
- // This always refers to the native implementation, because the
- // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
- // which loads this file before patching the method.
- var nativeReplace = String.prototype.replace;
- var patchedExec = nativeExec;
- var LAST_INDEX = 'lastIndex';
- var UPDATES_LAST_INDEX_WRONG = (function () {
- var re1 = /a/,
- re2 = /b*/g;
- nativeExec.call(re1, 'a');
- nativeExec.call(re2, 'a');
- return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
- })();
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
- if (PATCH) {
- patchedExec = function exec(str) {
- var re = this;
- var lastIndex, reCopy, match, i;
- if (NPCG_INCLUDED) {
- reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
- }
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
- match = nativeExec.call(re, str);
- if (UPDATES_LAST_INDEX_WRONG && match) {
- re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
- }
- if (NPCG_INCLUDED && match && match.length > 1) {
- // Fix browsers whose `exec` methods don't consistently return `undefined`
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
- // eslint-disable-next-line no-loop-func
- nativeReplace.call(match[0], reCopy, function () {
- for (i = 1; i < arguments.length - 2; i++) {
- if (arguments[i] === undefined) match[i] = undefined;
- }
- });
- }
- return match;
- };
- }
- module.exports = patchedExec;
- /***/ }),
- /***/ 27195:
- /***/ ((module) => {
- // 7.2.9 SameValue(x, y)
- module.exports = Object.is || function is(x, y) {
- // eslint-disable-next-line no-self-compare
- return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
- };
- /***/ }),
- /***/ 27375:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // Works with __proto__ only. Old v8 can't work with null proto objects.
- /* eslint-disable no-proto */
- var isObject = __webpack_require__(55286);
- var anObject = __webpack_require__(27007);
- var check = function (O, proto) {
- anObject(O);
- if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
- };
- module.exports = {
- set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
- function (test, buggy, set) {
- try {
- set = __webpack_require__(741)(Function.call, (__webpack_require__(18693).f)(Object.prototype, '__proto__').set, 2);
- set(test, []);
- buggy = !(test instanceof Array);
- } catch (e) { buggy = true; }
- return function setPrototypeOf(O, proto) {
- check(O, proto);
- if (buggy) O.__proto__ = proto;
- else set(O, proto);
- return O;
- };
- }({}, false) : undefined),
- check: check
- };
- /***/ }),
- /***/ 2974:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var global = __webpack_require__(3816);
- var dP = __webpack_require__(99275);
- var DESCRIPTORS = __webpack_require__(67057);
- var SPECIES = __webpack_require__(86314)('species');
- module.exports = function (KEY) {
- var C = global[KEY];
- if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
- configurable: true,
- get: function () { return this; }
- });
- };
- /***/ }),
- /***/ 22943:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var def = (__webpack_require__(99275).f);
- var has = __webpack_require__(79181);
- var TAG = __webpack_require__(86314)('toStringTag');
- module.exports = function (it, tag, stat) {
- if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
- };
- /***/ }),
- /***/ 69335:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var shared = __webpack_require__(3825)('keys');
- var uid = __webpack_require__(93953);
- module.exports = function (key) {
- return shared[key] || (shared[key] = uid(key));
- };
- /***/ }),
- /***/ 3825:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var core = __webpack_require__(25645);
- var global = __webpack_require__(3816);
- var SHARED = '__core-js_shared__';
- var store = global[SHARED] || (global[SHARED] = {});
- (module.exports = function (key, value) {
- return store[key] || (store[key] = value !== undefined ? value : {});
- })('versions', []).push({
- version: core.version,
- mode: __webpack_require__(4461) ? 'pure' : 'global',
- copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
- });
- /***/ }),
- /***/ 58364:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 7.3.20 SpeciesConstructor(O, defaultConstructor)
- var anObject = __webpack_require__(27007);
- var aFunction = __webpack_require__(24963);
- var SPECIES = __webpack_require__(86314)('species');
- module.exports = function (O, D) {
- var C = anObject(O).constructor;
- var S;
- return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
- };
- /***/ }),
- /***/ 77717:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var fails = __webpack_require__(74253);
- module.exports = function (method, arg) {
- return !!method && fails(function () {
- // eslint-disable-next-line no-useless-call
- arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
- });
- };
- /***/ }),
- /***/ 24496:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toInteger = __webpack_require__(81467);
- var defined = __webpack_require__(91355);
- // true -> String#at
- // false -> String#codePointAt
- module.exports = function (TO_STRING) {
- return function (that, pos) {
- var s = String(defined(that));
- var i = toInteger(pos);
- var l = s.length;
- var a, b;
- if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
- a = s.charCodeAt(i);
- return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
- ? TO_STRING ? s.charAt(i) : a
- : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
- };
- };
- /***/ }),
- /***/ 42094:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // helper for String#{startsWith, endsWith, includes}
- var isRegExp = __webpack_require__(55364);
- var defined = __webpack_require__(91355);
- module.exports = function (that, searchString, NAME) {
- if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
- return String(defined(that));
- };
- /***/ }),
- /***/ 29395:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- var fails = __webpack_require__(74253);
- var defined = __webpack_require__(91355);
- var quot = /"/g;
- // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
- var createHTML = function (string, tag, attribute, value) {
- var S = String(defined(string));
- var p1 = '<' + tag;
- if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"';
- return p1 + '>' + S + '</' + tag + '>';
- };
- module.exports = function (NAME, exec) {
- var O = {};
- O[NAME] = exec(createHTML);
- $export($export.P + $export.F * fails(function () {
- var test = ''[NAME]('"');
- return test !== test.toLowerCase() || test.split('"').length > 3;
- }), 'String', O);
- };
- /***/ }),
- /***/ 75442:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // https://github.com/tc39/proposal-string-pad-start-end
- var toLength = __webpack_require__(10875);
- var repeat = __webpack_require__(68595);
- var defined = __webpack_require__(91355);
- module.exports = function (that, maxLength, fillString, left) {
- var S = String(defined(that));
- var stringLength = S.length;
- var fillStr = fillString === undefined ? ' ' : String(fillString);
- var intMaxLength = toLength(maxLength);
- if (intMaxLength <= stringLength || fillStr == '') return S;
- var fillLen = intMaxLength - stringLength;
- var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
- if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
- return left ? stringFiller + S : S + stringFiller;
- };
- /***/ }),
- /***/ 68595:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var toInteger = __webpack_require__(81467);
- var defined = __webpack_require__(91355);
- module.exports = function repeat(count) {
- var str = String(defined(this));
- var res = '';
- var n = toInteger(count);
- if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
- for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
- return res;
- };
- /***/ }),
- /***/ 29599:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- var defined = __webpack_require__(91355);
- var fails = __webpack_require__(74253);
- var spaces = __webpack_require__(84644);
- var space = '[' + spaces + ']';
- var non = '\u200b\u0085';
- var ltrim = RegExp('^' + space + space + '*');
- var rtrim = RegExp(space + space + '*$');
- var exporter = function (KEY, exec, ALIAS) {
- var exp = {};
- var FORCE = fails(function () {
- return !!spaces[KEY]() || non[KEY]() != non;
- });
- var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
- if (ALIAS) exp[ALIAS] = fn;
- $export($export.P + $export.F * FORCE, 'String', exp);
- };
- // 1 -> String#trimLeft
- // 2 -> String#trimRight
- // 3 -> String#trim
- var trim = exporter.trim = function (string, TYPE) {
- string = String(defined(string));
- if (TYPE & 1) string = string.replace(ltrim, '');
- if (TYPE & 2) string = string.replace(rtrim, '');
- return string;
- };
- module.exports = exporter;
- /***/ }),
- /***/ 84644:
- /***/ ((module) => {
- module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
- '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
- /***/ }),
- /***/ 74193:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var ctx = __webpack_require__(741);
- var invoke = __webpack_require__(97242);
- var html = __webpack_require__(40639);
- var cel = __webpack_require__(62457);
- var global = __webpack_require__(3816);
- var process = global.process;
- var setTask = global.setImmediate;
- var clearTask = global.clearImmediate;
- var MessageChannel = global.MessageChannel;
- var Dispatch = global.Dispatch;
- var counter = 0;
- var queue = {};
- var ONREADYSTATECHANGE = 'onreadystatechange';
- var defer, channel, port;
- var run = function () {
- var id = +this;
- // eslint-disable-next-line no-prototype-builtins
- if (queue.hasOwnProperty(id)) {
- var fn = queue[id];
- delete queue[id];
- fn();
- }
- };
- var listener = function (event) {
- run.call(event.data);
- };
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
- if (!setTask || !clearTask) {
- setTask = function setImmediate(fn) {
- var args = [];
- var i = 1;
- while (arguments.length > i) args.push(arguments[i++]);
- queue[++counter] = function () {
- // eslint-disable-next-line no-new-func
- invoke(typeof fn == 'function' ? fn : Function(fn), args);
- };
- defer(counter);
- return counter;
- };
- clearTask = function clearImmediate(id) {
- delete queue[id];
- };
- // Node.js 0.8-
- if (__webpack_require__(92032)(process) == 'process') {
- defer = function (id) {
- process.nextTick(ctx(run, id, 1));
- };
- // Sphere (JS game engine) Dispatch API
- } else if (Dispatch && Dispatch.now) {
- defer = function (id) {
- Dispatch.now(ctx(run, id, 1));
- };
- // Browsers with MessageChannel, includes WebWorkers
- } else if (MessageChannel) {
- channel = new MessageChannel();
- port = channel.port2;
- channel.port1.onmessage = listener;
- defer = ctx(port.postMessage, port, 1);
- // Browsers with postMessage, skip WebWorkers
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
- } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
- defer = function (id) {
- global.postMessage(id + '', '*');
- };
- global.addEventListener('message', listener, false);
- // IE8-
- } else if (ONREADYSTATECHANGE in cel('script')) {
- defer = function (id) {
- html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
- html.removeChild(this);
- run.call(id);
- };
- };
- // Rest old browsers
- } else {
- defer = function (id) {
- setTimeout(ctx(run, id, 1), 0);
- };
- }
- }
- module.exports = {
- set: setTask,
- clear: clearTask
- };
- /***/ }),
- /***/ 92337:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toInteger = __webpack_require__(81467);
- var max = Math.max;
- var min = Math.min;
- module.exports = function (index, length) {
- index = toInteger(index);
- return index < 0 ? max(index + length, 0) : min(index, length);
- };
- /***/ }),
- /***/ 94843:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // https://tc39.github.io/ecma262/#sec-toindex
- var toInteger = __webpack_require__(81467);
- var toLength = __webpack_require__(10875);
- module.exports = function (it) {
- if (it === undefined) return 0;
- var number = toInteger(it);
- var length = toLength(number);
- if (number !== length) throw RangeError('Wrong length!');
- return length;
- };
- /***/ }),
- /***/ 81467:
- /***/ ((module) => {
- // 7.1.4 ToInteger
- var ceil = Math.ceil;
- var floor = Math.floor;
- module.exports = function (it) {
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
- };
- /***/ }),
- /***/ 22110:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // to indexed object, toObject with fallback for non-array-like ES3 strings
- var IObject = __webpack_require__(49797);
- var defined = __webpack_require__(91355);
- module.exports = function (it) {
- return IObject(defined(it));
- };
- /***/ }),
- /***/ 10875:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 7.1.15 ToLength
- var toInteger = __webpack_require__(81467);
- var min = Math.min;
- module.exports = function (it) {
- return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
- };
- /***/ }),
- /***/ 20508:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 7.1.13 ToObject(argument)
- var defined = __webpack_require__(91355);
- module.exports = function (it) {
- return Object(defined(it));
- };
- /***/ }),
- /***/ 21689:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- // 7.1.1 ToPrimitive(input [, PreferredType])
- var isObject = __webpack_require__(55286);
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
- // and the second argument - flag - preferred type is a string
- module.exports = function (it, S) {
- if (!isObject(it)) return it;
- var fn, val;
- if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
- if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
- if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
- throw TypeError("Can't convert object to primitive value");
- };
- /***/ }),
- /***/ 78440:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- if (__webpack_require__(67057)) {
- var LIBRARY = __webpack_require__(4461);
- var global = __webpack_require__(3816);
- var fails = __webpack_require__(74253);
- var $export = __webpack_require__(42985);
- var $typed = __webpack_require__(89383);
- var $buffer = __webpack_require__(91125);
- var ctx = __webpack_require__(741);
- var anInstance = __webpack_require__(83328);
- var propertyDesc = __webpack_require__(90681);
- var hide = __webpack_require__(87728);
- var redefineAll = __webpack_require__(24408);
- var toInteger = __webpack_require__(81467);
- var toLength = __webpack_require__(10875);
- var toIndex = __webpack_require__(94843);
- var toAbsoluteIndex = __webpack_require__(92337);
- var toPrimitive = __webpack_require__(21689);
- var has = __webpack_require__(79181);
- var classof = __webpack_require__(41488);
- var isObject = __webpack_require__(55286);
- var toObject = __webpack_require__(20508);
- var isArrayIter = __webpack_require__(86555);
- var create = __webpack_require__(42503);
- var getPrototypeOf = __webpack_require__(468);
- var gOPN = (__webpack_require__(20616).f);
- var getIterFn = __webpack_require__(69002);
- var uid = __webpack_require__(93953);
- var wks = __webpack_require__(86314);
- var createArrayMethod = __webpack_require__(10050);
- var createArrayIncludes = __webpack_require__(79315);
- var speciesConstructor = __webpack_require__(58364);
- var ArrayIterators = __webpack_require__(56997);
- var Iterators = __webpack_require__(87234);
- var $iterDetect = __webpack_require__(7462);
- var setSpecies = __webpack_require__(2974);
- var arrayFill = __webpack_require__(46852);
- var arrayCopyWithin = __webpack_require__(5216);
- var $DP = __webpack_require__(99275);
- var $GOPD = __webpack_require__(18693);
- var dP = $DP.f;
- var gOPD = $GOPD.f;
- var RangeError = global.RangeError;
- var TypeError = global.TypeError;
- var Uint8Array = global.Uint8Array;
- var ARRAY_BUFFER = 'ArrayBuffer';
- var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
- var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
- var PROTOTYPE = 'prototype';
- var ArrayProto = Array[PROTOTYPE];
- var $ArrayBuffer = $buffer.ArrayBuffer;
- var $DataView = $buffer.DataView;
- var arrayForEach = createArrayMethod(0);
- var arrayFilter = createArrayMethod(2);
- var arraySome = createArrayMethod(3);
- var arrayEvery = createArrayMethod(4);
- var arrayFind = createArrayMethod(5);
- var arrayFindIndex = createArrayMethod(6);
- var arrayIncludes = createArrayIncludes(true);
- var arrayIndexOf = createArrayIncludes(false);
- var arrayValues = ArrayIterators.values;
- var arrayKeys = ArrayIterators.keys;
- var arrayEntries = ArrayIterators.entries;
- var arrayLastIndexOf = ArrayProto.lastIndexOf;
- var arrayReduce = ArrayProto.reduce;
- var arrayReduceRight = ArrayProto.reduceRight;
- var arrayJoin = ArrayProto.join;
- var arraySort = ArrayProto.sort;
- var arraySlice = ArrayProto.slice;
- var arrayToString = ArrayProto.toString;
- var arrayToLocaleString = ArrayProto.toLocaleString;
- var ITERATOR = wks('iterator');
- var TAG = wks('toStringTag');
- var TYPED_CONSTRUCTOR = uid('typed_constructor');
- var DEF_CONSTRUCTOR = uid('def_constructor');
- var ALL_CONSTRUCTORS = $typed.CONSTR;
- var TYPED_ARRAY = $typed.TYPED;
- var VIEW = $typed.VIEW;
- var WRONG_LENGTH = 'Wrong length!';
- var $map = createArrayMethod(1, function (O, length) {
- return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
- });
- var LITTLE_ENDIAN = fails(function () {
- // eslint-disable-next-line no-undef
- return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
- });
- var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
- new Uint8Array(1).set({});
- });
- var toOffset = function (it, BYTES) {
- var offset = toInteger(it);
- if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
- return offset;
- };
- var validate = function (it) {
- if (isObject(it) && TYPED_ARRAY in it) return it;
- throw TypeError(it + ' is not a typed array!');
- };
- var allocate = function (C, length) {
- if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
- throw TypeError('It is not a typed array constructor!');
- } return new C(length);
- };
- var speciesFromList = function (O, list) {
- return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
- };
- var fromList = function (C, list) {
- var index = 0;
- var length = list.length;
- var result = allocate(C, length);
- while (length > index) result[index] = list[index++];
- return result;
- };
- var addGetter = function (it, key, internal) {
- dP(it, key, { get: function () { return this._d[internal]; } });
- };
- var $from = function from(source /* , mapfn, thisArg */) {
- var O = toObject(source);
- var aLen = arguments.length;
- var mapfn = aLen > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- var iterFn = getIterFn(O);
- var i, length, values, result, step, iterator;
- if (iterFn != undefined && !isArrayIter(iterFn)) {
- for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
- values.push(step.value);
- } O = values;
- }
- if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
- for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
- result[i] = mapping ? mapfn(O[i], i) : O[i];
- }
- return result;
- };
- var $of = function of(/* ...items */) {
- var index = 0;
- var length = arguments.length;
- var result = allocate(this, length);
- while (length > index) result[index] = arguments[index++];
- return result;
- };
- // iOS Safari 6.x fails here
- var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
- var $toLocaleString = function toLocaleString() {
- return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
- };
- var proto = {
- copyWithin: function copyWithin(target, start /* , end */) {
- return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
- },
- every: function every(callbackfn /* , thisArg */) {
- return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- },
- fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
- return arrayFill.apply(validate(this), arguments);
- },
- filter: function filter(callbackfn /* , thisArg */) {
- return speciesFromList(this, arrayFilter(validate(this), callbackfn,
- arguments.length > 1 ? arguments[1] : undefined));
- },
- find: function find(predicate /* , thisArg */) {
- return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
- },
- findIndex: function findIndex(predicate /* , thisArg */) {
- return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
- },
- forEach: function forEach(callbackfn /* , thisArg */) {
- arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- },
- indexOf: function indexOf(searchElement /* , fromIndex */) {
- return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
- },
- includes: function includes(searchElement /* , fromIndex */) {
- return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
- },
- join: function join(separator) { // eslint-disable-line no-unused-vars
- return arrayJoin.apply(validate(this), arguments);
- },
- lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
- return arrayLastIndexOf.apply(validate(this), arguments);
- },
- map: function map(mapfn /* , thisArg */) {
- return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
- },
- reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
- return arrayReduce.apply(validate(this), arguments);
- },
- reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
- return arrayReduceRight.apply(validate(this), arguments);
- },
- reverse: function reverse() {
- var that = this;
- var length = validate(that).length;
- var middle = Math.floor(length / 2);
- var index = 0;
- var value;
- while (index < middle) {
- value = that[index];
- that[index++] = that[--length];
- that[length] = value;
- } return that;
- },
- some: function some(callbackfn /* , thisArg */) {
- return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- },
- sort: function sort(comparefn) {
- return arraySort.call(validate(this), comparefn);
- },
- subarray: function subarray(begin, end) {
- var O = validate(this);
- var length = O.length;
- var $begin = toAbsoluteIndex(begin, length);
- return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
- O.buffer,
- O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
- toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
- );
- }
- };
- var $slice = function slice(start, end) {
- return speciesFromList(this, arraySlice.call(validate(this), start, end));
- };
- var $set = function set(arrayLike /* , offset */) {
- validate(this);
- var offset = toOffset(arguments[1], 1);
- var length = this.length;
- var src = toObject(arrayLike);
- var len = toLength(src.length);
- var index = 0;
- if (len + offset > length) throw RangeError(WRONG_LENGTH);
- while (index < len) this[offset + index] = src[index++];
- };
- var $iterators = {
- entries: function entries() {
- return arrayEntries.call(validate(this));
- },
- keys: function keys() {
- return arrayKeys.call(validate(this));
- },
- values: function values() {
- return arrayValues.call(validate(this));
- }
- };
- var isTAIndex = function (target, key) {
- return isObject(target)
- && target[TYPED_ARRAY]
- && typeof key != 'symbol'
- && key in target
- && String(+key) == String(key);
- };
- var $getDesc = function getOwnPropertyDescriptor(target, key) {
- return isTAIndex(target, key = toPrimitive(key, true))
- ? propertyDesc(2, target[key])
- : gOPD(target, key);
- };
- var $setDesc = function defineProperty(target, key, desc) {
- if (isTAIndex(target, key = toPrimitive(key, true))
- && isObject(desc)
- && has(desc, 'value')
- && !has(desc, 'get')
- && !has(desc, 'set')
- // TODO: add validation descriptor w/o calling accessors
- && !desc.configurable
- && (!has(desc, 'writable') || desc.writable)
- && (!has(desc, 'enumerable') || desc.enumerable)
- ) {
- target[key] = desc.value;
- return target;
- } return dP(target, key, desc);
- };
- if (!ALL_CONSTRUCTORS) {
- $GOPD.f = $getDesc;
- $DP.f = $setDesc;
- }
- $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
- getOwnPropertyDescriptor: $getDesc,
- defineProperty: $setDesc
- });
- if (fails(function () { arrayToString.call({}); })) {
- arrayToString = arrayToLocaleString = function toString() {
- return arrayJoin.call(this);
- };
- }
- var $TypedArrayPrototype$ = redefineAll({}, proto);
- redefineAll($TypedArrayPrototype$, $iterators);
- hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
- redefineAll($TypedArrayPrototype$, {
- slice: $slice,
- set: $set,
- constructor: function () { /* noop */ },
- toString: arrayToString,
- toLocaleString: $toLocaleString
- });
- addGetter($TypedArrayPrototype$, 'buffer', 'b');
- addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
- addGetter($TypedArrayPrototype$, 'byteLength', 'l');
- addGetter($TypedArrayPrototype$, 'length', 'e');
- dP($TypedArrayPrototype$, TAG, {
- get: function () { return this[TYPED_ARRAY]; }
- });
- // eslint-disable-next-line max-statements
- module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
- CLAMPED = !!CLAMPED;
- var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
- var GETTER = 'get' + KEY;
- var SETTER = 'set' + KEY;
- var TypedArray = global[NAME];
- var Base = TypedArray || {};
- var TAC = TypedArray && getPrototypeOf(TypedArray);
- var FORCED = !TypedArray || !$typed.ABV;
- var O = {};
- var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
- var getter = function (that, index) {
- var data = that._d;
- return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
- };
- var setter = function (that, index, value) {
- var data = that._d;
- if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
- data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
- };
- var addElement = function (that, index) {
- dP(that, index, {
- get: function () {
- return getter(this, index);
- },
- set: function (value) {
- return setter(this, index, value);
- },
- enumerable: true
- });
- };
- if (FORCED) {
- TypedArray = wrapper(function (that, data, $offset, $length) {
- anInstance(that, TypedArray, NAME, '_d');
- var index = 0;
- var offset = 0;
- var buffer, byteLength, length, klass;
- if (!isObject(data)) {
- length = toIndex(data);
- byteLength = length * BYTES;
- buffer = new $ArrayBuffer(byteLength);
- } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
- buffer = data;
- offset = toOffset($offset, BYTES);
- var $len = data.byteLength;
- if ($length === undefined) {
- if ($len % BYTES) throw RangeError(WRONG_LENGTH);
- byteLength = $len - offset;
- if (byteLength < 0) throw RangeError(WRONG_LENGTH);
- } else {
- byteLength = toLength($length) * BYTES;
- if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
- }
- length = byteLength / BYTES;
- } else if (TYPED_ARRAY in data) {
- return fromList(TypedArray, data);
- } else {
- return $from.call(TypedArray, data);
- }
- hide(that, '_d', {
- b: buffer,
- o: offset,
- l: byteLength,
- e: length,
- v: new $DataView(buffer)
- });
- while (index < length) addElement(that, index++);
- });
- TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
- hide(TypedArrayPrototype, 'constructor', TypedArray);
- } else if (!fails(function () {
- TypedArray(1);
- }) || !fails(function () {
- new TypedArray(-1); // eslint-disable-line no-new
- }) || !$iterDetect(function (iter) {
- new TypedArray(); // eslint-disable-line no-new
- new TypedArray(null); // eslint-disable-line no-new
- new TypedArray(1.5); // eslint-disable-line no-new
- new TypedArray(iter); // eslint-disable-line no-new
- }, true)) {
- TypedArray = wrapper(function (that, data, $offset, $length) {
- anInstance(that, TypedArray, NAME);
- var klass;
- // `ws` module bug, temporarily remove validation length for Uint8Array
- // https://github.com/websockets/ws/pull/645
- if (!isObject(data)) return new Base(toIndex(data));
- if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
- return $length !== undefined
- ? new Base(data, toOffset($offset, BYTES), $length)
- : $offset !== undefined
- ? new Base(data, toOffset($offset, BYTES))
- : new Base(data);
- }
- if (TYPED_ARRAY in data) return fromList(TypedArray, data);
- return $from.call(TypedArray, data);
- });
- arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
- if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
- });
- TypedArray[PROTOTYPE] = TypedArrayPrototype;
- if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
- }
- var $nativeIterator = TypedArrayPrototype[ITERATOR];
- var CORRECT_ITER_NAME = !!$nativeIterator
- && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
- var $iterator = $iterators.values;
- hide(TypedArray, TYPED_CONSTRUCTOR, true);
- hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
- hide(TypedArrayPrototype, VIEW, true);
- hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
- if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
- dP(TypedArrayPrototype, TAG, {
- get: function () { return NAME; }
- });
- }
- O[NAME] = TypedArray;
- $export($export.G + $export.W + $export.F * (TypedArray != Base), O);
- $export($export.S, NAME, {
- BYTES_PER_ELEMENT: BYTES
- });
- $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
- from: $from,
- of: $of
- });
- if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
- $export($export.P, NAME, proto);
- setSpecies(NAME);
- $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });
- $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
- if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;
- $export($export.P + $export.F * fails(function () {
- new TypedArray(1).slice();
- }), NAME, { slice: $slice });
- $export($export.P + $export.F * (fails(function () {
- return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
- }) || !fails(function () {
- TypedArrayPrototype.toLocaleString.call([1, 2]);
- })), NAME, { toLocaleString: $toLocaleString });
- Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
- if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
- };
- } else module.exports = function () { /* empty */ };
- /***/ }),
- /***/ 91125:
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- "use strict";
- var global = __webpack_require__(3816);
- var DESCRIPTORS = __webpack_require__(67057);
- var LIBRARY = __webpack_require__(4461);
- var $typed = __webpack_require__(89383);
- var hide = __webpack_require__(87728);
- var redefineAll = __webpack_require__(24408);
- var fails = __webpack_require__(74253);
- var anInstance = __webpack_require__(83328);
- var toInteger = __webpack_require__(81467);
- var toLength = __webpack_require__(10875);
- var toIndex = __webpack_require__(94843);
- var gOPN = (__webpack_require__(20616).f);
- var dP = (__webpack_require__(99275).f);
- var arrayFill = __webpack_require__(46852);
- var setToStringTag = __webpack_require__(22943);
- var ARRAY_BUFFER = 'ArrayBuffer';
- var DATA_VIEW = 'DataView';
- var PROTOTYPE = 'prototype';
- var WRONG_LENGTH = 'Wrong length!';
- var WRONG_INDEX = 'Wrong index!';
- var $ArrayBuffer = global[ARRAY_BUFFER];
- var $DataView = global[DATA_VIEW];
- var Math = global.Math;
- var RangeError = global.RangeError;
- // eslint-disable-next-line no-shadow-restricted-names
- var Infinity = global.Infinity;
- var BaseBuffer = $ArrayBuffer;
- var abs = Math.abs;
- var pow = Math.pow;
- var floor = Math.floor;
- var log = Math.log;
- var LN2 = Math.LN2;
- var BUFFER = 'buffer';
- var BYTE_LENGTH = 'byteLength';
- var BYTE_OFFSET = 'byteOffset';
- var $BUFFER = DESCRIPTORS ? '_b' : BUFFER;
- var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;
- var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
- // IEEE754 conversions based on https://github.com/feross/ieee754
- function packIEEE754(value, mLen, nBytes) {
- var buffer = new Array(nBytes);
- var eLen = nBytes * 8 - mLen - 1;
- var eMax = (1 << eLen) - 1;
- var eBias = eMax >> 1;
- var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
- var i = 0;
- var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
- var e, m, c;
- value = abs(value);
- // eslint-disable-next-line no-self-compare
- if (value != value || value === Infinity) {
- // eslint-disable-next-line no-self-compare
- m = value != value ? 1 : 0;
- e = eMax;
- } else {
- e = floor(log(value) / LN2);
- if (value * (c = pow(2, -e)) < 1) {
- e--;
- c *= 2;
- }
- if (e + eBias >= 1) {
- value += rt / c;
- } else {
- value += rt * pow(2, 1 - eBias);
- }
- if (value * c >= 2) {
- e++;
- c /= 2;
- }
- if (e + eBias >= eMax) {
- m = 0;
- e = eMax;
- } else if (e + eBias >= 1) {
- m = (value * c - 1) * pow(2, mLen);
- e = e + eBias;
- } else {
- m = value * pow(2, eBias - 1) * pow(2, mLen);
- e = 0;
- }
- }
- for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
- e = e << mLen | m;
- eLen += mLen;
- for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
- buffer[--i] |= s * 128;
- return buffer;
- }
- function unpackIEEE754(buffer, mLen, nBytes) {
- var eLen = nBytes * 8 - mLen - 1;
- var eMax = (1 << eLen) - 1;
- var eBias = eMax >> 1;
- var nBits = eLen - 7;
- var i = nBytes - 1;
- var s = buffer[i--];
- var e = s & 127;
- var m;
- s >>= 7;
- for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
- m = e & (1 << -nBits) - 1;
- e >>= -nBits;
- nBits += mLen;
- for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
- if (e === 0) {
- e = 1 - eBias;
- } else if (e === eMax) {
- return m ? NaN : s ? -Infinity : Infinity;
- } else {
- m = m + pow(2, mLen);
- e = e - eBias;
- } return (s ? -1 : 1) * m * pow(2, e - mLen);
- }
- function unpackI32(bytes) {
- return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
- }
- function packI8(it) {
- return [it & 0xff];
- }
- function packI16(it) {
- return [it & 0xff, it >> 8 & 0xff];
- }
- function packI32(it) {
- return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
- }
- function packF64(it) {
- return packIEEE754(it, 52, 8);
- }
- function packF32(it) {
- return packIEEE754(it, 23, 4);
- }
- function addGetter(C, key, internal) {
- dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
- }
- function get(view, bytes, index, isLittleEndian) {
- var numIndex = +index;
- var intIndex = toIndex(numIndex);
- if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
- var store = view[$BUFFER]._b;
- var start = intIndex + view[$OFFSET];
- var pack = store.slice(start, start + bytes);
- return isLittleEndian ? pack : pack.reverse();
- }
- function set(view, bytes, index, conversion, value, isLittleEndian) {
- var numIndex = +index;
- var intIndex = toIndex(numIndex);
- if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
- var store = view[$BUFFER]._b;
- var start = intIndex + view[$OFFSET];
- var pack = conversion(+value);
- for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
- }
- if (!$typed.ABV) {
- $ArrayBuffer = function ArrayBuffer(length) {
- anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
- var byteLength = toIndex(length);
- this._b = arrayFill.call(new Array(byteLength), 0);
- this[$LENGTH] = byteLength;
- };
- $DataView = function DataView(buffer, byteOffset, byteLength) {
- anInstance(this, $DataView, DATA_VIEW);
- anInstance(buffer, $ArrayBuffer, DATA_VIEW);
- var bufferLength = buffer[$LENGTH];
- var offset = toInteger(byteOffset);
- if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
- byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
- if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
- this[$BUFFER] = buffer;
- this[$OFFSET] = offset;
- this[$LENGTH] = byteLength;
- };
- if (DESCRIPTORS) {
- addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
- addGetter($DataView, BUFFER, '_b');
- addGetter($DataView, BYTE_LENGTH, '_l');
- addGetter($DataView, BYTE_OFFSET, '_o');
- }
- redefineAll($DataView[PROTOTYPE], {
- getInt8: function getInt8(byteOffset) {
- return get(this, 1, byteOffset)[0] << 24 >> 24;
- },
- getUint8: function getUint8(byteOffset) {
- return get(this, 1, byteOffset)[0];
- },
- getInt16: function getInt16(byteOffset /* , littleEndian */) {
- var bytes = get(this, 2, byteOffset, arguments[1]);
- return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
- },
- getUint16: function getUint16(byteOffset /* , littleEndian */) {
- var bytes = get(this, 2, byteOffset, arguments[1]);
- return bytes[1] << 8 | bytes[0];
- },
- getInt32: function getInt32(byteOffset /* , littleEndian */) {
- return unpackI32(get(this, 4, byteOffset, arguments[1]));
- },
- getUint32: function getUint32(byteOffset /* , littleEndian */) {
- return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
- },
- getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
- return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
- },
- getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
- return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
- },
- setInt8: function setInt8(byteOffset, value) {
- set(this, 1, byteOffset, packI8, value);
- },
- setUint8: function setUint8(byteOffset, value) {
- set(this, 1, byteOffset, packI8, value);
- },
- setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
- set(this, 2, byteOffset, packI16, value, arguments[2]);
- },
- setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
- set(this, 2, byteOffset, packI16, value, arguments[2]);
- },
- setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
- set(this, 4, byteOffset, packI32, value, arguments[2]);
- },
- setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
- set(this, 4, byteOffset, packI32, value, arguments[2]);
- },
- setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
- set(this, 4, byteOffset, packF32, value, arguments[2]);
- },
- setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
- set(this, 8, byteOffset, packF64, value, arguments[2]);
- }
- });
- } else {
- if (!fails(function () {
- $ArrayBuffer(1);
- }) || !fails(function () {
- new $ArrayBuffer(-1); // eslint-disable-line no-new
- }) || fails(function () {
- new $ArrayBuffer(); // eslint-disable-line no-new
- new $ArrayBuffer(1.5); // eslint-disable-line no-new
- new $ArrayBuffer(NaN); // eslint-disable-line no-new
- return $ArrayBuffer.name != ARRAY_BUFFER;
- })) {
- $ArrayBuffer = function ArrayBuffer(length) {
- anInstance(this, $ArrayBuffer);
- return new BaseBuffer(toIndex(length));
- };
- var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
- for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
- if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);
- }
- if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;
- }
- // iOS Safari 7.x bug
- var view = new $DataView(new $ArrayBuffer(2));
- var $setInt8 = $DataView[PROTOTYPE].setInt8;
- view.setInt8(0, 2147483648);
- view.setInt8(1, 2147483649);
- if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
- setInt8: function setInt8(byteOffset, value) {
- $setInt8.call(this, byteOffset, value << 24 >> 24);
- },
- setUint8: function setUint8(byteOffset, value) {
- $setInt8.call(this, byteOffset, value << 24 >> 24);
- }
- }, true);
- }
- setToStringTag($ArrayBuffer, ARRAY_BUFFER);
- setToStringTag($DataView, DATA_VIEW);
- hide($DataView[PROTOTYPE], $typed.VIEW, true);
- exports[ARRAY_BUFFER] = $ArrayBuffer;
- exports[DATA_VIEW] = $DataView;
- /***/ }),
- /***/ 89383:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(3816);
- var hide = __webpack_require__(87728);
- var uid = __webpack_require__(93953);
- var TYPED = uid('typed_array');
- var VIEW = uid('view');
- var ABV = !!(global.ArrayBuffer && global.DataView);
- var CONSTR = ABV;
- var i = 0;
- var l = 9;
- var Typed;
- var TypedArrayConstructors = (
- 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
- ).split(',');
- while (i < l) {
- if (Typed = global[TypedArrayConstructors[i++]]) {
- hide(Typed.prototype, TYPED, true);
- hide(Typed.prototype, VIEW, true);
- } else CONSTR = false;
- }
- module.exports = {
- ABV: ABV,
- CONSTR: CONSTR,
- TYPED: TYPED,
- VIEW: VIEW
- };
- /***/ }),
- /***/ 93953:
- /***/ ((module) => {
- var id = 0;
- var px = Math.random();
- module.exports = function (key) {
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
- };
- /***/ }),
- /***/ 30575:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(3816);
- var navigator = global.navigator;
- module.exports = navigator && navigator.userAgent || '';
- /***/ }),
- /***/ 1616:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isObject = __webpack_require__(55286);
- module.exports = function (it, TYPE) {
- if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
- return it;
- };
- /***/ }),
- /***/ 36074:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(3816);
- var core = __webpack_require__(25645);
- var LIBRARY = __webpack_require__(4461);
- var wksExt = __webpack_require__(28787);
- var defineProperty = (__webpack_require__(99275).f);
- module.exports = function (name) {
- var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
- if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
- };
- /***/ }),
- /***/ 28787:
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- exports.f = __webpack_require__(86314);
- /***/ }),
- /***/ 86314:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var store = __webpack_require__(3825)('wks');
- var uid = __webpack_require__(93953);
- var Symbol = (__webpack_require__(3816).Symbol);
- var USE_SYMBOL = typeof Symbol == 'function';
- var $exports = module.exports = function (name) {
- return store[name] || (store[name] =
- USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
- };
- $exports.store = store;
- /***/ }),
- /***/ 69002:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var classof = __webpack_require__(41488);
- var ITERATOR = __webpack_require__(86314)('iterator');
- var Iterators = __webpack_require__(87234);
- module.exports = (__webpack_require__(25645).getIteratorMethod) = function (it) {
- if (it != undefined) return it[ITERATOR]
- || it['@@iterator']
- || Iterators[classof(it)];
- };
- /***/ }),
- /***/ 32000:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
- var $export = __webpack_require__(42985);
- $export($export.P, 'Array', { copyWithin: __webpack_require__(5216) });
- __webpack_require__(17722)('copyWithin');
- /***/ }),
- /***/ 15745:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $every = __webpack_require__(10050)(4);
- $export($export.P + $export.F * !__webpack_require__(77717)([].every, true), 'Array', {
- // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
- every: function every(callbackfn /* , thisArg */) {
- return $every(this, callbackfn, arguments[1]);
- }
- });
- /***/ }),
- /***/ 48977:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
- var $export = __webpack_require__(42985);
- $export($export.P, 'Array', { fill: __webpack_require__(46852) });
- __webpack_require__(17722)('fill');
- /***/ }),
- /***/ 98837:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $filter = __webpack_require__(10050)(2);
- $export($export.P + $export.F * !__webpack_require__(77717)([].filter, true), 'Array', {
- // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
- filter: function filter(callbackfn /* , thisArg */) {
- return $filter(this, callbackfn, arguments[1]);
- }
- });
- /***/ }),
- /***/ 94899:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
- var $export = __webpack_require__(42985);
- var $find = __webpack_require__(10050)(6);
- var KEY = 'findIndex';
- var forced = true;
- // Shouldn't skip holes
- if (KEY in []) Array(1)[KEY](function () { forced = false; });
- $export($export.P + $export.F * forced, 'Array', {
- findIndex: function findIndex(callbackfn /* , that = undefined */) {
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- __webpack_require__(17722)(KEY);
- /***/ }),
- /***/ 52310:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
- var $export = __webpack_require__(42985);
- var $find = __webpack_require__(10050)(5);
- var KEY = 'find';
- var forced = true;
- // Shouldn't skip holes
- if (KEY in []) Array(1)[KEY](function () { forced = false; });
- $export($export.P + $export.F * forced, 'Array', {
- find: function find(callbackfn /* , that = undefined */) {
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- __webpack_require__(17722)(KEY);
- /***/ }),
- /***/ 24336:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $forEach = __webpack_require__(10050)(0);
- var STRICT = __webpack_require__(77717)([].forEach, true);
- $export($export.P + $export.F * !STRICT, 'Array', {
- // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
- forEach: function forEach(callbackfn /* , thisArg */) {
- return $forEach(this, callbackfn, arguments[1]);
- }
- });
- /***/ }),
- /***/ 30522:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var ctx = __webpack_require__(741);
- var $export = __webpack_require__(42985);
- var toObject = __webpack_require__(20508);
- var call = __webpack_require__(28851);
- var isArrayIter = __webpack_require__(86555);
- var toLength = __webpack_require__(10875);
- var createProperty = __webpack_require__(92811);
- var getIterFn = __webpack_require__(69002);
- $export($export.S + $export.F * !__webpack_require__(7462)(function (iter) { Array.from(iter); }), 'Array', {
- // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
- from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
- var O = toObject(arrayLike);
- var C = typeof this == 'function' ? this : Array;
- var aLen = arguments.length;
- var mapfn = aLen > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- var index = 0;
- var iterFn = getIterFn(O);
- var length, result, step, iterator;
- if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
- // if object isn't iterable or it's array with default iterator - use simple case
- if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
- for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
- createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
- }
- } else {
- length = toLength(O.length);
- for (result = new C(length); length > index; index++) {
- createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
- }
- }
- result.length = index;
- return result;
- }
- });
- /***/ }),
- /***/ 23369:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $indexOf = __webpack_require__(79315)(false);
- var $native = [].indexOf;
- var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
- $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(77717)($native)), 'Array', {
- // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
- indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
- return NEGATIVE_ZERO
- // convert -0 to +0
- ? $native.apply(this, arguments) || 0
- : $indexOf(this, searchElement, arguments[1]);
- }
- });
- /***/ }),
- /***/ 20774:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Array', { isArray: __webpack_require__(4302) });
- /***/ }),
- /***/ 56997:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var addToUnscopables = __webpack_require__(17722);
- var step = __webpack_require__(15436);
- var Iterators = __webpack_require__(87234);
- var toIObject = __webpack_require__(22110);
- // 22.1.3.4 Array.prototype.entries()
- // 22.1.3.13 Array.prototype.keys()
- // 22.1.3.29 Array.prototype.values()
- // 22.1.3.30 Array.prototype[@@iterator]()
- module.exports = __webpack_require__(42923)(Array, 'Array', function (iterated, kind) {
- this._t = toIObject(iterated); // target
- this._i = 0; // next index
- this._k = kind; // kind
- // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
- }, function () {
- var O = this._t;
- var kind = this._k;
- var index = this._i++;
- if (!O || index >= O.length) {
- this._t = undefined;
- return step(1);
- }
- if (kind == 'keys') return step(0, index);
- if (kind == 'values') return step(0, O[index]);
- return step(0, [index, O[index]]);
- }, 'values');
- // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
- Iterators.Arguments = Iterators.Array;
- addToUnscopables('keys');
- addToUnscopables('values');
- addToUnscopables('entries');
- /***/ }),
- /***/ 87842:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 22.1.3.13 Array.prototype.join(separator)
- var $export = __webpack_require__(42985);
- var toIObject = __webpack_require__(22110);
- var arrayJoin = [].join;
- // fallback for not array-like strings
- $export($export.P + $export.F * (__webpack_require__(49797) != Object || !__webpack_require__(77717)(arrayJoin)), 'Array', {
- join: function join(separator) {
- return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
- }
- });
- /***/ }),
- /***/ 99564:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var toIObject = __webpack_require__(22110);
- var toInteger = __webpack_require__(81467);
- var toLength = __webpack_require__(10875);
- var $native = [].lastIndexOf;
- var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
- $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(77717)($native)), 'Array', {
- // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
- lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
- // convert -0 to +0
- if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;
- var O = toIObject(this);
- var length = toLength(O.length);
- var index = length - 1;
- if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));
- if (index < 0) index = length + index;
- for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;
- return -1;
- }
- });
- /***/ }),
- /***/ 19371:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $map = __webpack_require__(10050)(1);
- $export($export.P + $export.F * !__webpack_require__(77717)([].map, true), 'Array', {
- // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
- map: function map(callbackfn /* , thisArg */) {
- return $map(this, callbackfn, arguments[1]);
- }
- });
- /***/ }),
- /***/ 58295:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var createProperty = __webpack_require__(92811);
- // WebKit Array.of isn't generic
- $export($export.S + $export.F * __webpack_require__(74253)(function () {
- function F() { /* empty */ }
- return !(Array.of.call(F) instanceof F);
- }), 'Array', {
- // 22.1.2.3 Array.of( ...items)
- of: function of(/* ...args */) {
- var index = 0;
- var aLen = arguments.length;
- var result = new (typeof this == 'function' ? this : Array)(aLen);
- while (aLen > index) createProperty(result, index, arguments[index++]);
- result.length = aLen;
- return result;
- }
- });
- /***/ }),
- /***/ 3750:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $reduce = __webpack_require__(37628);
- $export($export.P + $export.F * !__webpack_require__(77717)([].reduceRight, true), 'Array', {
- // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
- reduceRight: function reduceRight(callbackfn /* , initialValue */) {
- return $reduce(this, callbackfn, arguments.length, arguments[1], true);
- }
- });
- /***/ }),
- /***/ 33057:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $reduce = __webpack_require__(37628);
- $export($export.P + $export.F * !__webpack_require__(77717)([].reduce, true), 'Array', {
- // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
- reduce: function reduce(callbackfn /* , initialValue */) {
- return $reduce(this, callbackfn, arguments.length, arguments[1], false);
- }
- });
- /***/ }),
- /***/ 50110:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var html = __webpack_require__(40639);
- var cof = __webpack_require__(92032);
- var toAbsoluteIndex = __webpack_require__(92337);
- var toLength = __webpack_require__(10875);
- var arraySlice = [].slice;
- // fallback for not array-like ES3 strings and DOM objects
- $export($export.P + $export.F * __webpack_require__(74253)(function () {
- if (html) arraySlice.call(html);
- }), 'Array', {
- slice: function slice(begin, end) {
- var len = toLength(this.length);
- var klass = cof(this);
- end = end === undefined ? len : end;
- if (klass == 'Array') return arraySlice.call(this, begin, end);
- var start = toAbsoluteIndex(begin, len);
- var upTo = toAbsoluteIndex(end, len);
- var size = toLength(upTo - start);
- var cloned = new Array(size);
- var i = 0;
- for (; i < size; i++) cloned[i] = klass == 'String'
- ? this.charAt(start + i)
- : this[start + i];
- return cloned;
- }
- });
- /***/ }),
- /***/ 26773:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $some = __webpack_require__(10050)(3);
- $export($export.P + $export.F * !__webpack_require__(77717)([].some, true), 'Array', {
- // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
- some: function some(callbackfn /* , thisArg */) {
- return $some(this, callbackfn, arguments[1]);
- }
- });
- /***/ }),
- /***/ 20075:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var aFunction = __webpack_require__(24963);
- var toObject = __webpack_require__(20508);
- var fails = __webpack_require__(74253);
- var $sort = [].sort;
- var test = [1, 2, 3];
- $export($export.P + $export.F * (fails(function () {
- // IE8-
- test.sort(undefined);
- }) || !fails(function () {
- // V8 bug
- test.sort(null);
- // Old WebKit
- }) || !__webpack_require__(77717)($sort)), 'Array', {
- // 22.1.3.25 Array.prototype.sort(comparefn)
- sort: function sort(comparefn) {
- return comparefn === undefined
- ? $sort.call(toObject(this))
- : $sort.call(toObject(this), aFunction(comparefn));
- }
- });
- /***/ }),
- /***/ 31842:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(2974)('Array');
- /***/ }),
- /***/ 81822:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.3.3.1 / 15.9.4.4 Date.now()
- var $export = __webpack_require__(42985);
- $export($export.S, 'Date', { now: function () { return new Date().getTime(); } });
- /***/ }),
- /***/ 91031:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
- var $export = __webpack_require__(42985);
- var toISOString = __webpack_require__(53537);
- // PhantomJS / old WebKit has a broken implementations
- $export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
- toISOString: toISOString
- });
- /***/ }),
- /***/ 19977:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var toObject = __webpack_require__(20508);
- var toPrimitive = __webpack_require__(21689);
- $export($export.P + $export.F * __webpack_require__(74253)(function () {
- return new Date(NaN).toJSON() !== null
- || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
- }), 'Date', {
- // eslint-disable-next-line no-unused-vars
- toJSON: function toJSON(key) {
- var O = toObject(this);
- var pv = toPrimitive(O);
- return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
- }
- });
- /***/ }),
- /***/ 41560:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var TO_PRIMITIVE = __webpack_require__(86314)('toPrimitive');
- var proto = Date.prototype;
- if (!(TO_PRIMITIVE in proto)) __webpack_require__(87728)(proto, TO_PRIMITIVE, __webpack_require__(870));
- /***/ }),
- /***/ 46331:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var DateProto = Date.prototype;
- var INVALID_DATE = 'Invalid Date';
- var TO_STRING = 'toString';
- var $toString = DateProto[TO_STRING];
- var getTime = DateProto.getTime;
- if (new Date(NaN) + '' != INVALID_DATE) {
- __webpack_require__(77234)(DateProto, TO_STRING, function toString() {
- var value = getTime.call(this);
- // eslint-disable-next-line no-self-compare
- return value === value ? $toString.call(this) : INVALID_DATE;
- });
- }
- /***/ }),
- /***/ 39730:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
- var $export = __webpack_require__(42985);
- $export($export.P, 'Function', { bind: __webpack_require__(34398) });
- /***/ }),
- /***/ 48377:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var isObject = __webpack_require__(55286);
- var getPrototypeOf = __webpack_require__(468);
- var HAS_INSTANCE = __webpack_require__(86314)('hasInstance');
- var FunctionProto = Function.prototype;
- // 19.2.3.6 Function.prototype[@@hasInstance](V)
- if (!(HAS_INSTANCE in FunctionProto)) (__webpack_require__(99275).f)(FunctionProto, HAS_INSTANCE, { value: function (O) {
- if (typeof this != 'function' || !isObject(O)) return false;
- if (!isObject(this.prototype)) return O instanceof this;
- // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
- while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
- return false;
- } });
- /***/ }),
- /***/ 6059:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var dP = (__webpack_require__(99275).f);
- var FProto = Function.prototype;
- var nameRE = /^\s*function ([^ (]*)/;
- var NAME = 'name';
- // 19.2.4.2 name
- NAME in FProto || __webpack_require__(67057) && dP(FProto, NAME, {
- configurable: true,
- get: function () {
- try {
- return ('' + this).match(nameRE)[1];
- } catch (e) {
- return '';
- }
- }
- });
- /***/ }),
- /***/ 88416:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var strong = __webpack_require__(9824);
- var validate = __webpack_require__(1616);
- var MAP = 'Map';
- // 23.1 Map Objects
- module.exports = __webpack_require__(45795)(MAP, function (get) {
- return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
- }, {
- // 23.1.3.6 Map.prototype.get(key)
- get: function get(key) {
- var entry = strong.getEntry(validate(this, MAP), key);
- return entry && entry.v;
- },
- // 23.1.3.9 Map.prototype.set(key, value)
- set: function set(key, value) {
- return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
- }
- }, strong, true);
- /***/ }),
- /***/ 76503:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.3 Math.acosh(x)
- var $export = __webpack_require__(42985);
- var log1p = __webpack_require__(46206);
- var sqrt = Math.sqrt;
- var $acosh = Math.acosh;
- $export($export.S + $export.F * !($acosh
- // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
- && Math.floor($acosh(Number.MAX_VALUE)) == 710
- // Tor Browser bug: Math.acosh(Infinity) -> NaN
- && $acosh(Infinity) == Infinity
- ), 'Math', {
- acosh: function acosh(x) {
- return (x = +x) < 1 ? NaN : x > 94906265.62425156
- ? Math.log(x) + Math.LN2
- : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
- }
- });
- /***/ }),
- /***/ 66786:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.5 Math.asinh(x)
- var $export = __webpack_require__(42985);
- var $asinh = Math.asinh;
- function asinh(x) {
- return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
- }
- // Tor Browser bug: Math.asinh(0) -> -0
- $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });
- /***/ }),
- /***/ 50932:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.7 Math.atanh(x)
- var $export = __webpack_require__(42985);
- var $atanh = Math.atanh;
- // Tor Browser bug: Math.atanh(-0) -> 0
- $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
- atanh: function atanh(x) {
- return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
- }
- });
- /***/ }),
- /***/ 57526:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.9 Math.cbrt(x)
- var $export = __webpack_require__(42985);
- var sign = __webpack_require__(61801);
- $export($export.S, 'Math', {
- cbrt: function cbrt(x) {
- return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
- }
- });
- /***/ }),
- /***/ 21591:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.11 Math.clz32(x)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Math', {
- clz32: function clz32(x) {
- return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
- }
- });
- /***/ }),
- /***/ 9073:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.12 Math.cosh(x)
- var $export = __webpack_require__(42985);
- var exp = Math.exp;
- $export($export.S, 'Math', {
- cosh: function cosh(x) {
- return (exp(x = +x) + exp(-x)) / 2;
- }
- });
- /***/ }),
- /***/ 80347:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.14 Math.expm1(x)
- var $export = __webpack_require__(42985);
- var $expm1 = __webpack_require__(13086);
- $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });
- /***/ }),
- /***/ 30579:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.16 Math.fround(x)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Math', { fround: __webpack_require__(34934) });
- /***/ }),
- /***/ 4669:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
- var $export = __webpack_require__(42985);
- var abs = Math.abs;
- $export($export.S, 'Math', {
- hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
- var sum = 0;
- var i = 0;
- var aLen = arguments.length;
- var larg = 0;
- var arg, div;
- while (i < aLen) {
- arg = abs(arguments[i++]);
- if (larg < arg) {
- div = larg / arg;
- sum = sum * div * div + 1;
- larg = arg;
- } else if (arg > 0) {
- div = arg / larg;
- sum += div * div;
- } else sum += arg;
- }
- return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
- }
- });
- /***/ }),
- /***/ 67710:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.18 Math.imul(x, y)
- var $export = __webpack_require__(42985);
- var $imul = Math.imul;
- // some WebKit versions fails with big numbers, some has wrong arity
- $export($export.S + $export.F * __webpack_require__(74253)(function () {
- return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
- }), 'Math', {
- imul: function imul(x, y) {
- var UINT16 = 0xffff;
- var xn = +x;
- var yn = +y;
- var xl = UINT16 & xn;
- var yl = UINT16 & yn;
- return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
- }
- });
- /***/ }),
- /***/ 45789:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.21 Math.log10(x)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Math', {
- log10: function log10(x) {
- return Math.log(x) * Math.LOG10E;
- }
- });
- /***/ }),
- /***/ 33514:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.20 Math.log1p(x)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Math', { log1p: __webpack_require__(46206) });
- /***/ }),
- /***/ 99978:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.22 Math.log2(x)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Math', {
- log2: function log2(x) {
- return Math.log(x) / Math.LN2;
- }
- });
- /***/ }),
- /***/ 58472:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.28 Math.sign(x)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Math', { sign: __webpack_require__(61801) });
- /***/ }),
- /***/ 86946:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.30 Math.sinh(x)
- var $export = __webpack_require__(42985);
- var expm1 = __webpack_require__(13086);
- var exp = Math.exp;
- // V8 near Chromium 38 has a problem with very small numbers
- $export($export.S + $export.F * __webpack_require__(74253)(function () {
- return !Math.sinh(-2e-17) != -2e-17;
- }), 'Math', {
- sinh: function sinh(x) {
- return Math.abs(x = +x) < 1
- ? (expm1(x) - expm1(-x)) / 2
- : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
- }
- });
- /***/ }),
- /***/ 35068:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.33 Math.tanh(x)
- var $export = __webpack_require__(42985);
- var expm1 = __webpack_require__(13086);
- var exp = Math.exp;
- $export($export.S, 'Math', {
- tanh: function tanh(x) {
- var a = expm1(x = +x);
- var b = expm1(-x);
- return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
- }
- });
- /***/ }),
- /***/ 413:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.2.2.34 Math.trunc(x)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Math', {
- trunc: function trunc(it) {
- return (it > 0 ? Math.floor : Math.ceil)(it);
- }
- });
- /***/ }),
- /***/ 11246:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var global = __webpack_require__(3816);
- var has = __webpack_require__(79181);
- var cof = __webpack_require__(92032);
- var inheritIfRequired = __webpack_require__(40266);
- var toPrimitive = __webpack_require__(21689);
- var fails = __webpack_require__(74253);
- var gOPN = (__webpack_require__(20616).f);
- var gOPD = (__webpack_require__(18693).f);
- var dP = (__webpack_require__(99275).f);
- var $trim = (__webpack_require__(29599).trim);
- var NUMBER = 'Number';
- var $Number = global[NUMBER];
- var Base = $Number;
- var proto = $Number.prototype;
- // Opera ~12 has broken Object#toString
- var BROKEN_COF = cof(__webpack_require__(42503)(proto)) == NUMBER;
- var TRIM = 'trim' in String.prototype;
- // 7.1.3 ToNumber(argument)
- var toNumber = function (argument) {
- var it = toPrimitive(argument, false);
- if (typeof it == 'string' && it.length > 2) {
- it = TRIM ? it.trim() : $trim(it, 3);
- var first = it.charCodeAt(0);
- var third, radix, maxCode;
- if (first === 43 || first === 45) {
- third = it.charCodeAt(2);
- if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
- } else if (first === 48) {
- switch (it.charCodeAt(1)) {
- case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
- case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
- default: return +it;
- }
- for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
- code = digits.charCodeAt(i);
- // parseInt parses a string to a first unavailable symbol
- // but ToNumber should return NaN if a string contains unavailable symbols
- if (code < 48 || code > maxCode) return NaN;
- } return parseInt(digits, radix);
- }
- } return +it;
- };
- if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
- $Number = function Number(value) {
- var it = arguments.length < 1 ? 0 : value;
- var that = this;
- return that instanceof $Number
- // check on 1..constructor(foo) case
- && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
- ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
- };
- for (var keys = __webpack_require__(67057) ? gOPN(Base) : (
- // ES3:
- 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
- // ES6 (in case, if modules with ES6 Number statics required before):
- 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
- 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
- ).split(','), j = 0, key; keys.length > j; j++) {
- if (has(Base, key = keys[j]) && !has($Number, key)) {
- dP($Number, key, gOPD(Base, key));
- }
- }
- $Number.prototype = proto;
- proto.constructor = $Number;
- __webpack_require__(77234)(global, NUMBER, $Number);
- }
- /***/ }),
- /***/ 75972:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.1.2.1 Number.EPSILON
- var $export = __webpack_require__(42985);
- $export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });
- /***/ }),
- /***/ 53403:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.1.2.2 Number.isFinite(number)
- var $export = __webpack_require__(42985);
- var _isFinite = (__webpack_require__(3816).isFinite);
- $export($export.S, 'Number', {
- isFinite: function isFinite(it) {
- return typeof it == 'number' && _isFinite(it);
- }
- });
- /***/ }),
- /***/ 92516:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.1.2.3 Number.isInteger(number)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Number', { isInteger: __webpack_require__(18367) });
- /***/ }),
- /***/ 49371:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.1.2.4 Number.isNaN(number)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Number', {
- isNaN: function isNaN(number) {
- // eslint-disable-next-line no-self-compare
- return number != number;
- }
- });
- /***/ }),
- /***/ 86479:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.1.2.5 Number.isSafeInteger(number)
- var $export = __webpack_require__(42985);
- var isInteger = __webpack_require__(18367);
- var abs = Math.abs;
- $export($export.S, 'Number', {
- isSafeInteger: function isSafeInteger(number) {
- return isInteger(number) && abs(number) <= 0x1fffffffffffff;
- }
- });
- /***/ }),
- /***/ 91736:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.1.2.6 Number.MAX_SAFE_INTEGER
- var $export = __webpack_require__(42985);
- $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
- /***/ }),
- /***/ 51889:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 20.1.2.10 Number.MIN_SAFE_INTEGER
- var $export = __webpack_require__(42985);
- $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
- /***/ }),
- /***/ 65177:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- var $parseFloat = __webpack_require__(47743);
- // 20.1.2.12 Number.parseFloat(string)
- $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });
- /***/ }),
- /***/ 81246:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- var $parseInt = __webpack_require__(55960);
- // 20.1.2.13 Number.parseInt(string, radix)
- $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });
- /***/ }),
- /***/ 30726:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var toInteger = __webpack_require__(81467);
- var aNumberValue = __webpack_require__(83365);
- var repeat = __webpack_require__(68595);
- var $toFixed = 1.0.toFixed;
- var floor = Math.floor;
- var data = [0, 0, 0, 0, 0, 0];
- var ERROR = 'Number.toFixed: incorrect invocation!';
- var ZERO = '0';
- var multiply = function (n, c) {
- var i = -1;
- var c2 = c;
- while (++i < 6) {
- c2 += n * data[i];
- data[i] = c2 % 1e7;
- c2 = floor(c2 / 1e7);
- }
- };
- var divide = function (n) {
- var i = 6;
- var c = 0;
- while (--i >= 0) {
- c += data[i];
- data[i] = floor(c / n);
- c = (c % n) * 1e7;
- }
- };
- var numToString = function () {
- var i = 6;
- var s = '';
- while (--i >= 0) {
- if (s !== '' || i === 0 || data[i] !== 0) {
- var t = String(data[i]);
- s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
- }
- } return s;
- };
- var pow = function (x, n, acc) {
- return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
- };
- var log = function (x) {
- var n = 0;
- var x2 = x;
- while (x2 >= 4096) {
- n += 12;
- x2 /= 4096;
- }
- while (x2 >= 2) {
- n += 1;
- x2 /= 2;
- } return n;
- };
- $export($export.P + $export.F * (!!$toFixed && (
- 0.00008.toFixed(3) !== '0.000' ||
- 0.9.toFixed(0) !== '1' ||
- 1.255.toFixed(2) !== '1.25' ||
- 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
- ) || !__webpack_require__(74253)(function () {
- // V8 ~ Android 4.3-
- $toFixed.call({});
- })), 'Number', {
- toFixed: function toFixed(fractionDigits) {
- var x = aNumberValue(this, ERROR);
- var f = toInteger(fractionDigits);
- var s = '';
- var m = ZERO;
- var e, z, j, k;
- if (f < 0 || f > 20) throw RangeError(ERROR);
- // eslint-disable-next-line no-self-compare
- if (x != x) return 'NaN';
- if (x <= -1e21 || x >= 1e21) return String(x);
- if (x < 0) {
- s = '-';
- x = -x;
- }
- if (x > 1e-21) {
- e = log(x * pow(2, 69, 1)) - 69;
- z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
- z *= 0x10000000000000;
- e = 52 - e;
- if (e > 0) {
- multiply(0, z);
- j = f;
- while (j >= 7) {
- multiply(1e7, 0);
- j -= 7;
- }
- multiply(pow(10, j, 1), 0);
- j = e - 1;
- while (j >= 23) {
- divide(1 << 23);
- j -= 23;
- }
- divide(1 << j);
- multiply(1, 1);
- divide(2);
- m = numToString();
- } else {
- multiply(0, z);
- multiply(1 << -e, 0);
- m = numToString() + repeat.call(ZERO, f);
- }
- }
- if (f > 0) {
- k = m.length;
- m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
- } else {
- m = s + m;
- } return m;
- }
- });
- /***/ }),
- /***/ 1901:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $fails = __webpack_require__(74253);
- var aNumberValue = __webpack_require__(83365);
- var $toPrecision = 1.0.toPrecision;
- $export($export.P + $export.F * ($fails(function () {
- // IE7-
- return $toPrecision.call(1, undefined) !== '1';
- }) || !$fails(function () {
- // V8 ~ Android 4.3-
- $toPrecision.call({});
- })), 'Number', {
- toPrecision: function toPrecision(precision) {
- var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
- return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
- }
- });
- /***/ }),
- /***/ 75115:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.3.1 Object.assign(target, source)
- var $export = __webpack_require__(42985);
- $export($export.S + $export.F, 'Object', { assign: __webpack_require__(35345) });
- /***/ }),
- /***/ 68132:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
- $export($export.S, 'Object', { create: __webpack_require__(42503) });
- /***/ }),
- /***/ 37470:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
- $export($export.S + $export.F * !__webpack_require__(67057), 'Object', { defineProperties: __webpack_require__(35588) });
- /***/ }),
- /***/ 48388:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
- $export($export.S + $export.F * !__webpack_require__(67057), 'Object', { defineProperty: (__webpack_require__(99275).f) });
- /***/ }),
- /***/ 89375:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.5 Object.freeze(O)
- var isObject = __webpack_require__(55286);
- var meta = (__webpack_require__(84728).onFreeze);
- __webpack_require__(33160)('freeze', function ($freeze) {
- return function freeze(it) {
- return $freeze && isObject(it) ? $freeze(meta(it)) : it;
- };
- });
- /***/ }),
- /***/ 94882:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
- var toIObject = __webpack_require__(22110);
- var $getOwnPropertyDescriptor = (__webpack_require__(18693).f);
- __webpack_require__(33160)('getOwnPropertyDescriptor', function () {
- return function getOwnPropertyDescriptor(it, key) {
- return $getOwnPropertyDescriptor(toIObject(it), key);
- };
- });
- /***/ }),
- /***/ 79622:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.7 Object.getOwnPropertyNames(O)
- __webpack_require__(33160)('getOwnPropertyNames', function () {
- return (__webpack_require__(39327).f);
- });
- /***/ }),
- /***/ 41520:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.9 Object.getPrototypeOf(O)
- var toObject = __webpack_require__(20508);
- var $getPrototypeOf = __webpack_require__(468);
- __webpack_require__(33160)('getPrototypeOf', function () {
- return function getPrototypeOf(it) {
- return $getPrototypeOf(toObject(it));
- };
- });
- /***/ }),
- /***/ 49892:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.11 Object.isExtensible(O)
- var isObject = __webpack_require__(55286);
- __webpack_require__(33160)('isExtensible', function ($isExtensible) {
- return function isExtensible(it) {
- return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
- };
- });
- /***/ }),
- /***/ 64157:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.12 Object.isFrozen(O)
- var isObject = __webpack_require__(55286);
- __webpack_require__(33160)('isFrozen', function ($isFrozen) {
- return function isFrozen(it) {
- return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
- };
- });
- /***/ }),
- /***/ 35095:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.13 Object.isSealed(O)
- var isObject = __webpack_require__(55286);
- __webpack_require__(33160)('isSealed', function ($isSealed) {
- return function isSealed(it) {
- return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
- };
- });
- /***/ }),
- /***/ 99176:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.3.10 Object.is(value1, value2)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Object', { is: __webpack_require__(27195) });
- /***/ }),
- /***/ 27476:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.14 Object.keys(O)
- var toObject = __webpack_require__(20508);
- var $keys = __webpack_require__(47184);
- __webpack_require__(33160)('keys', function () {
- return function keys(it) {
- return $keys(toObject(it));
- };
- });
- /***/ }),
- /***/ 84672:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.15 Object.preventExtensions(O)
- var isObject = __webpack_require__(55286);
- var meta = (__webpack_require__(84728).onFreeze);
- __webpack_require__(33160)('preventExtensions', function ($preventExtensions) {
- return function preventExtensions(it) {
- return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
- };
- });
- /***/ }),
- /***/ 43533:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.2.17 Object.seal(O)
- var isObject = __webpack_require__(55286);
- var meta = (__webpack_require__(84728).onFreeze);
- __webpack_require__(33160)('seal', function ($seal) {
- return function seal(it) {
- return $seal && isObject(it) ? $seal(meta(it)) : it;
- };
- });
- /***/ }),
- /***/ 68838:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 19.1.3.19 Object.setPrototypeOf(O, proto)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Object', { setPrototypeOf: (__webpack_require__(27375).set) });
- /***/ }),
- /***/ 96253:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 19.1.3.6 Object.prototype.toString()
- var classof = __webpack_require__(41488);
- var test = {};
- test[__webpack_require__(86314)('toStringTag')] = 'z';
- if (test + '' != '[object z]') {
- __webpack_require__(77234)(Object.prototype, 'toString', function toString() {
- return '[object ' + classof(this) + ']';
- }, true);
- }
- /***/ }),
- /***/ 64299:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- var $parseFloat = __webpack_require__(47743);
- // 18.2.4 parseFloat(string)
- $export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });
- /***/ }),
- /***/ 71084:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- var $parseInt = __webpack_require__(55960);
- // 18.2.5 parseInt(string, radix)
- $export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });
- /***/ }),
- /***/ 40851:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var LIBRARY = __webpack_require__(4461);
- var global = __webpack_require__(3816);
- var ctx = __webpack_require__(741);
- var classof = __webpack_require__(41488);
- var $export = __webpack_require__(42985);
- var isObject = __webpack_require__(55286);
- var aFunction = __webpack_require__(24963);
- var anInstance = __webpack_require__(83328);
- var forOf = __webpack_require__(3531);
- var speciesConstructor = __webpack_require__(58364);
- var task = (__webpack_require__(74193).set);
- var microtask = __webpack_require__(14351)();
- var newPromiseCapabilityModule = __webpack_require__(43499);
- var perform = __webpack_require__(10188);
- var userAgent = __webpack_require__(30575);
- var promiseResolve = __webpack_require__(50094);
- var PROMISE = 'Promise';
- var TypeError = global.TypeError;
- var process = global.process;
- var versions = process && process.versions;
- var v8 = versions && versions.v8 || '';
- var $Promise = global[PROMISE];
- var isNode = classof(process) == 'process';
- var empty = function () { /* empty */ };
- var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
- var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
- var USE_NATIVE = !!function () {
- try {
- // correct subclassing with @@species support
- var promise = $Promise.resolve(1);
- var FakePromise = (promise.constructor = {})[__webpack_require__(86314)('species')] = function (exec) {
- exec(empty, empty);
- };
- // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
- return (isNode || typeof PromiseRejectionEvent == 'function')
- && promise.then(empty) instanceof FakePromise
- // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
- // we can't detect it synchronously, so just check versions
- && v8.indexOf('6.6') !== 0
- && userAgent.indexOf('Chrome/66') === -1;
- } catch (e) { /* empty */ }
- }();
- // helpers
- var isThenable = function (it) {
- var then;
- return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
- };
- var notify = function (promise, isReject) {
- if (promise._n) return;
- promise._n = true;
- var chain = promise._c;
- microtask(function () {
- var value = promise._v;
- var ok = promise._s == 1;
- var i = 0;
- var run = function (reaction) {
- var handler = ok ? reaction.ok : reaction.fail;
- var resolve = reaction.resolve;
- var reject = reaction.reject;
- var domain = reaction.domain;
- var result, then, exited;
- try {
- if (handler) {
- if (!ok) {
- if (promise._h == 2) onHandleUnhandled(promise);
- promise._h = 1;
- }
- if (handler === true) result = value;
- else {
- if (domain) domain.enter();
- result = handler(value); // may throw
- if (domain) {
- domain.exit();
- exited = true;
- }
- }
- if (result === reaction.promise) {
- reject(TypeError('Promise-chain cycle'));
- } else if (then = isThenable(result)) {
- then.call(result, resolve, reject);
- } else resolve(result);
- } else reject(value);
- } catch (e) {
- if (domain && !exited) domain.exit();
- reject(e);
- }
- };
- while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
- promise._c = [];
- promise._n = false;
- if (isReject && !promise._h) onUnhandled(promise);
- });
- };
- var onUnhandled = function (promise) {
- task.call(global, function () {
- var value = promise._v;
- var unhandled = isUnhandled(promise);
- var result, handler, console;
- if (unhandled) {
- result = perform(function () {
- if (isNode) {
- process.emit('unhandledRejection', value, promise);
- } else if (handler = global.onunhandledrejection) {
- handler({ promise: promise, reason: value });
- } else if ((console = global.console) && console.error) {
- console.error('Unhandled promise rejection', value);
- }
- });
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
- promise._h = isNode || isUnhandled(promise) ? 2 : 1;
- } promise._a = undefined;
- if (unhandled && result.e) throw result.v;
- });
- };
- var isUnhandled = function (promise) {
- return promise._h !== 1 && (promise._a || promise._c).length === 0;
- };
- var onHandleUnhandled = function (promise) {
- task.call(global, function () {
- var handler;
- if (isNode) {
- process.emit('rejectionHandled', promise);
- } else if (handler = global.onrejectionhandled) {
- handler({ promise: promise, reason: promise._v });
- }
- });
- };
- var $reject = function (value) {
- var promise = this;
- if (promise._d) return;
- promise._d = true;
- promise = promise._w || promise; // unwrap
- promise._v = value;
- promise._s = 2;
- if (!promise._a) promise._a = promise._c.slice();
- notify(promise, true);
- };
- var $resolve = function (value) {
- var promise = this;
- var then;
- if (promise._d) return;
- promise._d = true;
- promise = promise._w || promise; // unwrap
- try {
- if (promise === value) throw TypeError("Promise can't be resolved itself");
- if (then = isThenable(value)) {
- microtask(function () {
- var wrapper = { _w: promise, _d: false }; // wrap
- try {
- then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
- } catch (e) {
- $reject.call(wrapper, e);
- }
- });
- } else {
- promise._v = value;
- promise._s = 1;
- notify(promise, false);
- }
- } catch (e) {
- $reject.call({ _w: promise, _d: false }, e); // wrap
- }
- };
- // constructor polyfill
- if (!USE_NATIVE) {
- // 25.4.3.1 Promise(executor)
- $Promise = function Promise(executor) {
- anInstance(this, $Promise, PROMISE, '_h');
- aFunction(executor);
- Internal.call(this);
- try {
- executor(ctx($resolve, this, 1), ctx($reject, this, 1));
- } catch (err) {
- $reject.call(this, err);
- }
- };
- // eslint-disable-next-line no-unused-vars
- Internal = function Promise(executor) {
- this._c = []; // <- awaiting reactions
- this._a = undefined; // <- checked in isUnhandled reactions
- this._s = 0; // <- state
- this._d = false; // <- done
- this._v = undefined; // <- value
- this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
- this._n = false; // <- notify
- };
- Internal.prototype = __webpack_require__(24408)($Promise.prototype, {
- // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
- then: function then(onFulfilled, onRejected) {
- var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
- reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
- reaction.fail = typeof onRejected == 'function' && onRejected;
- reaction.domain = isNode ? process.domain : undefined;
- this._c.push(reaction);
- if (this._a) this._a.push(reaction);
- if (this._s) notify(this, false);
- return reaction.promise;
- },
- // 25.4.5.1 Promise.prototype.catch(onRejected)
- 'catch': function (onRejected) {
- return this.then(undefined, onRejected);
- }
- });
- OwnPromiseCapability = function () {
- var promise = new Internal();
- this.promise = promise;
- this.resolve = ctx($resolve, promise, 1);
- this.reject = ctx($reject, promise, 1);
- };
- newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
- return C === $Promise || C === Wrapper
- ? new OwnPromiseCapability(C)
- : newGenericPromiseCapability(C);
- };
- }
- $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
- __webpack_require__(22943)($Promise, PROMISE);
- __webpack_require__(2974)(PROMISE);
- Wrapper = __webpack_require__(25645)[PROMISE];
- // statics
- $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
- // 25.4.4.5 Promise.reject(r)
- reject: function reject(r) {
- var capability = newPromiseCapability(this);
- var $$reject = capability.reject;
- $$reject(r);
- return capability.promise;
- }
- });
- $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
- // 25.4.4.6 Promise.resolve(x)
- resolve: function resolve(x) {
- return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
- }
- });
- $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(7462)(function (iter) {
- $Promise.all(iter)['catch'](empty);
- })), PROMISE, {
- // 25.4.4.1 Promise.all(iterable)
- all: function all(iterable) {
- var C = this;
- var capability = newPromiseCapability(C);
- var resolve = capability.resolve;
- var reject = capability.reject;
- var result = perform(function () {
- var values = [];
- var index = 0;
- var remaining = 1;
- forOf(iterable, false, function (promise) {
- var $index = index++;
- var alreadyCalled = false;
- values.push(undefined);
- remaining++;
- C.resolve(promise).then(function (value) {
- if (alreadyCalled) return;
- alreadyCalled = true;
- values[$index] = value;
- --remaining || resolve(values);
- }, reject);
- });
- --remaining || resolve(values);
- });
- if (result.e) reject(result.v);
- return capability.promise;
- },
- // 25.4.4.4 Promise.race(iterable)
- race: function race(iterable) {
- var C = this;
- var capability = newPromiseCapability(C);
- var reject = capability.reject;
- var result = perform(function () {
- forOf(iterable, false, function (promise) {
- C.resolve(promise).then(capability.resolve, reject);
- });
- });
- if (result.e) reject(result.v);
- return capability.promise;
- }
- });
- /***/ }),
- /***/ 21572:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
- var $export = __webpack_require__(42985);
- var aFunction = __webpack_require__(24963);
- var anObject = __webpack_require__(27007);
- var rApply = ((__webpack_require__(3816).Reflect) || {}).apply;
- var fApply = Function.apply;
- // MS Edge argumentsList argument is optional
- $export($export.S + $export.F * !__webpack_require__(74253)(function () {
- rApply(function () { /* empty */ });
- }), 'Reflect', {
- apply: function apply(target, thisArgument, argumentsList) {
- var T = aFunction(target);
- var L = anObject(argumentsList);
- return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
- }
- });
- /***/ }),
- /***/ 82139:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
- var $export = __webpack_require__(42985);
- var create = __webpack_require__(42503);
- var aFunction = __webpack_require__(24963);
- var anObject = __webpack_require__(27007);
- var isObject = __webpack_require__(55286);
- var fails = __webpack_require__(74253);
- var bind = __webpack_require__(34398);
- var rConstruct = ((__webpack_require__(3816).Reflect) || {}).construct;
- // MS Edge supports only 2 arguments and argumentsList argument is optional
- // FF Nightly sets third argument as `new.target`, but does not create `this` from it
- var NEW_TARGET_BUG = fails(function () {
- function F() { /* empty */ }
- return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
- });
- var ARGS_BUG = !fails(function () {
- rConstruct(function () { /* empty */ });
- });
- $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
- construct: function construct(Target, args /* , newTarget */) {
- aFunction(Target);
- anObject(args);
- var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
- if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
- if (Target == newTarget) {
- // w/o altered newTarget, optimization for 0-4 arguments
- switch (args.length) {
- case 0: return new Target();
- case 1: return new Target(args[0]);
- case 2: return new Target(args[0], args[1]);
- case 3: return new Target(args[0], args[1], args[2]);
- case 4: return new Target(args[0], args[1], args[2], args[3]);
- }
- // w/o altered newTarget, lot of arguments case
- var $args = [null];
- $args.push.apply($args, args);
- return new (bind.apply(Target, $args))();
- }
- // with altered newTarget, not support built-in constructors
- var proto = newTarget.prototype;
- var instance = create(isObject(proto) ? proto : Object.prototype);
- var result = Function.apply.call(Target, instance, args);
- return isObject(result) ? result : instance;
- }
- });
- /***/ }),
- /***/ 10685:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
- var dP = __webpack_require__(99275);
- var $export = __webpack_require__(42985);
- var anObject = __webpack_require__(27007);
- var toPrimitive = __webpack_require__(21689);
- // MS Edge has broken Reflect.defineProperty - throwing instead of returning false
- $export($export.S + $export.F * __webpack_require__(74253)(function () {
- // eslint-disable-next-line no-undef
- Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });
- }), 'Reflect', {
- defineProperty: function defineProperty(target, propertyKey, attributes) {
- anObject(target);
- propertyKey = toPrimitive(propertyKey, true);
- anObject(attributes);
- try {
- dP.f(target, propertyKey, attributes);
- return true;
- } catch (e) {
- return false;
- }
- }
- });
- /***/ }),
- /***/ 85535:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.4 Reflect.deleteProperty(target, propertyKey)
- var $export = __webpack_require__(42985);
- var gOPD = (__webpack_require__(18693).f);
- var anObject = __webpack_require__(27007);
- $export($export.S, 'Reflect', {
- deleteProperty: function deleteProperty(target, propertyKey) {
- var desc = gOPD(anObject(target), propertyKey);
- return desc && !desc.configurable ? false : delete target[propertyKey];
- }
- });
- /***/ }),
- /***/ 17347:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 26.1.5 Reflect.enumerate(target)
- var $export = __webpack_require__(42985);
- var anObject = __webpack_require__(27007);
- var Enumerate = function (iterated) {
- this._t = anObject(iterated); // target
- this._i = 0; // next index
- var keys = this._k = []; // keys
- var key;
- for (key in iterated) keys.push(key);
- };
- __webpack_require__(49988)(Enumerate, 'Object', function () {
- var that = this;
- var keys = that._k;
- var key;
- do {
- if (that._i >= keys.length) return { value: undefined, done: true };
- } while (!((key = keys[that._i++]) in that._t));
- return { value: key, done: false };
- });
- $export($export.S, 'Reflect', {
- enumerate: function enumerate(target) {
- return new Enumerate(target);
- }
- });
- /***/ }),
- /***/ 96633:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
- var gOPD = __webpack_require__(18693);
- var $export = __webpack_require__(42985);
- var anObject = __webpack_require__(27007);
- $export($export.S, 'Reflect', {
- getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
- return gOPD.f(anObject(target), propertyKey);
- }
- });
- /***/ }),
- /***/ 68989:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.8 Reflect.getPrototypeOf(target)
- var $export = __webpack_require__(42985);
- var getProto = __webpack_require__(468);
- var anObject = __webpack_require__(27007);
- $export($export.S, 'Reflect', {
- getPrototypeOf: function getPrototypeOf(target) {
- return getProto(anObject(target));
- }
- });
- /***/ }),
- /***/ 83049:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.6 Reflect.get(target, propertyKey [, receiver])
- var gOPD = __webpack_require__(18693);
- var getPrototypeOf = __webpack_require__(468);
- var has = __webpack_require__(79181);
- var $export = __webpack_require__(42985);
- var isObject = __webpack_require__(55286);
- var anObject = __webpack_require__(27007);
- function get(target, propertyKey /* , receiver */) {
- var receiver = arguments.length < 3 ? target : arguments[2];
- var desc, proto;
- if (anObject(target) === receiver) return target[propertyKey];
- if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')
- ? desc.value
- : desc.get !== undefined
- ? desc.get.call(receiver)
- : undefined;
- if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);
- }
- $export($export.S, 'Reflect', { get: get });
- /***/ }),
- /***/ 78270:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.9 Reflect.has(target, propertyKey)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Reflect', {
- has: function has(target, propertyKey) {
- return propertyKey in target;
- }
- });
- /***/ }),
- /***/ 64510:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.10 Reflect.isExtensible(target)
- var $export = __webpack_require__(42985);
- var anObject = __webpack_require__(27007);
- var $isExtensible = Object.isExtensible;
- $export($export.S, 'Reflect', {
- isExtensible: function isExtensible(target) {
- anObject(target);
- return $isExtensible ? $isExtensible(target) : true;
- }
- });
- /***/ }),
- /***/ 73984:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.11 Reflect.ownKeys(target)
- var $export = __webpack_require__(42985);
- $export($export.S, 'Reflect', { ownKeys: __webpack_require__(57643) });
- /***/ }),
- /***/ 75769:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.12 Reflect.preventExtensions(target)
- var $export = __webpack_require__(42985);
- var anObject = __webpack_require__(27007);
- var $preventExtensions = Object.preventExtensions;
- $export($export.S, 'Reflect', {
- preventExtensions: function preventExtensions(target) {
- anObject(target);
- try {
- if ($preventExtensions) $preventExtensions(target);
- return true;
- } catch (e) {
- return false;
- }
- }
- });
- /***/ }),
- /***/ 96014:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.14 Reflect.setPrototypeOf(target, proto)
- var $export = __webpack_require__(42985);
- var setProto = __webpack_require__(27375);
- if (setProto) $export($export.S, 'Reflect', {
- setPrototypeOf: function setPrototypeOf(target, proto) {
- setProto.check(target, proto);
- try {
- setProto.set(target, proto);
- return true;
- } catch (e) {
- return false;
- }
- }
- });
- /***/ }),
- /***/ 50055:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
- var dP = __webpack_require__(99275);
- var gOPD = __webpack_require__(18693);
- var getPrototypeOf = __webpack_require__(468);
- var has = __webpack_require__(79181);
- var $export = __webpack_require__(42985);
- var createDesc = __webpack_require__(90681);
- var anObject = __webpack_require__(27007);
- var isObject = __webpack_require__(55286);
- function set(target, propertyKey, V /* , receiver */) {
- var receiver = arguments.length < 4 ? target : arguments[3];
- var ownDesc = gOPD.f(anObject(target), propertyKey);
- var existingDescriptor, proto;
- if (!ownDesc) {
- if (isObject(proto = getPrototypeOf(target))) {
- return set(proto, propertyKey, V, receiver);
- }
- ownDesc = createDesc(0);
- }
- if (has(ownDesc, 'value')) {
- if (ownDesc.writable === false || !isObject(receiver)) return false;
- if (existingDescriptor = gOPD.f(receiver, propertyKey)) {
- if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
- existingDescriptor.value = V;
- dP.f(receiver, propertyKey, existingDescriptor);
- } else dP.f(receiver, propertyKey, createDesc(0, V));
- return true;
- }
- return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
- }
- $export($export.S, 'Reflect', { set: set });
- /***/ }),
- /***/ 83946:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var global = __webpack_require__(3816);
- var inheritIfRequired = __webpack_require__(40266);
- var dP = (__webpack_require__(99275).f);
- var gOPN = (__webpack_require__(20616).f);
- var isRegExp = __webpack_require__(55364);
- var $flags = __webpack_require__(53218);
- var $RegExp = global.RegExp;
- var Base = $RegExp;
- var proto = $RegExp.prototype;
- var re1 = /a/g;
- var re2 = /a/g;
- // "new" creates a new object, old webkit buggy here
- var CORRECT_NEW = new $RegExp(re1) !== re1;
- if (__webpack_require__(67057) && (!CORRECT_NEW || __webpack_require__(74253)(function () {
- re2[__webpack_require__(86314)('match')] = false;
- // RegExp constructor can alter flags and IsRegExp works correct with @@match
- return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
- }))) {
- $RegExp = function RegExp(p, f) {
- var tiRE = this instanceof $RegExp;
- var piRE = isRegExp(p);
- var fiU = f === undefined;
- return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
- : inheritIfRequired(CORRECT_NEW
- ? new Base(piRE && !fiU ? p.source : p, f)
- : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
- , tiRE ? this : proto, $RegExp);
- };
- var proxy = function (key) {
- key in $RegExp || dP($RegExp, key, {
- configurable: true,
- get: function () { return Base[key]; },
- set: function (it) { Base[key] = it; }
- });
- };
- for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);
- proto.constructor = $RegExp;
- $RegExp.prototype = proto;
- __webpack_require__(77234)(global, 'RegExp', $RegExp);
- }
- __webpack_require__(2974)('RegExp');
- /***/ }),
- /***/ 18269:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var regexpExec = __webpack_require__(21165);
- __webpack_require__(42985)({
- target: 'RegExp',
- proto: true,
- forced: regexpExec !== /./.exec
- }, {
- exec: regexpExec
- });
- /***/ }),
- /***/ 76774:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // 21.2.5.3 get RegExp.prototype.flags()
- if (__webpack_require__(67057) && /./g.flags != 'g') (__webpack_require__(99275).f)(RegExp.prototype, 'flags', {
- configurable: true,
- get: __webpack_require__(53218)
- });
- /***/ }),
- /***/ 21466:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var anObject = __webpack_require__(27007);
- var toLength = __webpack_require__(10875);
- var advanceStringIndex = __webpack_require__(76793);
- var regExpExec = __webpack_require__(27787);
- // @@match logic
- __webpack_require__(28082)('match', 1, function (defined, MATCH, $match, maybeCallNative) {
- return [
- // `String.prototype.match` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.match
- function match(regexp) {
- var O = defined(this);
- var fn = regexp == undefined ? undefined : regexp[MATCH];
- return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
- },
- // `RegExp.prototype[@@match]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
- function (regexp) {
- var res = maybeCallNative($match, regexp, this);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- if (!rx.global) return regExpExec(rx, S);
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- var A = [];
- var n = 0;
- var result;
- while ((result = regExpExec(rx, S)) !== null) {
- var matchStr = String(result[0]);
- A[n] = matchStr;
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- n++;
- }
- return n === 0 ? null : A;
- }
- ];
- });
- /***/ }),
- /***/ 59357:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var anObject = __webpack_require__(27007);
- var toObject = __webpack_require__(20508);
- var toLength = __webpack_require__(10875);
- var toInteger = __webpack_require__(81467);
- var advanceStringIndex = __webpack_require__(76793);
- var regExpExec = __webpack_require__(27787);
- var max = Math.max;
- var min = Math.min;
- var floor = Math.floor;
- var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
- var maybeToString = function (it) {
- return it === undefined ? it : String(it);
- };
- // @@replace logic
- __webpack_require__(28082)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
- return [
- // `String.prototype.replace` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.replace
- function replace(searchValue, replaceValue) {
- var O = defined(this);
- var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
- return fn !== undefined
- ? fn.call(searchValue, O, replaceValue)
- : $replace.call(String(O), searchValue, replaceValue);
- },
- // `RegExp.prototype[@@replace]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
- function (regexp, replaceValue) {
- var res = maybeCallNative($replace, regexp, this, replaceValue);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- var functionalReplace = typeof replaceValue === 'function';
- if (!functionalReplace) replaceValue = String(replaceValue);
- var global = rx.global;
- if (global) {
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- }
- var results = [];
- while (true) {
- var result = regExpExec(rx, S);
- if (result === null) break;
- results.push(result);
- if (!global) break;
- var matchStr = String(result[0]);
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- }
- var accumulatedResult = '';
- var nextSourcePosition = 0;
- for (var i = 0; i < results.length; i++) {
- result = results[i];
- var matched = String(result[0]);
- var position = max(min(toInteger(result.index), S.length), 0);
- var captures = [];
- // NOTE: This is equivalent to
- // captures = result.slice(1).map(maybeToString)
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
- for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
- var namedCaptures = result.groups;
- if (functionalReplace) {
- var replacerArgs = [matched].concat(captures, position, S);
- if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
- var replacement = String(replaceValue.apply(undefined, replacerArgs));
- } else {
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
- }
- if (position >= nextSourcePosition) {
- accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
- nextSourcePosition = position + matched.length;
- }
- }
- return accumulatedResult + S.slice(nextSourcePosition);
- }
- ];
- // https://tc39.github.io/ecma262/#sec-getsubstitution
- function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
- var tailPos = position + matched.length;
- var m = captures.length;
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
- if (namedCaptures !== undefined) {
- namedCaptures = toObject(namedCaptures);
- symbols = SUBSTITUTION_SYMBOLS;
- }
- return $replace.call(replacement, symbols, function (match, ch) {
- var capture;
- switch (ch.charAt(0)) {
- case '$': return '$';
- case '&': return matched;
- case '`': return str.slice(0, position);
- case "'": return str.slice(tailPos);
- case '<':
- capture = namedCaptures[ch.slice(1, -1)];
- break;
- default: // \d\d?
- var n = +ch;
- if (n === 0) return match;
- if (n > m) {
- var f = floor(n / 10);
- if (f === 0) return match;
- if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
- return match;
- }
- capture = captures[n - 1];
- }
- return capture === undefined ? '' : capture;
- });
- }
- });
- /***/ }),
- /***/ 76142:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var anObject = __webpack_require__(27007);
- var sameValue = __webpack_require__(27195);
- var regExpExec = __webpack_require__(27787);
- // @@search logic
- __webpack_require__(28082)('search', 1, function (defined, SEARCH, $search, maybeCallNative) {
- return [
- // `String.prototype.search` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.search
- function search(regexp) {
- var O = defined(this);
- var fn = regexp == undefined ? undefined : regexp[SEARCH];
- return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
- },
- // `RegExp.prototype[@@search]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
- function (regexp) {
- var res = maybeCallNative($search, regexp, this);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- var previousLastIndex = rx.lastIndex;
- if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
- var result = regExpExec(rx, S);
- if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
- return result === null ? -1 : result.index;
- }
- ];
- });
- /***/ }),
- /***/ 51876:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var isRegExp = __webpack_require__(55364);
- var anObject = __webpack_require__(27007);
- var speciesConstructor = __webpack_require__(58364);
- var advanceStringIndex = __webpack_require__(76793);
- var toLength = __webpack_require__(10875);
- var callRegExpExec = __webpack_require__(27787);
- var regexpExec = __webpack_require__(21165);
- var fails = __webpack_require__(74253);
- var $min = Math.min;
- var $push = [].push;
- var $SPLIT = 'split';
- var LENGTH = 'length';
- var LAST_INDEX = 'lastIndex';
- var MAX_UINT32 = 0xffffffff;
- // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
- var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });
- // @@split logic
- __webpack_require__(28082)('split', 2, function (defined, SPLIT, $split, maybeCallNative) {
- var internalSplit;
- if (
- 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
- 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
- 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
- '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
- '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
- ''[$SPLIT](/.?/)[LENGTH]
- ) {
- // based on es5-shim implementation, need to rework it
- internalSplit = function (separator, limit) {
- var string = String(this);
- if (separator === undefined && limit === 0) return [];
- // If `separator` is not a regex, use native split
- if (!isRegExp(separator)) return $split.call(string, separator, limit);
- var output = [];
- var flags = (separator.ignoreCase ? 'i' : '') +
- (separator.multiline ? 'm' : '') +
- (separator.unicode ? 'u' : '') +
- (separator.sticky ? 'y' : '');
- var lastLastIndex = 0;
- var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;
- // Make `global` and avoid `lastIndex` issues by working with a copy
- var separatorCopy = new RegExp(separator.source, flags + 'g');
- var match, lastIndex, lastLength;
- while (match = regexpExec.call(separatorCopy, string)) {
- lastIndex = separatorCopy[LAST_INDEX];
- if (lastIndex > lastLastIndex) {
- output.push(string.slice(lastLastIndex, match.index));
- if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
- lastLength = match[0][LENGTH];
- lastLastIndex = lastIndex;
- if (output[LENGTH] >= splitLimit) break;
- }
- if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
- }
- if (lastLastIndex === string[LENGTH]) {
- if (lastLength || !separatorCopy.test('')) output.push('');
- } else output.push(string.slice(lastLastIndex));
- return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
- };
- // Chakra, V8
- } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
- internalSplit = function (separator, limit) {
- return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);
- };
- } else {
- internalSplit = $split;
- }
- return [
- // `String.prototype.split` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.split
- function split(separator, limit) {
- var O = defined(this);
- var splitter = separator == undefined ? undefined : separator[SPLIT];
- return splitter !== undefined
- ? splitter.call(separator, O, limit)
- : internalSplit.call(String(O), separator, limit);
- },
- // `RegExp.prototype[@@split]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
- //
- // NOTE: This cannot be properly polyfilled in engines that don't support
- // the 'y' flag.
- function (regexp, limit) {
- var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- var C = speciesConstructor(rx, RegExp);
- var unicodeMatching = rx.unicode;
- var flags = (rx.ignoreCase ? 'i' : '') +
- (rx.multiline ? 'm' : '') +
- (rx.unicode ? 'u' : '') +
- (SUPPORTS_Y ? 'y' : 'g');
- // ^(? + rx + ) is needed, in combination with some S slicing, to
- // simulate the 'y' flag.
- var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
- if (lim === 0) return [];
- if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
- var p = 0;
- var q = 0;
- var A = [];
- while (q < S.length) {
- splitter.lastIndex = SUPPORTS_Y ? q : 0;
- var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
- var e;
- if (
- z === null ||
- (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
- ) {
- q = advanceStringIndex(S, q, unicodeMatching);
- } else {
- A.push(S.slice(p, q));
- if (A.length === lim) return A;
- for (var i = 1; i <= z.length - 1; i++) {
- A.push(z[i]);
- if (A.length === lim) return A;
- }
- q = p = e;
- }
- }
- A.push(S.slice(p));
- return A;
- }
- ];
- });
- /***/ }),
- /***/ 66108:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- __webpack_require__(76774);
- var anObject = __webpack_require__(27007);
- var $flags = __webpack_require__(53218);
- var DESCRIPTORS = __webpack_require__(67057);
- var TO_STRING = 'toString';
- var $toString = /./[TO_STRING];
- var define = function (fn) {
- __webpack_require__(77234)(RegExp.prototype, TO_STRING, fn, true);
- };
- // 21.2.5.14 RegExp.prototype.toString()
- if (__webpack_require__(74253)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
- define(function toString() {
- var R = anObject(this);
- return '/'.concat(R.source, '/',
- 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
- });
- // FF44- RegExp#toString has a wrong name
- } else if ($toString.name != TO_STRING) {
- define(function toString() {
- return $toString.call(this);
- });
- }
- /***/ }),
- /***/ 98184:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var strong = __webpack_require__(9824);
- var validate = __webpack_require__(1616);
- var SET = 'Set';
- // 23.2 Set Objects
- module.exports = __webpack_require__(45795)(SET, function (get) {
- return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
- }, {
- // 23.2.3.1 Set.prototype.add(value)
- add: function add(value) {
- return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
- }
- }, strong);
- /***/ }),
- /***/ 40856:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.2 String.prototype.anchor(name)
- __webpack_require__(29395)('anchor', function (createHTML) {
- return function anchor(name) {
- return createHTML(this, 'a', 'name', name);
- };
- });
- /***/ }),
- /***/ 80703:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.3 String.prototype.big()
- __webpack_require__(29395)('big', function (createHTML) {
- return function big() {
- return createHTML(this, 'big', '', '');
- };
- });
- /***/ }),
- /***/ 91539:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.4 String.prototype.blink()
- __webpack_require__(29395)('blink', function (createHTML) {
- return function blink() {
- return createHTML(this, 'blink', '', '');
- };
- });
- /***/ }),
- /***/ 5292:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.5 String.prototype.bold()
- __webpack_require__(29395)('bold', function (createHTML) {
- return function bold() {
- return createHTML(this, 'b', '', '');
- };
- });
- /***/ }),
- /***/ 29539:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $at = __webpack_require__(24496)(false);
- $export($export.P, 'String', {
- // 21.1.3.3 String.prototype.codePointAt(pos)
- codePointAt: function codePointAt(pos) {
- return $at(this, pos);
- }
- });
- /***/ }),
- /***/ 96620:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
- var $export = __webpack_require__(42985);
- var toLength = __webpack_require__(10875);
- var context = __webpack_require__(42094);
- var ENDS_WITH = 'endsWith';
- var $endsWith = ''[ENDS_WITH];
- $export($export.P + $export.F * __webpack_require__(8852)(ENDS_WITH), 'String', {
- endsWith: function endsWith(searchString /* , endPosition = @length */) {
- var that = context(this, searchString, ENDS_WITH);
- var endPosition = arguments.length > 1 ? arguments[1] : undefined;
- var len = toLength(that.length);
- var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
- var search = String(searchString);
- return $endsWith
- ? $endsWith.call(that, search, end)
- : that.slice(end - search.length, end) === search;
- }
- });
- /***/ }),
- /***/ 45177:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.6 String.prototype.fixed()
- __webpack_require__(29395)('fixed', function (createHTML) {
- return function fixed() {
- return createHTML(this, 'tt', '', '');
- };
- });
- /***/ }),
- /***/ 73694:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.7 String.prototype.fontcolor(color)
- __webpack_require__(29395)('fontcolor', function (createHTML) {
- return function fontcolor(color) {
- return createHTML(this, 'font', 'color', color);
- };
- });
- /***/ }),
- /***/ 37648:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.8 String.prototype.fontsize(size)
- __webpack_require__(29395)('fontsize', function (createHTML) {
- return function fontsize(size) {
- return createHTML(this, 'font', 'size', size);
- };
- });
- /***/ }),
- /***/ 50191:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- var toAbsoluteIndex = __webpack_require__(92337);
- var fromCharCode = String.fromCharCode;
- var $fromCodePoint = String.fromCodePoint;
- // length should be 1, old FF problem
- $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
- // 21.1.2.2 String.fromCodePoint(...codePoints)
- fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
- var res = [];
- var aLen = arguments.length;
- var i = 0;
- var code;
- while (aLen > i) {
- code = +arguments[i++];
- if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
- res.push(code < 0x10000
- ? fromCharCode(code)
- : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
- );
- } return res.join('');
- }
- });
- /***/ }),
- /***/ 62850:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 21.1.3.7 String.prototype.includes(searchString, position = 0)
- var $export = __webpack_require__(42985);
- var context = __webpack_require__(42094);
- var INCLUDES = 'includes';
- $export($export.P + $export.F * __webpack_require__(8852)(INCLUDES), 'String', {
- includes: function includes(searchString /* , position = 0 */) {
- return !!~context(this, searchString, INCLUDES)
- .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ 27795:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.9 String.prototype.italics()
- __webpack_require__(29395)('italics', function (createHTML) {
- return function italics() {
- return createHTML(this, 'i', '', '');
- };
- });
- /***/ }),
- /***/ 39115:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $at = __webpack_require__(24496)(true);
- // 21.1.3.27 String.prototype[@@iterator]()
- __webpack_require__(42923)(String, 'String', function (iterated) {
- this._t = String(iterated); // target
- this._i = 0; // next index
- // 21.1.5.2.1 %StringIteratorPrototype%.next()
- }, function () {
- var O = this._t;
- var index = this._i;
- var point;
- if (index >= O.length) return { value: undefined, done: true };
- point = $at(O, index);
- this._i += point.length;
- return { value: point, done: false };
- });
- /***/ }),
- /***/ 4531:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.10 String.prototype.link(url)
- __webpack_require__(29395)('link', function (createHTML) {
- return function link(url) {
- return createHTML(this, 'a', 'href', url);
- };
- });
- /***/ }),
- /***/ 98306:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- var toIObject = __webpack_require__(22110);
- var toLength = __webpack_require__(10875);
- $export($export.S, 'String', {
- // 21.1.2.4 String.raw(callSite, ...substitutions)
- raw: function raw(callSite) {
- var tpl = toIObject(callSite.raw);
- var len = toLength(tpl.length);
- var aLen = arguments.length;
- var res = [];
- var i = 0;
- while (len > i) {
- res.push(String(tpl[i++]));
- if (i < aLen) res.push(String(arguments[i]));
- } return res.join('');
- }
- });
- /***/ }),
- /***/ 10823:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- $export($export.P, 'String', {
- // 21.1.3.13 String.prototype.repeat(count)
- repeat: __webpack_require__(68595)
- });
- /***/ }),
- /***/ 23605:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.11 String.prototype.small()
- __webpack_require__(29395)('small', function (createHTML) {
- return function small() {
- return createHTML(this, 'small', '', '');
- };
- });
- /***/ }),
- /***/ 17732:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
- var $export = __webpack_require__(42985);
- var toLength = __webpack_require__(10875);
- var context = __webpack_require__(42094);
- var STARTS_WITH = 'startsWith';
- var $startsWith = ''[STARTS_WITH];
- $export($export.P + $export.F * __webpack_require__(8852)(STARTS_WITH), 'String', {
- startsWith: function startsWith(searchString /* , position = 0 */) {
- var that = context(this, searchString, STARTS_WITH);
- var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
- var search = String(searchString);
- return $startsWith
- ? $startsWith.call(that, search, index)
- : that.slice(index, index + search.length) === search;
- }
- });
- /***/ }),
- /***/ 6780:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.12 String.prototype.strike()
- __webpack_require__(29395)('strike', function (createHTML) {
- return function strike() {
- return createHTML(this, 'strike', '', '');
- };
- });
- /***/ }),
- /***/ 69937:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.13 String.prototype.sub()
- __webpack_require__(29395)('sub', function (createHTML) {
- return function sub() {
- return createHTML(this, 'sub', '', '');
- };
- });
- /***/ }),
- /***/ 10511:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // B.2.3.14 String.prototype.sup()
- __webpack_require__(29395)('sup', function (createHTML) {
- return function sup() {
- return createHTML(this, 'sup', '', '');
- };
- });
- /***/ }),
- /***/ 64564:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // 21.1.3.25 String.prototype.trim()
- __webpack_require__(29599)('trim', function ($trim) {
- return function trim() {
- return $trim(this, 3);
- };
- });
- /***/ }),
- /***/ 95767:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // ECMAScript 6 symbols shim
- var global = __webpack_require__(3816);
- var has = __webpack_require__(79181);
- var DESCRIPTORS = __webpack_require__(67057);
- var $export = __webpack_require__(42985);
- var redefine = __webpack_require__(77234);
- var META = (__webpack_require__(84728).KEY);
- var $fails = __webpack_require__(74253);
- var shared = __webpack_require__(3825);
- var setToStringTag = __webpack_require__(22943);
- var uid = __webpack_require__(93953);
- var wks = __webpack_require__(86314);
- var wksExt = __webpack_require__(28787);
- var wksDefine = __webpack_require__(36074);
- var enumKeys = __webpack_require__(5541);
- var isArray = __webpack_require__(4302);
- var anObject = __webpack_require__(27007);
- var isObject = __webpack_require__(55286);
- var toObject = __webpack_require__(20508);
- var toIObject = __webpack_require__(22110);
- var toPrimitive = __webpack_require__(21689);
- var createDesc = __webpack_require__(90681);
- var _create = __webpack_require__(42503);
- var gOPNExt = __webpack_require__(39327);
- var $GOPD = __webpack_require__(18693);
- var $GOPS = __webpack_require__(64548);
- var $DP = __webpack_require__(99275);
- var $keys = __webpack_require__(47184);
- var gOPD = $GOPD.f;
- var dP = $DP.f;
- var gOPN = gOPNExt.f;
- var $Symbol = global.Symbol;
- var $JSON = global.JSON;
- var _stringify = $JSON && $JSON.stringify;
- var PROTOTYPE = 'prototype';
- var HIDDEN = wks('_hidden');
- var TO_PRIMITIVE = wks('toPrimitive');
- var isEnum = {}.propertyIsEnumerable;
- var SymbolRegistry = shared('symbol-registry');
- var AllSymbols = shared('symbols');
- var OPSymbols = shared('op-symbols');
- var ObjectProto = Object[PROTOTYPE];
- var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
- var QObject = global.QObject;
- // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
- var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
- // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
- var setSymbolDesc = DESCRIPTORS && $fails(function () {
- return _create(dP({}, 'a', {
- get: function () { return dP(this, 'a', { value: 7 }).a; }
- })).a != 7;
- }) ? function (it, key, D) {
- var protoDesc = gOPD(ObjectProto, key);
- if (protoDesc) delete ObjectProto[key];
- dP(it, key, D);
- if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
- } : dP;
- var wrap = function (tag) {
- var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
- sym._k = tag;
- return sym;
- };
- var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
- return typeof it == 'symbol';
- } : function (it) {
- return it instanceof $Symbol;
- };
- var $defineProperty = function defineProperty(it, key, D) {
- if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
- anObject(it);
- key = toPrimitive(key, true);
- anObject(D);
- if (has(AllSymbols, key)) {
- if (!D.enumerable) {
- if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
- it[HIDDEN][key] = true;
- } else {
- if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
- D = _create(D, { enumerable: createDesc(0, false) });
- } return setSymbolDesc(it, key, D);
- } return dP(it, key, D);
- };
- var $defineProperties = function defineProperties(it, P) {
- anObject(it);
- var keys = enumKeys(P = toIObject(P));
- var i = 0;
- var l = keys.length;
- var key;
- while (l > i) $defineProperty(it, key = keys[i++], P[key]);
- return it;
- };
- var $create = function create(it, P) {
- return P === undefined ? _create(it) : $defineProperties(_create(it), P);
- };
- var $propertyIsEnumerable = function propertyIsEnumerable(key) {
- var E = isEnum.call(this, key = toPrimitive(key, true));
- if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
- return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
- };
- var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
- it = toIObject(it);
- key = toPrimitive(key, true);
- if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
- var D = gOPD(it, key);
- if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
- return D;
- };
- var $getOwnPropertyNames = function getOwnPropertyNames(it) {
- var names = gOPN(toIObject(it));
- var result = [];
- var i = 0;
- var key;
- while (names.length > i) {
- if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
- } return result;
- };
- var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
- var IS_OP = it === ObjectProto;
- var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
- var result = [];
- var i = 0;
- var key;
- while (names.length > i) {
- if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
- } return result;
- };
- // 19.4.1.1 Symbol([description])
- if (!USE_NATIVE) {
- $Symbol = function Symbol() {
- if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
- var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
- var $set = function (value) {
- if (this === ObjectProto) $set.call(OPSymbols, value);
- if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
- setSymbolDesc(this, tag, createDesc(1, value));
- };
- if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
- return wrap(tag);
- };
- redefine($Symbol[PROTOTYPE], 'toString', function toString() {
- return this._k;
- });
- $GOPD.f = $getOwnPropertyDescriptor;
- $DP.f = $defineProperty;
- (__webpack_require__(20616).f) = gOPNExt.f = $getOwnPropertyNames;
- (__webpack_require__(14682).f) = $propertyIsEnumerable;
- $GOPS.f = $getOwnPropertySymbols;
- if (DESCRIPTORS && !__webpack_require__(4461)) {
- redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
- }
- wksExt.f = function (name) {
- return wrap(wks(name));
- };
- }
- $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
- for (var es6Symbols = (
- // 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
- 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
- ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
- for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
- $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
- // 19.4.2.1 Symbol.for(key)
- 'for': function (key) {
- return has(SymbolRegistry, key += '')
- ? SymbolRegistry[key]
- : SymbolRegistry[key] = $Symbol(key);
- },
- // 19.4.2.5 Symbol.keyFor(sym)
- keyFor: function keyFor(sym) {
- if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
- for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
- },
- useSetter: function () { setter = true; },
- useSimple: function () { setter = false; }
- });
- $export($export.S + $export.F * !USE_NATIVE, 'Object', {
- // 19.1.2.2 Object.create(O [, Properties])
- create: $create,
- // 19.1.2.4 Object.defineProperty(O, P, Attributes)
- defineProperty: $defineProperty,
- // 19.1.2.3 Object.defineProperties(O, Properties)
- defineProperties: $defineProperties,
- // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
- getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
- // 19.1.2.7 Object.getOwnPropertyNames(O)
- getOwnPropertyNames: $getOwnPropertyNames,
- // 19.1.2.8 Object.getOwnPropertySymbols(O)
- getOwnPropertySymbols: $getOwnPropertySymbols
- });
- // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
- // https://bugs.chromium.org/p/v8/issues/detail?id=3443
- var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
- $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
- getOwnPropertySymbols: function getOwnPropertySymbols(it) {
- return $GOPS.f(toObject(it));
- }
- });
- // 24.3.2 JSON.stringify(value [, replacer [, space]])
- $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
- var S = $Symbol();
- // MS Edge converts symbol values to JSON as {}
- // WebKit converts symbol values to JSON as null
- // V8 throws on boxed symbols
- return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
- })), 'JSON', {
- stringify: function stringify(it) {
- var args = [it];
- var i = 1;
- var replacer, $replacer;
- while (arguments.length > i) args.push(arguments[i++]);
- $replacer = replacer = args[1];
- if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
- if (!isArray(replacer)) replacer = function (key, value) {
- if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
- if (!isSymbol(value)) return value;
- };
- args[1] = replacer;
- return _stringify.apply($JSON, args);
- }
- });
- // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
- $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(87728)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
- // 19.4.3.5 Symbol.prototype[@@toStringTag]
- setToStringTag($Symbol, 'Symbol');
- // 20.2.1.9 Math[@@toStringTag]
- setToStringTag(Math, 'Math', true);
- // 24.3.3 JSON[@@toStringTag]
- setToStringTag(global.JSON, 'JSON', true);
- /***/ }),
- /***/ 30142:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var $export = __webpack_require__(42985);
- var $typed = __webpack_require__(89383);
- var buffer = __webpack_require__(91125);
- var anObject = __webpack_require__(27007);
- var toAbsoluteIndex = __webpack_require__(92337);
- var toLength = __webpack_require__(10875);
- var isObject = __webpack_require__(55286);
- var ArrayBuffer = (__webpack_require__(3816).ArrayBuffer);
- var speciesConstructor = __webpack_require__(58364);
- var $ArrayBuffer = buffer.ArrayBuffer;
- var $DataView = buffer.DataView;
- var $isView = $typed.ABV && ArrayBuffer.isView;
- var $slice = $ArrayBuffer.prototype.slice;
- var VIEW = $typed.VIEW;
- var ARRAY_BUFFER = 'ArrayBuffer';
- $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });
- $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
- // 24.1.3.1 ArrayBuffer.isView(arg)
- isView: function isView(it) {
- return $isView && $isView(it) || isObject(it) && VIEW in it;
- }
- });
- $export($export.P + $export.U + $export.F * __webpack_require__(74253)(function () {
- return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
- }), ARRAY_BUFFER, {
- // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
- slice: function slice(start, end) {
- if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix
- var len = anObject(this).byteLength;
- var first = toAbsoluteIndex(start, len);
- var fin = toAbsoluteIndex(end === undefined ? len : end, len);
- var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));
- var viewS = new $DataView(this);
- var viewT = new $DataView(result);
- var index = 0;
- while (first < fin) {
- viewT.setUint8(index++, viewS.getUint8(first++));
- } return result;
- }
- });
- __webpack_require__(2974)(ARRAY_BUFFER);
- /***/ }),
- /***/ 1786:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- $export($export.G + $export.W + $export.F * !(__webpack_require__(89383).ABV), {
- DataView: (__webpack_require__(91125).DataView)
- });
- /***/ }),
- /***/ 70162:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(78440)('Float32', 4, function (init) {
- return function Float32Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ 33834:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(78440)('Float64', 8, function (init) {
- return function Float64Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ 74821:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(78440)('Int16', 2, function (init) {
- return function Int16Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ 81303:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(78440)('Int32', 4, function (init) {
- return function Int32Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ 75368:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(78440)('Int8', 1, function (init) {
- return function Int8Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ 79103:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(78440)('Uint16', 2, function (init) {
- return function Uint16Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ 83318:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(78440)('Uint32', 4, function (init) {
- return function Uint32Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ 46964:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(78440)('Uint8', 1, function (init) {
- return function Uint8Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ 62152:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(78440)('Uint8', 1, function (init) {
- return function Uint8ClampedArray(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- }, true);
- /***/ }),
- /***/ 30147:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var global = __webpack_require__(3816);
- var each = __webpack_require__(10050)(0);
- var redefine = __webpack_require__(77234);
- var meta = __webpack_require__(84728);
- var assign = __webpack_require__(35345);
- var weak = __webpack_require__(23657);
- var isObject = __webpack_require__(55286);
- var validate = __webpack_require__(1616);
- var NATIVE_WEAK_MAP = __webpack_require__(1616);
- var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
- var WEAK_MAP = 'WeakMap';
- var getWeak = meta.getWeak;
- var isExtensible = Object.isExtensible;
- var uncaughtFrozenStore = weak.ufstore;
- var InternalMap;
- var wrapper = function (get) {
- return function WeakMap() {
- return get(this, arguments.length > 0 ? arguments[0] : undefined);
- };
- };
- var methods = {
- // 23.3.3.3 WeakMap.prototype.get(key)
- get: function get(key) {
- if (isObject(key)) {
- var data = getWeak(key);
- if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
- return data ? data[this._i] : undefined;
- }
- },
- // 23.3.3.5 WeakMap.prototype.set(key, value)
- set: function set(key, value) {
- return weak.def(validate(this, WEAK_MAP), key, value);
- }
- };
- // 23.3 WeakMap Objects
- var $WeakMap = module.exports = __webpack_require__(45795)(WEAK_MAP, wrapper, methods, weak, true, true);
- // IE11 WeakMap frozen keys fix
- if (NATIVE_WEAK_MAP && IS_IE11) {
- InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
- assign(InternalMap.prototype, methods);
- meta.NEED = true;
- each(['delete', 'has', 'get', 'set'], function (key) {
- var proto = $WeakMap.prototype;
- var method = proto[key];
- redefine(proto, key, function (a, b) {
- // store frozen objects on internal weakmap shim
- if (isObject(a) && !isExtensible(a)) {
- if (!this._f) this._f = new InternalMap();
- var result = this._f[key](a, b);
- return key == 'set' ? this : result;
- // store all the rest on native weakmap
- } return method.call(this, a, b);
- });
- });
- }
- /***/ }),
- /***/ 59192:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var weak = __webpack_require__(23657);
- var validate = __webpack_require__(1616);
- var WEAK_SET = 'WeakSet';
- // 23.4 WeakSet Objects
- __webpack_require__(45795)(WEAK_SET, function (get) {
- return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
- }, {
- // 23.4.3.1 WeakSet.prototype.add(value)
- add: function add(value) {
- return weak.def(validate(this, WEAK_SET), value, true);
- }
- }, weak, false, true);
- /***/ }),
- /***/ 1268:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
- var $export = __webpack_require__(42985);
- var flattenIntoArray = __webpack_require__(13325);
- var toObject = __webpack_require__(20508);
- var toLength = __webpack_require__(10875);
- var aFunction = __webpack_require__(24963);
- var arraySpeciesCreate = __webpack_require__(16886);
- $export($export.P, 'Array', {
- flatMap: function flatMap(callbackfn /* , thisArg */) {
- var O = toObject(this);
- var sourceLen, A;
- aFunction(callbackfn);
- sourceLen = toLength(O.length);
- A = arraySpeciesCreate(O, 0);
- flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);
- return A;
- }
- });
- __webpack_require__(17722)('flatMap');
- /***/ }),
- /***/ 62773:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // https://github.com/tc39/Array.prototype.includes
- var $export = __webpack_require__(42985);
- var $includes = __webpack_require__(79315)(true);
- $export($export.P, 'Array', {
- includes: function includes(el /* , fromIndex = 0 */) {
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- __webpack_require__(17722)('includes');
- /***/ }),
- /***/ 83276:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // https://github.com/tc39/proposal-object-values-entries
- var $export = __webpack_require__(42985);
- var $entries = __webpack_require__(51131)(true);
- $export($export.S, 'Object', {
- entries: function entries(it) {
- return $entries(it);
- }
- });
- /***/ }),
- /***/ 98351:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // https://github.com/tc39/proposal-object-getownpropertydescriptors
- var $export = __webpack_require__(42985);
- var ownKeys = __webpack_require__(57643);
- var toIObject = __webpack_require__(22110);
- var gOPD = __webpack_require__(18693);
- var createProperty = __webpack_require__(92811);
- $export($export.S, 'Object', {
- getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
- var O = toIObject(object);
- var getDesc = gOPD.f;
- var keys = ownKeys(O);
- var result = {};
- var i = 0;
- var key, desc;
- while (keys.length > i) {
- desc = getDesc(O, key = keys[i++]);
- if (desc !== undefined) createProperty(result, key, desc);
- }
- return result;
- }
- });
- /***/ }),
- /***/ 96409:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // https://github.com/tc39/proposal-object-values-entries
- var $export = __webpack_require__(42985);
- var $values = __webpack_require__(51131)(false);
- $export($export.S, 'Object', {
- values: function values(it) {
- return $values(it);
- }
- });
- /***/ }),
- /***/ 9865:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // https://github.com/tc39/proposal-promise-finally
- var $export = __webpack_require__(42985);
- var core = __webpack_require__(25645);
- var global = __webpack_require__(3816);
- var speciesConstructor = __webpack_require__(58364);
- var promiseResolve = __webpack_require__(50094);
- $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
- var C = speciesConstructor(this, core.Promise || global.Promise);
- var isFunction = typeof onFinally == 'function';
- return this.then(
- isFunction ? function (x) {
- return promiseResolve(C, onFinally()).then(function () { return x; });
- } : onFinally,
- isFunction ? function (e) {
- return promiseResolve(C, onFinally()).then(function () { throw e; });
- } : onFinally
- );
- } });
- /***/ }),
- /***/ 92770:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // https://github.com/tc39/proposal-string-pad-start-end
- var $export = __webpack_require__(42985);
- var $pad = __webpack_require__(75442);
- var userAgent = __webpack_require__(30575);
- // https://github.com/zloirock/core-js/issues/280
- var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
- $export($export.P + $export.F * WEBKIT_BUG, 'String', {
- padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
- return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
- }
- });
- /***/ }),
- /***/ 41784:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // https://github.com/tc39/proposal-string-pad-start-end
- var $export = __webpack_require__(42985);
- var $pad = __webpack_require__(75442);
- var userAgent = __webpack_require__(30575);
- // https://github.com/zloirock/core-js/issues/280
- var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
- $export($export.P + $export.F * WEBKIT_BUG, 'String', {
- padStart: function padStart(maxLength /* , fillString = ' ' */) {
- return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
- }
- });
- /***/ }),
- /***/ 65869:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // https://github.com/sebmarkbage/ecmascript-string-left-right-trim
- __webpack_require__(29599)('trimLeft', function ($trim) {
- return function trimLeft() {
- return $trim(this, 1);
- };
- }, 'trimStart');
- /***/ }),
- /***/ 94325:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- // https://github.com/sebmarkbage/ecmascript-string-left-right-trim
- __webpack_require__(29599)('trimRight', function ($trim) {
- return function trimRight() {
- return $trim(this, 2);
- };
- }, 'trimEnd');
- /***/ }),
- /***/ 79665:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(36074)('asyncIterator');
- /***/ }),
- /***/ 91181:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $iterators = __webpack_require__(56997);
- var getKeys = __webpack_require__(47184);
- var redefine = __webpack_require__(77234);
- var global = __webpack_require__(3816);
- var hide = __webpack_require__(87728);
- var Iterators = __webpack_require__(87234);
- var wks = __webpack_require__(86314);
- var ITERATOR = wks('iterator');
- var TO_STRING_TAG = wks('toStringTag');
- var ArrayValues = Iterators.Array;
- var DOMIterables = {
- CSSRuleList: true, // TODO: Not spec compliant, should be false.
- CSSStyleDeclaration: false,
- CSSValueList: false,
- ClientRectList: false,
- DOMRectList: false,
- DOMStringList: false,
- DOMTokenList: true,
- DataTransferItemList: false,
- FileList: false,
- HTMLAllCollection: false,
- HTMLCollection: false,
- HTMLFormElement: false,
- HTMLSelectElement: false,
- MediaList: true, // TODO: Not spec compliant, should be false.
- MimeTypeArray: false,
- NamedNodeMap: false,
- NodeList: true,
- PaintRequestList: false,
- Plugin: false,
- PluginArray: false,
- SVGLengthList: false,
- SVGNumberList: false,
- SVGPathSegList: false,
- SVGPointList: false,
- SVGStringList: false,
- SVGTransformList: false,
- SourceBufferList: false,
- StyleSheetList: true, // TODO: Not spec compliant, should be false.
- TextTrackCueList: false,
- TextTrackList: false,
- TouchList: false
- };
- for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
- var NAME = collections[i];
- var explicit = DOMIterables[NAME];
- var Collection = global[NAME];
- var proto = Collection && Collection.prototype;
- var key;
- if (proto) {
- if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
- if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
- Iterators[NAME] = ArrayValues;
- if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
- }
- }
- /***/ }),
- /***/ 84633:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- var $export = __webpack_require__(42985);
- var $task = __webpack_require__(74193);
- $export($export.G + $export.B, {
- setImmediate: $task.set,
- clearImmediate: $task.clear
- });
- /***/ }),
- /***/ 32564:
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- // ie9- setTimeout & setInterval additional parameters fix
- var global = __webpack_require__(3816);
- var $export = __webpack_require__(42985);
- var userAgent = __webpack_require__(30575);
- var slice = [].slice;
- var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
- var wrap = function (set) {
- return function (fn, time /* , ...args */) {
- var boundArgs = arguments.length > 2;
- var args = boundArgs ? slice.call(arguments, 2) : false;
- return set(boundArgs ? function () {
- // eslint-disable-next-line no-new-func
- (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);
- } : fn, time);
- };
- };
- $export($export.G + $export.B + $export.F * MSIE, {
- setTimeout: wrap(global.setTimeout),
- setInterval: wrap(global.setInterval)
- });
- /***/ }),
- /***/ 96337:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- __webpack_require__(32564);
- __webpack_require__(84633);
- __webpack_require__(91181);
- module.exports = __webpack_require__(25645);
- /***/ }),
- /***/ 39735:
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8081);
- /* harmony import */ var _css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23645);
- /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(61667);
- /* harmony import */ var _css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2__);
- // Imports
- var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require__(17735), __webpack_require__.b);
- var ___CSS_LOADER_URL_IMPORT_1___ = new URL(/* asset import */ __webpack_require__(56089), __webpack_require__.b);
- var ___CSS_LOADER_URL_IMPORT_2___ = new URL(/* asset import */ __webpack_require__(46050), __webpack_require__.b);
- var ___CSS_LOADER_URL_IMPORT_3___ = new URL(/* asset import */ __webpack_require__(71090), __webpack_require__.b);
- var ___CSS_LOADER_URL_IMPORT_4___ = new URL(/* asset import */ __webpack_require__(96192), __webpack_require__.b);
- var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
- var ___CSS_LOADER_URL_REPLACEMENT_0___ = _css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___);
- var ___CSS_LOADER_URL_REPLACEMENT_1___ = _css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_1___);
- var ___CSS_LOADER_URL_REPLACEMENT_2___ = _css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_2___);
- var ___CSS_LOADER_URL_REPLACEMENT_3___ = _css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_3___);
- var ___CSS_LOADER_URL_REPLACEMENT_4___ = _css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_4___);
- // Module
- ___CSS_LOADER_EXPORT___.push([module.id, "/* The lint marker gutter */\n.CodeMirror-lint-markers {\n width: 16px;\n}\n\n.CodeMirror-lint-tooltip {\n background-color: #ffd;\n border: 1px solid black;\n border-radius: 4px 4px 4px 4px;\n color: black;\n font-family: monospace;\n font-size: 10pt;\n overflow: hidden;\n padding: 2px 5px;\n position: fixed;\n white-space: pre;\n white-space: pre-wrap;\n z-index: 100;\n max-width: 600px;\n opacity: 0;\n transition: opacity .4s;\n -moz-transition: opacity .4s;\n -webkit-transition: opacity .4s;\n -o-transition: opacity .4s;\n -ms-transition: opacity .4s;\n}\n\n.CodeMirror-lint-mark {\n background-position: left bottom;\n background-repeat: repeat-x;\n}\n\n.CodeMirror-lint-mark-warning {\n background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ");\n}\n\n.CodeMirror-lint-mark-error {\n background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_1___ + ");\n}\n\n.CodeMirror-lint-marker {\n background-position: center center;\n background-repeat: no-repeat;\n cursor: pointer;\n display: inline-block;\n height: 16px;\n width: 16px;\n vertical-align: middle;\n position: relative;\n}\n\n.CodeMirror-lint-message {\n padding-left: 18px;\n background-position: top left;\n background-repeat: no-repeat;\n}\n\n.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {\n background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_2___ + ");\n}\n\n.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {\n background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_3___ + ");\n}\n\n.CodeMirror-lint-marker-multiple {\n background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_4___ + ");\n background-repeat: no-repeat;\n background-position: right bottom;\n width: 100%; height: 100%;\n}\n\n.CodeMirror-lint-line-error {\n background-color: rgba(183, 76, 81, 0.08);\n}\n\n.CodeMirror-lint-line-warning {\n background-color: rgba(255, 211, 0, 0.1);\n}\n", ""]);
- // Exports
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
- /***/ }),
- /***/ 23645:
- /***/ ((module) => {
- "use strict";
- /*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
- */
- module.exports = function (cssWithMappingToString) {
- var list = []; // return the list of modules as css string
- list.toString = function toString() {
- return this.map(function (item) {
- var content = "";
- var needLayer = typeof item[5] !== "undefined";
- if (item[4]) {
- content += "@supports (".concat(item[4], ") {");
- }
- if (item[2]) {
- content += "@media ".concat(item[2], " {");
- }
- if (needLayer) {
- content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
- }
- content += cssWithMappingToString(item);
- if (needLayer) {
- content += "}";
- }
- if (item[2]) {
- content += "}";
- }
- if (item[4]) {
- content += "}";
- }
- return content;
- }).join("");
- }; // import a list of modules into the list
- list.i = function i(modules, media, dedupe, supports, layer) {
- if (typeof modules === "string") {
- modules = [[null, modules, undefined]];
- }
- var alreadyImportedModules = {};
- if (dedupe) {
- for (var k = 0; k < this.length; k++) {
- var id = this[k][0];
- if (id != null) {
- alreadyImportedModules[id] = true;
- }
- }
- }
- for (var _k = 0; _k < modules.length; _k++) {
- var item = [].concat(modules[_k]);
- if (dedupe && alreadyImportedModules[item[0]]) {
- continue;
- }
- if (typeof layer !== "undefined") {
- if (typeof item[5] === "undefined") {
- item[5] = layer;
- } else {
- item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
- item[5] = layer;
- }
- }
- if (media) {
- if (!item[2]) {
- item[2] = media;
- } else {
- item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
- item[2] = media;
- }
- }
- if (supports) {
- if (!item[4]) {
- item[4] = "".concat(supports);
- } else {
- item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
- item[4] = supports;
- }
- }
- list.push(item);
- }
- };
- return list;
- };
- /***/ }),
- /***/ 61667:
- /***/ ((module) => {
- "use strict";
- module.exports = function (url, options) {
- if (!options) {
- options = {};
- }
- if (!url) {
- return url;
- }
- url = String(url.__esModule ? url.default : url); // If url is already wrapped in quotes, remove them
- if (/^['"].*['"]$/.test(url)) {
- url = url.slice(1, -1);
- }
- if (options.hash) {
- url += options.hash;
- } // Should url be wrapped?
- // See https://drafts.csswg.org/css-values-3/#urls
- if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) {
- return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, "\\n"), "\"");
- }
- return url;
- };
- /***/ }),
- /***/ 8081:
- /***/ ((module) => {
- "use strict";
- module.exports = function (i) {
- return i[1];
- };
- /***/ }),
- /***/ 20296:
- /***/ ((module) => {
- /**
- * Returns a function, that, as long as it continues to be invoked, will not
- * be triggered. The function will be called after it stops being called for
- * N milliseconds. If `immediate` is passed, trigger the function on the
- * leading edge, instead of the trailing. The function also has a property 'clear'
- * that is a function which will clear the timer to prevent previously scheduled executions.
- *
- * @source underscore.js
- * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
- * @param {Function} function to wrap
- * @param {Number} timeout in ms (`100`)
- * @param {Boolean} whether to execute at the beginning (`false`)
- * @api public
- */
- function debounce(func, wait, immediate){
- var timeout, args, context, timestamp, result;
- if (null == wait) wait = 100;
- function later() {
- var last = Date.now() - timestamp;
- if (last < wait && last >= 0) {
- timeout = setTimeout(later, wait - last);
- } else {
- timeout = null;
- if (!immediate) {
- result = func.apply(context, args);
- context = args = null;
- }
- }
- };
- var debounced = function(){
- context = this;
- args = arguments;
- timestamp = Date.now();
- var callNow = immediate && !timeout;
- if (!timeout) timeout = setTimeout(later, wait);
- if (callNow) {
- result = func.apply(context, args);
- context = args = null;
- }
- return result;
- };
- debounced.clear = function() {
- if (timeout) {
- clearTimeout(timeout);
- timeout = null;
- }
- };
-
- debounced.flush = function() {
- if (timeout) {
- result = func.apply(context, args);
- context = args = null;
-
- clearTimeout(timeout);
- timeout = null;
- }
- };
- return debounced;
- };
- // Adds compatibility for ES modules
- debounce.debounce = debounce;
- module.exports = debounce;
- /***/ }),
- /***/ 32025:
- /***/ ((module) => {
- (function webpackUniversalModuleDefinition(root, factory) {
- if(true)
- module.exports = factory();
- else { var i, a; }
- })(self, function() {
- return /******/ (function() { // webpackBootstrap
- /******/ var __webpack_modules__ = ({
- /***/ 3099:
- /***/ (function(module) {
- module.exports = function (it) {
- if (typeof it != 'function') {
- throw TypeError(String(it) + ' is not a function');
- } return it;
- };
- /***/ }),
- /***/ 6077:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_703__) {
- var isObject = __nested_webpack_require_703__(111);
- module.exports = function (it) {
- if (!isObject(it) && it !== null) {
- throw TypeError("Can't set " + String(it) + ' as a prototype');
- } return it;
- };
- /***/ }),
- /***/ 1223:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_1001__) {
- var wellKnownSymbol = __nested_webpack_require_1001__(5112);
- var create = __nested_webpack_require_1001__(30);
- var definePropertyModule = __nested_webpack_require_1001__(3070);
- var UNSCOPABLES = wellKnownSymbol('unscopables');
- var ArrayPrototype = Array.prototype;
- // Array.prototype[@@unscopables]
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
- definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
- configurable: true,
- value: create(null)
- });
- }
- // add a key to Array.prototype[@@unscopables]
- module.exports = function (key) {
- ArrayPrototype[UNSCOPABLES][key] = true;
- };
- /***/ }),
- /***/ 1530:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_1715__) {
- "use strict";
- var charAt = __nested_webpack_require_1715__(8710).charAt;
- // `AdvanceStringIndex` abstract operation
- // https://tc39.es/ecma262/#sec-advancestringindex
- module.exports = function (S, index, unicode) {
- return index + (unicode ? charAt(S, index).length : 1);
- };
- /***/ }),
- /***/ 5787:
- /***/ (function(module) {
- module.exports = function (it, Constructor, name) {
- if (!(it instanceof Constructor)) {
- throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
- } return it;
- };
- /***/ }),
- /***/ 9670:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_2317__) {
- var isObject = __nested_webpack_require_2317__(111);
- module.exports = function (it) {
- if (!isObject(it)) {
- throw TypeError(String(it) + ' is not an object');
- } return it;
- };
- /***/ }),
- /***/ 4019:
- /***/ (function(module) {
- module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';
- /***/ }),
- /***/ 260:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_2726__) {
- "use strict";
- var NATIVE_ARRAY_BUFFER = __nested_webpack_require_2726__(4019);
- var DESCRIPTORS = __nested_webpack_require_2726__(9781);
- var global = __nested_webpack_require_2726__(7854);
- var isObject = __nested_webpack_require_2726__(111);
- var has = __nested_webpack_require_2726__(6656);
- var classof = __nested_webpack_require_2726__(648);
- var createNonEnumerableProperty = __nested_webpack_require_2726__(8880);
- var redefine = __nested_webpack_require_2726__(1320);
- var defineProperty = __nested_webpack_require_2726__(3070).f;
- var getPrototypeOf = __nested_webpack_require_2726__(9518);
- var setPrototypeOf = __nested_webpack_require_2726__(7674);
- var wellKnownSymbol = __nested_webpack_require_2726__(5112);
- var uid = __nested_webpack_require_2726__(9711);
- var Int8Array = global.Int8Array;
- var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
- var Uint8ClampedArray = global.Uint8ClampedArray;
- var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
- var TypedArray = Int8Array && getPrototypeOf(Int8Array);
- var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
- var ObjectPrototype = Object.prototype;
- var isPrototypeOf = ObjectPrototype.isPrototypeOf;
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
- // Fixing native typed arrays in Opera Presto crashes the browser, see #595
- var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';
- var TYPED_ARRAY_TAG_REQIRED = false;
- var NAME;
- var TypedArrayConstructorsList = {
- Int8Array: 1,
- Uint8Array: 1,
- Uint8ClampedArray: 1,
- Int16Array: 2,
- Uint16Array: 2,
- Int32Array: 4,
- Uint32Array: 4,
- Float32Array: 4,
- Float64Array: 8
- };
- var BigIntArrayConstructorsList = {
- BigInt64Array: 8,
- BigUint64Array: 8
- };
- var isView = function isView(it) {
- if (!isObject(it)) return false;
- var klass = classof(it);
- return klass === 'DataView'
- || has(TypedArrayConstructorsList, klass)
- || has(BigIntArrayConstructorsList, klass);
- };
- var isTypedArray = function (it) {
- if (!isObject(it)) return false;
- var klass = classof(it);
- return has(TypedArrayConstructorsList, klass)
- || has(BigIntArrayConstructorsList, klass);
- };
- var aTypedArray = function (it) {
- if (isTypedArray(it)) return it;
- throw TypeError('Target is not a typed array');
- };
- var aTypedArrayConstructor = function (C) {
- if (setPrototypeOf) {
- if (isPrototypeOf.call(TypedArray, C)) return C;
- } else for (var ARRAY in TypedArrayConstructorsList) if (has(TypedArrayConstructorsList, NAME)) {
- var TypedArrayConstructor = global[ARRAY];
- if (TypedArrayConstructor && (C === TypedArrayConstructor || isPrototypeOf.call(TypedArrayConstructor, C))) {
- return C;
- }
- } throw TypeError('Target is not a typed array constructor');
- };
- var exportTypedArrayMethod = function (KEY, property, forced) {
- if (!DESCRIPTORS) return;
- if (forced) for (var ARRAY in TypedArrayConstructorsList) {
- var TypedArrayConstructor = global[ARRAY];
- if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) {
- delete TypedArrayConstructor.prototype[KEY];
- }
- }
- if (!TypedArrayPrototype[KEY] || forced) {
- redefine(TypedArrayPrototype, KEY, forced ? property
- : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property);
- }
- };
- var exportTypedArrayStaticMethod = function (KEY, property, forced) {
- var ARRAY, TypedArrayConstructor;
- if (!DESCRIPTORS) return;
- if (setPrototypeOf) {
- if (forced) for (ARRAY in TypedArrayConstructorsList) {
- TypedArrayConstructor = global[ARRAY];
- if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) {
- delete TypedArrayConstructor[KEY];
- }
- }
- if (!TypedArray[KEY] || forced) {
- // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
- try {
- return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY] || property);
- } catch (error) { /* empty */ }
- } else return;
- }
- for (ARRAY in TypedArrayConstructorsList) {
- TypedArrayConstructor = global[ARRAY];
- if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
- redefine(TypedArrayConstructor, KEY, property);
- }
- }
- };
- for (NAME in TypedArrayConstructorsList) {
- if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false;
- }
- // WebKit bug - typed arrays constructors prototype is Object.prototype
- if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) {
- // eslint-disable-next-line no-shadow -- safe
- TypedArray = function TypedArray() {
- throw TypeError('Incorrect invocation');
- };
- if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
- if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);
- }
- }
- if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
- TypedArrayPrototype = TypedArray.prototype;
- if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
- if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);
- }
- }
- // WebKit bug - one more object in Uint8ClampedArray prototype chain
- if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
- setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
- }
- if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) {
- TYPED_ARRAY_TAG_REQIRED = true;
- defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () {
- return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
- } });
- for (NAME in TypedArrayConstructorsList) if (global[NAME]) {
- createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);
- }
- }
- module.exports = {
- NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
- TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,
- aTypedArray: aTypedArray,
- aTypedArrayConstructor: aTypedArrayConstructor,
- exportTypedArrayMethod: exportTypedArrayMethod,
- exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
- isView: isView,
- isTypedArray: isTypedArray,
- TypedArray: TypedArray,
- TypedArrayPrototype: TypedArrayPrototype
- };
- /***/ }),
- /***/ 3331:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_8934__) {
- "use strict";
- var global = __nested_webpack_require_8934__(7854);
- var DESCRIPTORS = __nested_webpack_require_8934__(9781);
- var NATIVE_ARRAY_BUFFER = __nested_webpack_require_8934__(4019);
- var createNonEnumerableProperty = __nested_webpack_require_8934__(8880);
- var redefineAll = __nested_webpack_require_8934__(2248);
- var fails = __nested_webpack_require_8934__(7293);
- var anInstance = __nested_webpack_require_8934__(5787);
- var toInteger = __nested_webpack_require_8934__(9958);
- var toLength = __nested_webpack_require_8934__(7466);
- var toIndex = __nested_webpack_require_8934__(7067);
- var IEEE754 = __nested_webpack_require_8934__(1179);
- var getPrototypeOf = __nested_webpack_require_8934__(9518);
- var setPrototypeOf = __nested_webpack_require_8934__(7674);
- var getOwnPropertyNames = __nested_webpack_require_8934__(8006).f;
- var defineProperty = __nested_webpack_require_8934__(3070).f;
- var arrayFill = __nested_webpack_require_8934__(1285);
- var setToStringTag = __nested_webpack_require_8934__(8003);
- var InternalStateModule = __nested_webpack_require_8934__(9909);
- var getInternalState = InternalStateModule.get;
- var setInternalState = InternalStateModule.set;
- var ARRAY_BUFFER = 'ArrayBuffer';
- var DATA_VIEW = 'DataView';
- var PROTOTYPE = 'prototype';
- var WRONG_LENGTH = 'Wrong length';
- var WRONG_INDEX = 'Wrong index';
- var NativeArrayBuffer = global[ARRAY_BUFFER];
- var $ArrayBuffer = NativeArrayBuffer;
- var $DataView = global[DATA_VIEW];
- var $DataViewPrototype = $DataView && $DataView[PROTOTYPE];
- var ObjectPrototype = Object.prototype;
- var RangeError = global.RangeError;
- var packIEEE754 = IEEE754.pack;
- var unpackIEEE754 = IEEE754.unpack;
- var packInt8 = function (number) {
- return [number & 0xFF];
- };
- var packInt16 = function (number) {
- return [number & 0xFF, number >> 8 & 0xFF];
- };
- var packInt32 = function (number) {
- return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];
- };
- var unpackInt32 = function (buffer) {
- return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
- };
- var packFloat32 = function (number) {
- return packIEEE754(number, 23, 4);
- };
- var packFloat64 = function (number) {
- return packIEEE754(number, 52, 8);
- };
- var addGetter = function (Constructor, key) {
- defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } });
- };
- var get = function (view, count, index, isLittleEndian) {
- var intIndex = toIndex(index);
- var store = getInternalState(view);
- if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
- var bytes = getInternalState(store.buffer).bytes;
- var start = intIndex + store.byteOffset;
- var pack = bytes.slice(start, start + count);
- return isLittleEndian ? pack : pack.reverse();
- };
- var set = function (view, count, index, conversion, value, isLittleEndian) {
- var intIndex = toIndex(index);
- var store = getInternalState(view);
- if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
- var bytes = getInternalState(store.buffer).bytes;
- var start = intIndex + store.byteOffset;
- var pack = conversion(+value);
- for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];
- };
- if (!NATIVE_ARRAY_BUFFER) {
- $ArrayBuffer = function ArrayBuffer(length) {
- anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
- var byteLength = toIndex(length);
- setInternalState(this, {
- bytes: arrayFill.call(new Array(byteLength), 0),
- byteLength: byteLength
- });
- if (!DESCRIPTORS) this.byteLength = byteLength;
- };
- $DataView = function DataView(buffer, byteOffset, byteLength) {
- anInstance(this, $DataView, DATA_VIEW);
- anInstance(buffer, $ArrayBuffer, DATA_VIEW);
- var bufferLength = getInternalState(buffer).byteLength;
- var offset = toInteger(byteOffset);
- if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');
- byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
- if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
- setInternalState(this, {
- buffer: buffer,
- byteLength: byteLength,
- byteOffset: offset
- });
- if (!DESCRIPTORS) {
- this.buffer = buffer;
- this.byteLength = byteLength;
- this.byteOffset = offset;
- }
- };
- if (DESCRIPTORS) {
- addGetter($ArrayBuffer, 'byteLength');
- addGetter($DataView, 'buffer');
- addGetter($DataView, 'byteLength');
- addGetter($DataView, 'byteOffset');
- }
- redefineAll($DataView[PROTOTYPE], {
- getInt8: function getInt8(byteOffset) {
- return get(this, 1, byteOffset)[0] << 24 >> 24;
- },
- getUint8: function getUint8(byteOffset) {
- return get(this, 1, byteOffset)[0];
- },
- getInt16: function getInt16(byteOffset /* , littleEndian */) {
- var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);
- return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
- },
- getUint16: function getUint16(byteOffset /* , littleEndian */) {
- var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);
- return bytes[1] << 8 | bytes[0];
- },
- getInt32: function getInt32(byteOffset /* , littleEndian */) {
- return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined));
- },
- getUint32: function getUint32(byteOffset /* , littleEndian */) {
- return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0;
- },
- getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
- return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23);
- },
- getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
- return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52);
- },
- setInt8: function setInt8(byteOffset, value) {
- set(this, 1, byteOffset, packInt8, value);
- },
- setUint8: function setUint8(byteOffset, value) {
- set(this, 1, byteOffset, packInt8, value);
- },
- setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
- set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);
- },
- setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
- set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);
- },
- setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
- set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);
- },
- setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
- set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);
- },
- setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
- set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined);
- },
- setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
- set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined);
- }
- });
- } else {
- /* eslint-disable no-new -- required for testing */
- if (!fails(function () {
- NativeArrayBuffer(1);
- }) || !fails(function () {
- new NativeArrayBuffer(-1);
- }) || fails(function () {
- new NativeArrayBuffer();
- new NativeArrayBuffer(1.5);
- new NativeArrayBuffer(NaN);
- return NativeArrayBuffer.name != ARRAY_BUFFER;
- })) {
- /* eslint-enable no-new -- required for testing */
- $ArrayBuffer = function ArrayBuffer(length) {
- anInstance(this, $ArrayBuffer);
- return new NativeArrayBuffer(toIndex(length));
- };
- var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE];
- for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {
- if (!((key = keys[j++]) in $ArrayBuffer)) {
- createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);
- }
- }
- ArrayBufferPrototype.constructor = $ArrayBuffer;
- }
- // WebKit bug - the same parent prototype for typed arrays and data view
- if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) {
- setPrototypeOf($DataViewPrototype, ObjectPrototype);
- }
- // iOS Safari 7.x bug
- var testView = new $DataView(new $ArrayBuffer(2));
- var nativeSetInt8 = $DataViewPrototype.setInt8;
- testView.setInt8(0, 2147483648);
- testView.setInt8(1, 2147483649);
- if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, {
- setInt8: function setInt8(byteOffset, value) {
- nativeSetInt8.call(this, byteOffset, value << 24 >> 24);
- },
- setUint8: function setUint8(byteOffset, value) {
- nativeSetInt8.call(this, byteOffset, value << 24 >> 24);
- }
- }, { unsafe: true });
- }
- setToStringTag($ArrayBuffer, ARRAY_BUFFER);
- setToStringTag($DataView, DATA_VIEW);
- module.exports = {
- ArrayBuffer: $ArrayBuffer,
- DataView: $DataView
- };
- /***/ }),
- /***/ 1048:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_17881__) {
- "use strict";
- var toObject = __nested_webpack_require_17881__(7908);
- var toAbsoluteIndex = __nested_webpack_require_17881__(1400);
- var toLength = __nested_webpack_require_17881__(7466);
- var min = Math.min;
- // `Array.prototype.copyWithin` method implementation
- // https://tc39.es/ecma262/#sec-array.prototype.copywithin
- module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
- var O = toObject(this);
- var len = toLength(O.length);
- var to = toAbsoluteIndex(target, len);
- var from = toAbsoluteIndex(start, len);
- var end = arguments.length > 2 ? arguments[2] : undefined;
- var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
- var inc = 1;
- if (from < to && to < from + count) {
- inc = -1;
- from += count - 1;
- to += count - 1;
- }
- while (count-- > 0) {
- if (from in O) O[to] = O[from];
- else delete O[to];
- to += inc;
- from += inc;
- } return O;
- };
- /***/ }),
- /***/ 1285:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_18911__) {
- "use strict";
- var toObject = __nested_webpack_require_18911__(7908);
- var toAbsoluteIndex = __nested_webpack_require_18911__(1400);
- var toLength = __nested_webpack_require_18911__(7466);
- // `Array.prototype.fill` method implementation
- // https://tc39.es/ecma262/#sec-array.prototype.fill
- module.exports = function fill(value /* , start = 0, end = @length */) {
- var O = toObject(this);
- var length = toLength(O.length);
- var argumentsLength = arguments.length;
- var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
- var end = argumentsLength > 2 ? arguments[2] : undefined;
- var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
- while (endPos > index) O[index++] = value;
- return O;
- };
- /***/ }),
- /***/ 8533:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_19717__) {
- "use strict";
- var $forEach = __nested_webpack_require_19717__(2092).forEach;
- var arrayMethodIsStrict = __nested_webpack_require_19717__(9341);
- var STRICT_METHOD = arrayMethodIsStrict('forEach');
- // `Array.prototype.forEach` method implementation
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
- module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
- return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- } : [].forEach;
- /***/ }),
- /***/ 8457:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_20278__) {
- "use strict";
- var bind = __nested_webpack_require_20278__(9974);
- var toObject = __nested_webpack_require_20278__(7908);
- var callWithSafeIterationClosing = __nested_webpack_require_20278__(3411);
- var isArrayIteratorMethod = __nested_webpack_require_20278__(7659);
- var toLength = __nested_webpack_require_20278__(7466);
- var createProperty = __nested_webpack_require_20278__(6135);
- var getIteratorMethod = __nested_webpack_require_20278__(1246);
- // `Array.from` method implementation
- // https://tc39.es/ecma262/#sec-array.from
- module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
- var O = toObject(arrayLike);
- var C = typeof this == 'function' ? this : Array;
- var argumentsLength = arguments.length;
- var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- var iteratorMethod = getIteratorMethod(O);
- var index = 0;
- var length, result, step, iterator, next, value;
- if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
- // if the target is not iterable or it's an array with the default iterator - use a simple case
- if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
- iterator = iteratorMethod.call(O);
- next = iterator.next;
- result = new C();
- for (;!(step = next.call(iterator)).done; index++) {
- value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
- createProperty(result, index, value);
- }
- } else {
- length = toLength(O.length);
- result = new C(length);
- for (;length > index; index++) {
- value = mapping ? mapfn(O[index], index) : O[index];
- createProperty(result, index, value);
- }
- }
- result.length = index;
- return result;
- };
- /***/ }),
- /***/ 1318:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_22092__) {
- var toIndexedObject = __nested_webpack_require_22092__(5656);
- var toLength = __nested_webpack_require_22092__(7466);
- var toAbsoluteIndex = __nested_webpack_require_22092__(1400);
- // `Array.prototype.{ indexOf, includes }` methods implementation
- var createMethod = function (IS_INCLUDES) {
- return function ($this, el, fromIndex) {
- var O = toIndexedObject($this);
- var length = toLength(O.length);
- var index = toAbsoluteIndex(fromIndex, length);
- var value;
- // Array#includes uses SameValueZero equality algorithm
- // eslint-disable-next-line no-self-compare -- NaN check
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
- // eslint-disable-next-line no-self-compare -- NaN check
- if (value != value) return true;
- // Array#indexOf ignores holes, Array#includes - not
- } else for (;length > index; index++) {
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
- };
- module.exports = {
- // `Array.prototype.includes` method
- // https://tc39.es/ecma262/#sec-array.prototype.includes
- includes: createMethod(true),
- // `Array.prototype.indexOf` method
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
- indexOf: createMethod(false)
- };
- /***/ }),
- /***/ 2092:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_23446__) {
- var bind = __nested_webpack_require_23446__(9974);
- var IndexedObject = __nested_webpack_require_23446__(8361);
- var toObject = __nested_webpack_require_23446__(7908);
- var toLength = __nested_webpack_require_23446__(7466);
- var arraySpeciesCreate = __nested_webpack_require_23446__(5417);
- var push = [].push;
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
- var createMethod = function (TYPE) {
- var IS_MAP = TYPE == 1;
- var IS_FILTER = TYPE == 2;
- var IS_SOME = TYPE == 3;
- var IS_EVERY = TYPE == 4;
- var IS_FIND_INDEX = TYPE == 6;
- var IS_FILTER_OUT = TYPE == 7;
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- return function ($this, callbackfn, that, specificCreate) {
- var O = toObject($this);
- var self = IndexedObject(O);
- var boundFunction = bind(callbackfn, that, 3);
- var length = toLength(self.length);
- var index = 0;
- var create = specificCreate || arraySpeciesCreate;
- var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
- var value, result;
- for (;length > index; index++) if (NO_HOLES || index in self) {
- value = self[index];
- result = boundFunction(value, index, O);
- if (TYPE) {
- if (IS_MAP) target[index] = result; // map
- else if (result) switch (TYPE) {
- case 3: return true; // some
- case 5: return value; // find
- case 6: return index; // findIndex
- case 2: push.call(target, value); // filter
- } else switch (TYPE) {
- case 4: return false; // every
- case 7: push.call(target, value); // filterOut
- }
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
- };
- };
- module.exports = {
- // `Array.prototype.forEach` method
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
- forEach: createMethod(0),
- // `Array.prototype.map` method
- // https://tc39.es/ecma262/#sec-array.prototype.map
- map: createMethod(1),
- // `Array.prototype.filter` method
- // https://tc39.es/ecma262/#sec-array.prototype.filter
- filter: createMethod(2),
- // `Array.prototype.some` method
- // https://tc39.es/ecma262/#sec-array.prototype.some
- some: createMethod(3),
- // `Array.prototype.every` method
- // https://tc39.es/ecma262/#sec-array.prototype.every
- every: createMethod(4),
- // `Array.prototype.find` method
- // https://tc39.es/ecma262/#sec-array.prototype.find
- find: createMethod(5),
- // `Array.prototype.findIndex` method
- // https://tc39.es/ecma262/#sec-array.prototype.findIndex
- findIndex: createMethod(6),
- // `Array.prototype.filterOut` method
- // https://github.com/tc39/proposal-array-filtering
- filterOut: createMethod(7)
- };
- /***/ }),
- /***/ 6583:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_26271__) {
- "use strict";
- var toIndexedObject = __nested_webpack_require_26271__(5656);
- var toInteger = __nested_webpack_require_26271__(9958);
- var toLength = __nested_webpack_require_26271__(7466);
- var arrayMethodIsStrict = __nested_webpack_require_26271__(9341);
- var min = Math.min;
- var nativeLastIndexOf = [].lastIndexOf;
- var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
- var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
- var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
- // `Array.prototype.lastIndexOf` method implementation
- // https://tc39.es/ecma262/#sec-array.prototype.lastindexof
- module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
- // convert -0 to +0
- if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;
- var O = toIndexedObject(this);
- var length = toLength(O.length);
- var index = length - 1;
- if (arguments.length > 1) index = min(index, toInteger(arguments[1]));
- if (index < 0) index = length + index;
- for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
- return -1;
- } : nativeLastIndexOf;
- /***/ }),
- /***/ 1194:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_27452__) {
- var fails = __nested_webpack_require_27452__(7293);
- var wellKnownSymbol = __nested_webpack_require_27452__(5112);
- var V8_VERSION = __nested_webpack_require_27452__(7392);
- var SPECIES = wellKnownSymbol('species');
- module.exports = function (METHOD_NAME) {
- // We can't use this feature detection in V8 since it causes
- // deoptimization and serious performance degradation
- // https://github.com/zloirock/core-js/issues/677
- return V8_VERSION >= 51 || !fails(function () {
- var array = [];
- var constructor = array.constructor = {};
- constructor[SPECIES] = function () {
- return { foo: 1 };
- };
- return array[METHOD_NAME](Boolean).foo !== 1;
- });
- };
- /***/ }),
- /***/ 9341:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_28188__) {
- "use strict";
- var fails = __nested_webpack_require_28188__(7293);
- module.exports = function (METHOD_NAME, argument) {
- var method = [][METHOD_NAME];
- return !!method && fails(function () {
- // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
- method.call(null, argument || function () { throw 1; }, 1);
- });
- };
- /***/ }),
- /***/ 3671:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_28629__) {
- var aFunction = __nested_webpack_require_28629__(3099);
- var toObject = __nested_webpack_require_28629__(7908);
- var IndexedObject = __nested_webpack_require_28629__(8361);
- var toLength = __nested_webpack_require_28629__(7466);
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
- var createMethod = function (IS_RIGHT) {
- return function (that, callbackfn, argumentsLength, memo) {
- aFunction(callbackfn);
- var O = toObject(that);
- var self = IndexedObject(O);
- var length = toLength(O.length);
- var index = IS_RIGHT ? length - 1 : 0;
- var i = IS_RIGHT ? -1 : 1;
- if (argumentsLength < 2) while (true) {
- if (index in self) {
- memo = self[index];
- index += i;
- break;
- }
- index += i;
- if (IS_RIGHT ? index < 0 : length <= index) {
- throw TypeError('Reduce of empty array with no initial value');
- }
- }
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
- memo = callbackfn(memo, self[index], index, O);
- }
- return memo;
- };
- };
- module.exports = {
- // `Array.prototype.reduce` method
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
- left: createMethod(false),
- // `Array.prototype.reduceRight` method
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
- right: createMethod(true)
- };
- /***/ }),
- /***/ 5417:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_30017__) {
- var isObject = __nested_webpack_require_30017__(111);
- var isArray = __nested_webpack_require_30017__(3157);
- var wellKnownSymbol = __nested_webpack_require_30017__(5112);
- var SPECIES = wellKnownSymbol('species');
- // `ArraySpeciesCreate` abstract operation
- // https://tc39.es/ecma262/#sec-arrayspeciescreate
- module.exports = function (originalArray, length) {
- var C;
- if (isArray(originalArray)) {
- C = originalArray.constructor;
- // cross-realm fallback
- if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
- else if (isObject(C)) {
- C = C[SPECIES];
- if (C === null) C = undefined;
- }
- } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
- };
- /***/ }),
- /***/ 3411:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_30798__) {
- var anObject = __nested_webpack_require_30798__(9670);
- var iteratorClose = __nested_webpack_require_30798__(9212);
- // call something on iterator step with safe closing on error
- module.exports = function (iterator, fn, value, ENTRIES) {
- try {
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
- // 7.4.6 IteratorClose(iterator, completion)
- } catch (error) {
- iteratorClose(iterator);
- throw error;
- }
- };
- /***/ }),
- /***/ 7072:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_31303__) {
- var wellKnownSymbol = __nested_webpack_require_31303__(5112);
- var ITERATOR = wellKnownSymbol('iterator');
- var SAFE_CLOSING = false;
- try {
- var called = 0;
- var iteratorWithReturn = {
- next: function () {
- return { done: !!called++ };
- },
- 'return': function () {
- SAFE_CLOSING = true;
- }
- };
- iteratorWithReturn[ITERATOR] = function () {
- return this;
- };
- // eslint-disable-next-line no-throw-literal -- required for testing
- Array.from(iteratorWithReturn, function () { throw 2; });
- } catch (error) { /* empty */ }
- module.exports = function (exec, SKIP_CLOSING) {
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
- var ITERATION_SUPPORT = false;
- try {
- var object = {};
- object[ITERATOR] = function () {
- return {
- next: function () {
- return { done: ITERATION_SUPPORT = true };
- }
- };
- };
- exec(object);
- } catch (error) { /* empty */ }
- return ITERATION_SUPPORT;
- };
- /***/ }),
- /***/ 4326:
- /***/ (function(module) {
- var toString = {}.toString;
- module.exports = function (it) {
- return toString.call(it).slice(8, -1);
- };
- /***/ }),
- /***/ 648:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_32503__) {
- var TO_STRING_TAG_SUPPORT = __nested_webpack_require_32503__(1694);
- var classofRaw = __nested_webpack_require_32503__(4326);
- var wellKnownSymbol = __nested_webpack_require_32503__(5112);
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- // ES3 wrong here
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
- // fallback for IE11 Script Access Denied error
- var tryGet = function (it, key) {
- try {
- return it[key];
- } catch (error) { /* empty */ }
- };
- // getting tag from ES6+ `Object.prototype.toString`
- module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
- var O, tag, result;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
- // @@toStringTag case
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
- // builtinTag case
- : CORRECT_ARGUMENTS ? classofRaw(O)
- // ES3 arguments fallback
- : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
- };
- /***/ }),
- /***/ 9920:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_33565__) {
- var has = __nested_webpack_require_33565__(6656);
- var ownKeys = __nested_webpack_require_33565__(3887);
- var getOwnPropertyDescriptorModule = __nested_webpack_require_33565__(1236);
- var definePropertyModule = __nested_webpack_require_33565__(3070);
- module.exports = function (target, source) {
- var keys = ownKeys(source);
- var defineProperty = definePropertyModule.f;
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
- }
- };
- /***/ }),
- /***/ 8544:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_34217__) {
- var fails = __nested_webpack_require_34217__(7293);
- module.exports = !fails(function () {
- function F() { /* empty */ }
- F.prototype.constructor = null;
- return Object.getPrototypeOf(new F()) !== F.prototype;
- });
- /***/ }),
- /***/ 4994:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_34520__) {
- "use strict";
- var IteratorPrototype = __nested_webpack_require_34520__(3383).IteratorPrototype;
- var create = __nested_webpack_require_34520__(30);
- var createPropertyDescriptor = __nested_webpack_require_34520__(9114);
- var setToStringTag = __nested_webpack_require_34520__(8003);
- var Iterators = __nested_webpack_require_34520__(7497);
- var returnThis = function () { return this; };
- module.exports = function (IteratorConstructor, NAME, next) {
- var TO_STRING_TAG = NAME + ' Iterator';
- IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
- setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
- Iterators[TO_STRING_TAG] = returnThis;
- return IteratorConstructor;
- };
- /***/ }),
- /***/ 8880:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_35290__) {
- var DESCRIPTORS = __nested_webpack_require_35290__(9781);
- var definePropertyModule = __nested_webpack_require_35290__(3070);
- var createPropertyDescriptor = __nested_webpack_require_35290__(9114);
- module.exports = DESCRIPTORS ? function (object, key, value) {
- return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
- /***/ }),
- /***/ 9114:
- /***/ (function(module) {
- module.exports = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
- /***/ }),
- /***/ 6135:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_35996__) {
- "use strict";
- var toPrimitive = __nested_webpack_require_35996__(7593);
- var definePropertyModule = __nested_webpack_require_35996__(3070);
- var createPropertyDescriptor = __nested_webpack_require_35996__(9114);
- module.exports = function (object, key, value) {
- var propertyKey = toPrimitive(key);
- if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
- else object[propertyKey] = value;
- };
- /***/ }),
- /***/ 654:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_36503__) {
- "use strict";
- var $ = __nested_webpack_require_36503__(2109);
- var createIteratorConstructor = __nested_webpack_require_36503__(4994);
- var getPrototypeOf = __nested_webpack_require_36503__(9518);
- var setPrototypeOf = __nested_webpack_require_36503__(7674);
- var setToStringTag = __nested_webpack_require_36503__(8003);
- var createNonEnumerableProperty = __nested_webpack_require_36503__(8880);
- var redefine = __nested_webpack_require_36503__(1320);
- var wellKnownSymbol = __nested_webpack_require_36503__(5112);
- var IS_PURE = __nested_webpack_require_36503__(1913);
- var Iterators = __nested_webpack_require_36503__(7497);
- var IteratorsCore = __nested_webpack_require_36503__(3383);
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
- var ITERATOR = wellKnownSymbol('iterator');
- var KEYS = 'keys';
- var VALUES = 'values';
- var ENTRIES = 'entries';
- var returnThis = function () { return this; };
- module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
- createIteratorConstructor(IteratorConstructor, NAME, next);
- var getIterationMethod = function (KIND) {
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
- switch (KIND) {
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
- } return function () { return new IteratorConstructor(this); };
- };
- var TO_STRING_TAG = NAME + ' Iterator';
- var INCORRECT_VALUES_NAME = false;
- var IterablePrototype = Iterable.prototype;
- var nativeIterator = IterablePrototype[ITERATOR]
- || IterablePrototype['@@iterator']
- || DEFAULT && IterablePrototype[DEFAULT];
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
- var CurrentIteratorPrototype, methods, KEY;
- // fix native
- if (anyNativeIterator) {
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
- if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
- if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
- if (setPrototypeOf) {
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
- } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
- createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
- }
- }
- // Set @@toStringTag to native iterators
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
- if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
- }
- }
- // fix Array#{values, @@iterator}.name in V8 / FF
- if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
- INCORRECT_VALUES_NAME = true;
- defaultIterator = function values() { return nativeIterator.call(this); };
- }
- // define iterator
- if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
- createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
- }
- Iterators[NAME] = defaultIterator;
- // export additional methods
- if (DEFAULT) {
- methods = {
- values: getIterationMethod(VALUES),
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
- entries: getIterationMethod(ENTRIES)
- };
- if (FORCED) for (KEY in methods) {
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
- redefine(IterablePrototype, KEY, methods[KEY]);
- }
- } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
- }
- return methods;
- };
- /***/ }),
- /***/ 9781:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_40475__) {
- var fails = __nested_webpack_require_40475__(7293);
- // Detect IE8's incomplete defineProperty implementation
- module.exports = !fails(function () {
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
- });
- /***/ }),
- /***/ 317:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_40795__) {
- var global = __nested_webpack_require_40795__(7854);
- var isObject = __nested_webpack_require_40795__(111);
- var document = global.document;
- // typeof document.createElement is 'object' in old IE
- var EXISTS = isObject(document) && isObject(document.createElement);
- module.exports = function (it) {
- return EXISTS ? document.createElement(it) : {};
- };
- /***/ }),
- /***/ 8324:
- /***/ (function(module) {
- // iterable DOM collections
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
- module.exports = {
- CSSRuleList: 0,
- CSSStyleDeclaration: 0,
- CSSValueList: 0,
- ClientRectList: 0,
- DOMRectList: 0,
- DOMStringList: 0,
- DOMTokenList: 1,
- DataTransferItemList: 0,
- FileList: 0,
- HTMLAllCollection: 0,
- HTMLCollection: 0,
- HTMLFormElement: 0,
- HTMLSelectElement: 0,
- MediaList: 0,
- MimeTypeArray: 0,
- NamedNodeMap: 0,
- NodeList: 1,
- PaintRequestList: 0,
- Plugin: 0,
- PluginArray: 0,
- SVGLengthList: 0,
- SVGNumberList: 0,
- SVGPathSegList: 0,
- SVGPointList: 0,
- SVGStringList: 0,
- SVGTransformList: 0,
- SourceBufferList: 0,
- StyleSheetList: 0,
- TextTrackCueList: 0,
- TextTrackList: 0,
- TouchList: 0
- };
- /***/ }),
- /***/ 8113:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_42025__) {
- var getBuiltIn = __nested_webpack_require_42025__(5005);
- module.exports = getBuiltIn('navigator', 'userAgent') || '';
- /***/ }),
- /***/ 7392:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_42230__) {
- var global = __nested_webpack_require_42230__(7854);
- var userAgent = __nested_webpack_require_42230__(8113);
- var process = global.process;
- var versions = process && process.versions;
- var v8 = versions && versions.v8;
- var match, version;
- if (v8) {
- match = v8.split('.');
- version = match[0] + match[1];
- } else if (userAgent) {
- match = userAgent.match(/Edge\/(\d+)/);
- if (!match || match[1] >= 74) {
- match = userAgent.match(/Chrome\/(\d+)/);
- if (match) version = match[1];
- }
- }
- module.exports = version && +version;
- /***/ }),
- /***/ 748:
- /***/ (function(module) {
- // IE8- don't enum bug keys
- module.exports = [
- 'constructor',
- 'hasOwnProperty',
- 'isPrototypeOf',
- 'propertyIsEnumerable',
- 'toLocaleString',
- 'toString',
- 'valueOf'
- ];
- /***/ }),
- /***/ 2109:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_43065__) {
- var global = __nested_webpack_require_43065__(7854);
- var getOwnPropertyDescriptor = __nested_webpack_require_43065__(1236).f;
- var createNonEnumerableProperty = __nested_webpack_require_43065__(8880);
- var redefine = __nested_webpack_require_43065__(1320);
- var setGlobal = __nested_webpack_require_43065__(3505);
- var copyConstructorProperties = __nested_webpack_require_43065__(9920);
- var isForced = __nested_webpack_require_43065__(4705);
- /*
- options.target - name of the target object
- options.global - target is the global object
- options.stat - export as static methods of target
- options.proto - export as prototype methods of target
- options.real - real prototype method for the `pure` version
- options.forced - export even if the native feature is available
- options.bind - bind methods to the target, required for the `pure` version
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
- options.sham - add a flag to not completely full polyfills
- options.enumerable - export as enumerable property
- options.noTargetGet - prevent calling a getter on target
- */
- module.exports = function (options, source) {
- var TARGET = options.target;
- var GLOBAL = options.global;
- var STATIC = options.stat;
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
- if (GLOBAL) {
- target = global;
- } else if (STATIC) {
- target = global[TARGET] || setGlobal(TARGET, {});
- } else {
- target = (global[TARGET] || {}).prototype;
- }
- if (target) for (key in source) {
- sourceProperty = source[key];
- if (options.noTargetGet) {
- descriptor = getOwnPropertyDescriptor(target, key);
- targetProperty = descriptor && descriptor.value;
- } else targetProperty = target[key];
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
- // contained in target
- if (!FORCED && targetProperty !== undefined) {
- if (typeof sourceProperty === typeof targetProperty) continue;
- copyConstructorProperties(sourceProperty, targetProperty);
- }
- // add a flag to not completely full polyfills
- if (options.sham || (targetProperty && targetProperty.sham)) {
- createNonEnumerableProperty(sourceProperty, 'sham', true);
- }
- // extend global
- redefine(target, key, sourceProperty, options);
- }
- };
- /***/ }),
- /***/ 7293:
- /***/ (function(module) {
- module.exports = function (exec) {
- try {
- return !!exec();
- } catch (error) {
- return true;
- }
- };
- /***/ }),
- /***/ 7007:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_45726__) {
- "use strict";
- // TODO: Remove from `core-js@4` since it's moved to entry points
- __nested_webpack_require_45726__(4916);
- var redefine = __nested_webpack_require_45726__(1320);
- var fails = __nested_webpack_require_45726__(7293);
- var wellKnownSymbol = __nested_webpack_require_45726__(5112);
- var regexpExec = __nested_webpack_require_45726__(2261);
- var createNonEnumerableProperty = __nested_webpack_require_45726__(8880);
- var SPECIES = wellKnownSymbol('species');
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
- // #replace needs built-in support for named groups.
- // #match works fine because it just return the exec results, even if it has
- // a "grops" property.
- var re = /./;
- re.exec = function () {
- var result = [];
- result.groups = { a: '7' };
- return result;
- };
- return ''.replace(re, '$<a>') !== '7';
- });
- // IE <= 11 replaces $0 with the whole match, as if it was $&
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
- var REPLACE_KEEPS_$0 = (function () {
- return 'a'.replace(/./, '$0') === '$0';
- })();
- var REPLACE = wellKnownSymbol('replace');
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
- if (/./[REPLACE]) {
- return /./[REPLACE]('a', '$0') === '';
- }
- return false;
- })();
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
- var re = /(?:)/;
- var originalExec = re.exec;
- re.exec = function () { return originalExec.apply(this, arguments); };
- var result = 'ab'.split(re);
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
- });
- module.exports = function (KEY, length, exec, sham) {
- var SYMBOL = wellKnownSymbol(KEY);
- var DELEGATES_TO_SYMBOL = !fails(function () {
- // String methods call symbol-named RegEp methods
- var O = {};
- O[SYMBOL] = function () { return 7; };
- return ''[KEY](O) != 7;
- });
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
- // Symbol-named RegExp methods call .exec
- var execCalled = false;
- var re = /a/;
- if (KEY === 'split') {
- // We can't use real regex here since it causes deoptimization
- // and serious performance degradation in V8
- // https://github.com/zloirock/core-js/issues/306
- re = {};
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
- // a new one. We need to return the patched regex when creating the new one.
- re.constructor = {};
- re.constructor[SPECIES] = function () { return re; };
- re.flags = '';
- re[SYMBOL] = /./[SYMBOL];
- }
- re.exec = function () { execCalled = true; return null; };
- re[SYMBOL]('');
- return !execCalled;
- });
- if (
- !DELEGATES_TO_SYMBOL ||
- !DELEGATES_TO_EXEC ||
- (KEY === 'replace' && !(
- REPLACE_SUPPORTS_NAMED_GROUPS &&
- REPLACE_KEEPS_$0 &&
- !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
- )) ||
- (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
- ) {
- var nativeRegExpMethod = /./[SYMBOL];
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
- if (regexp.exec === regexpExec) {
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
- // The native String method already delegates to @@method (this
- // polyfilled function), leasing to infinite recursion.
- // We avoid it by directly calling the native @@method method.
- return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
- }
- return { done: true, value: nativeMethod.call(str, regexp, arg2) };
- }
- return { done: false };
- }, {
- REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
- REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
- });
- var stringMethod = methods[0];
- var regexMethod = methods[1];
- redefine(String.prototype, KEY, stringMethod);
- redefine(RegExp.prototype, SYMBOL, length == 2
- // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
- // 21.2.5.11 RegExp.prototype[@@split](string, limit)
- ? function (string, arg) { return regexMethod.call(string, this, arg); }
- // 21.2.5.6 RegExp.prototype[@@match](string)
- // 21.2.5.9 RegExp.prototype[@@search](string)
- : function (string) { return regexMethod.call(string, this); }
- );
- }
- if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
- };
- /***/ }),
- /***/ 9974:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_50488__) {
- var aFunction = __nested_webpack_require_50488__(3099);
- // optional / simple context binding
- module.exports = function (fn, that, length) {
- aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- case 0: return function () {
- return fn.call(that);
- };
- case 1: return function (a) {
- return fn.call(that, a);
- };
- case 2: return function (a, b) {
- return fn.call(that, a, b);
- };
- case 3: return function (a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function (/* ...args */) {
- return fn.apply(that, arguments);
- };
- };
- /***/ }),
- /***/ 5005:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_51177__) {
- var path = __nested_webpack_require_51177__(857);
- var global = __nested_webpack_require_51177__(7854);
- var aFunction = function (variable) {
- return typeof variable == 'function' ? variable : undefined;
- };
- module.exports = function (namespace, method) {
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
- : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
- };
- /***/ }),
- /***/ 1246:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_51701__) {
- var classof = __nested_webpack_require_51701__(648);
- var Iterators = __nested_webpack_require_51701__(7497);
- var wellKnownSymbol = __nested_webpack_require_51701__(5112);
- var ITERATOR = wellKnownSymbol('iterator');
- module.exports = function (it) {
- if (it != undefined) return it[ITERATOR]
- || it['@@iterator']
- || Iterators[classof(it)];
- };
- /***/ }),
- /***/ 8554:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_52112__) {
- var anObject = __nested_webpack_require_52112__(9670);
- var getIteratorMethod = __nested_webpack_require_52112__(1246);
- module.exports = function (it) {
- var iteratorMethod = getIteratorMethod(it);
- if (typeof iteratorMethod != 'function') {
- throw TypeError(String(it) + ' is not iterable');
- } return anObject(iteratorMethod.call(it));
- };
- /***/ }),
- /***/ 647:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_52531__) {
- var toObject = __nested_webpack_require_52531__(7908);
- var floor = Math.floor;
- var replace = ''.replace;
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
- // https://tc39.es/ecma262/#sec-getsubstitution
- module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
- var tailPos = position + matched.length;
- var m = captures.length;
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
- if (namedCaptures !== undefined) {
- namedCaptures = toObject(namedCaptures);
- symbols = SUBSTITUTION_SYMBOLS;
- }
- return replace.call(replacement, symbols, function (match, ch) {
- var capture;
- switch (ch.charAt(0)) {
- case '$': return '$';
- case '&': return matched;
- case '`': return str.slice(0, position);
- case "'": return str.slice(tailPos);
- case '<':
- capture = namedCaptures[ch.slice(1, -1)];
- break;
- default: // \d\d?
- var n = +ch;
- if (n === 0) return match;
- if (n > m) {
- var f = floor(n / 10);
- if (f === 0) return match;
- if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
- return match;
- }
- capture = captures[n - 1];
- }
- return capture === undefined ? '' : capture;
- });
- };
- /***/ }),
- /***/ 7854:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_53970__) {
- var check = function (it) {
- return it && it.Math == Math && it;
- };
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- module.exports =
- /* global globalThis -- safe */
- check(typeof globalThis == 'object' && globalThis) ||
- check(typeof window == 'object' && window) ||
- check(typeof self == 'object' && self) ||
- check(typeof __nested_webpack_require_53970__.g == 'object' && __nested_webpack_require_53970__.g) ||
- // eslint-disable-next-line no-new-func -- fallback
- (function () { return this; })() || Function('return this')();
- /***/ }),
- /***/ 6656:
- /***/ (function(module) {
- var hasOwnProperty = {}.hasOwnProperty;
- module.exports = function (it, key) {
- return hasOwnProperty.call(it, key);
- };
- /***/ }),
- /***/ 3501:
- /***/ (function(module) {
- module.exports = {};
- /***/ }),
- /***/ 490:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_54852__) {
- var getBuiltIn = __nested_webpack_require_54852__(5005);
- module.exports = getBuiltIn('document', 'documentElement');
- /***/ }),
- /***/ 4664:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_55056__) {
- var DESCRIPTORS = __nested_webpack_require_55056__(9781);
- var fails = __nested_webpack_require_55056__(7293);
- var createElement = __nested_webpack_require_55056__(317);
- // Thank's IE8 for his funny defineProperty
- module.exports = !DESCRIPTORS && !fails(function () {
- return Object.defineProperty(createElement('div'), 'a', {
- get: function () { return 7; }
- }).a != 7;
- });
- /***/ }),
- /***/ 1179:
- /***/ (function(module) {
- // IEEE754 conversions based on https://github.com/feross/ieee754
- var abs = Math.abs;
- var pow = Math.pow;
- var floor = Math.floor;
- var log = Math.log;
- var LN2 = Math.LN2;
- var pack = function (number, mantissaLength, bytes) {
- var buffer = new Array(bytes);
- var exponentLength = bytes * 8 - mantissaLength - 1;
- var eMax = (1 << exponentLength) - 1;
- var eBias = eMax >> 1;
- var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
- var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
- var index = 0;
- var exponent, mantissa, c;
- number = abs(number);
- // eslint-disable-next-line no-self-compare -- NaN check
- if (number != number || number === Infinity) {
- // eslint-disable-next-line no-self-compare -- NaN check
- mantissa = number != number ? 1 : 0;
- exponent = eMax;
- } else {
- exponent = floor(log(number) / LN2);
- if (number * (c = pow(2, -exponent)) < 1) {
- exponent--;
- c *= 2;
- }
- if (exponent + eBias >= 1) {
- number += rt / c;
- } else {
- number += rt * pow(2, 1 - eBias);
- }
- if (number * c >= 2) {
- exponent++;
- c /= 2;
- }
- if (exponent + eBias >= eMax) {
- mantissa = 0;
- exponent = eMax;
- } else if (exponent + eBias >= 1) {
- mantissa = (number * c - 1) * pow(2, mantissaLength);
- exponent = exponent + eBias;
- } else {
- mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
- exponent = 0;
- }
- }
- for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8);
- exponent = exponent << mantissaLength | mantissa;
- exponentLength += mantissaLength;
- for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8);
- buffer[--index] |= sign * 128;
- return buffer;
- };
- var unpack = function (buffer, mantissaLength) {
- var bytes = buffer.length;
- var exponentLength = bytes * 8 - mantissaLength - 1;
- var eMax = (1 << exponentLength) - 1;
- var eBias = eMax >> 1;
- var nBits = exponentLength - 7;
- var index = bytes - 1;
- var sign = buffer[index--];
- var exponent = sign & 127;
- var mantissa;
- sign >>= 7;
- for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8);
- mantissa = exponent & (1 << -nBits) - 1;
- exponent >>= -nBits;
- nBits += mantissaLength;
- for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8);
- if (exponent === 0) {
- exponent = 1 - eBias;
- } else if (exponent === eMax) {
- return mantissa ? NaN : sign ? -Infinity : Infinity;
- } else {
- mantissa = mantissa + pow(2, mantissaLength);
- exponent = exponent - eBias;
- } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
- };
- module.exports = {
- pack: pack,
- unpack: unpack
- };
- /***/ }),
- /***/ 8361:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_58329__) {
- var fails = __nested_webpack_require_58329__(7293);
- var classof = __nested_webpack_require_58329__(4326);
- var split = ''.split;
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
- module.exports = fails(function () {
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
- // eslint-disable-next-line no-prototype-builtins -- safe
- return !Object('z').propertyIsEnumerable(0);
- }) ? function (it) {
- return classof(it) == 'String' ? split.call(it, '') : Object(it);
- } : Object;
- /***/ }),
- /***/ 9587:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_58925__) {
- var isObject = __nested_webpack_require_58925__(111);
- var setPrototypeOf = __nested_webpack_require_58925__(7674);
- // makes subclassing work correct for wrapped built-ins
- module.exports = function ($this, dummy, Wrapper) {
- var NewTarget, NewTargetPrototype;
- if (
- // it can work only with native `setPrototypeOf`
- setPrototypeOf &&
- // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
- typeof (NewTarget = dummy.constructor) == 'function' &&
- NewTarget !== Wrapper &&
- isObject(NewTargetPrototype = NewTarget.prototype) &&
- NewTargetPrototype !== Wrapper.prototype
- ) setPrototypeOf($this, NewTargetPrototype);
- return $this;
- };
- /***/ }),
- /***/ 2788:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_59686__) {
- var store = __nested_webpack_require_59686__(5465);
- var functionToString = Function.toString;
- // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
- if (typeof store.inspectSource != 'function') {
- store.inspectSource = function (it) {
- return functionToString.call(it);
- };
- }
- module.exports = store.inspectSource;
- /***/ }),
- /***/ 9909:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_60112__) {
- var NATIVE_WEAK_MAP = __nested_webpack_require_60112__(8536);
- var global = __nested_webpack_require_60112__(7854);
- var isObject = __nested_webpack_require_60112__(111);
- var createNonEnumerableProperty = __nested_webpack_require_60112__(8880);
- var objectHas = __nested_webpack_require_60112__(6656);
- var shared = __nested_webpack_require_60112__(5465);
- var sharedKey = __nested_webpack_require_60112__(6200);
- var hiddenKeys = __nested_webpack_require_60112__(3501);
- var WeakMap = global.WeakMap;
- var set, get, has;
- var enforce = function (it) {
- return has(it) ? get(it) : set(it, {});
- };
- var getterFor = function (TYPE) {
- return function (it) {
- var state;
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
- } return state;
- };
- };
- if (NATIVE_WEAK_MAP) {
- var store = shared.state || (shared.state = new WeakMap());
- var wmget = store.get;
- var wmhas = store.has;
- var wmset = store.set;
- set = function (it, metadata) {
- metadata.facade = it;
- wmset.call(store, it, metadata);
- return metadata;
- };
- get = function (it) {
- return wmget.call(store, it) || {};
- };
- has = function (it) {
- return wmhas.call(store, it);
- };
- } else {
- var STATE = sharedKey('state');
- hiddenKeys[STATE] = true;
- set = function (it, metadata) {
- metadata.facade = it;
- createNonEnumerableProperty(it, STATE, metadata);
- return metadata;
- };
- get = function (it) {
- return objectHas(it, STATE) ? it[STATE] : {};
- };
- has = function (it) {
- return objectHas(it, STATE);
- };
- }
- module.exports = {
- set: set,
- get: get,
- has: has,
- enforce: enforce,
- getterFor: getterFor
- };
- /***/ }),
- /***/ 7659:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_61804__) {
- var wellKnownSymbol = __nested_webpack_require_61804__(5112);
- var Iterators = __nested_webpack_require_61804__(7497);
- var ITERATOR = wellKnownSymbol('iterator');
- var ArrayPrototype = Array.prototype;
- // check on default Array iterator
- module.exports = function (it) {
- return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
- };
- /***/ }),
- /***/ 3157:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_62240__) {
- var classof = __nested_webpack_require_62240__(4326);
- // `IsArray` abstract operation
- // https://tc39.es/ecma262/#sec-isarray
- module.exports = Array.isArray || function isArray(arg) {
- return classof(arg) == 'Array';
- };
- /***/ }),
- /***/ 4705:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_62548__) {
- var fails = __nested_webpack_require_62548__(7293);
- var replacement = /#|\.prototype\./;
- var isForced = function (feature, detection) {
- var value = data[normalize(feature)];
- return value == POLYFILL ? true
- : value == NATIVE ? false
- : typeof detection == 'function' ? fails(detection)
- : !!detection;
- };
- var normalize = isForced.normalize = function (string) {
- return String(string).replace(replacement, '.').toLowerCase();
- };
- var data = isForced.data = {};
- var NATIVE = isForced.NATIVE = 'N';
- var POLYFILL = isForced.POLYFILL = 'P';
- module.exports = isForced;
- /***/ }),
- /***/ 111:
- /***/ (function(module) {
- module.exports = function (it) {
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
- /***/ }),
- /***/ 1913:
- /***/ (function(module) {
- module.exports = false;
- /***/ }),
- /***/ 7850:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_63453__) {
- var isObject = __nested_webpack_require_63453__(111);
- var classof = __nested_webpack_require_63453__(4326);
- var wellKnownSymbol = __nested_webpack_require_63453__(5112);
- var MATCH = wellKnownSymbol('match');
- // `IsRegExp` abstract operation
- // https://tc39.es/ecma262/#sec-isregexp
- module.exports = function (it) {
- var isRegExp;
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
- };
- /***/ }),
- /***/ 9212:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_63953__) {
- var anObject = __nested_webpack_require_63953__(9670);
- module.exports = function (iterator) {
- var returnMethod = iterator['return'];
- if (returnMethod !== undefined) {
- return anObject(returnMethod.call(iterator)).value;
- }
- };
- /***/ }),
- /***/ 3383:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_64274__) {
- "use strict";
- var fails = __nested_webpack_require_64274__(7293);
- var getPrototypeOf = __nested_webpack_require_64274__(9518);
- var createNonEnumerableProperty = __nested_webpack_require_64274__(8880);
- var has = __nested_webpack_require_64274__(6656);
- var wellKnownSymbol = __nested_webpack_require_64274__(5112);
- var IS_PURE = __nested_webpack_require_64274__(1913);
- var ITERATOR = wellKnownSymbol('iterator');
- var BUGGY_SAFARI_ITERATORS = false;
- var returnThis = function () { return this; };
- // `%IteratorPrototype%` object
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
- if ([].keys) {
- arrayIterator = [].keys();
- // Safari 8 has buggy iterators w/o `next`
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
- else {
- PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
- }
- }
- var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
- var test = {};
- // FF44- legacy iterators case
- return IteratorPrototype[ITERATOR].call(test) !== test;
- });
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
- // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
- if ((!IS_PURE || NEW_ITERATOR_PROTOTYPE) && !has(IteratorPrototype, ITERATOR)) {
- createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
- }
- module.exports = {
- IteratorPrototype: IteratorPrototype,
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
- };
- /***/ }),
- /***/ 7497:
- /***/ (function(module) {
- module.exports = {};
- /***/ }),
- /***/ 133:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_65970__) {
- var fails = __nested_webpack_require_65970__(7293);
- module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
- // Chrome 38 Symbol has incorrect toString conversion
- /* global Symbol -- required for testing */
- return !String(Symbol());
- });
- /***/ }),
- /***/ 590:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_66314__) {
- var fails = __nested_webpack_require_66314__(7293);
- var wellKnownSymbol = __nested_webpack_require_66314__(5112);
- var IS_PURE = __nested_webpack_require_66314__(1913);
- var ITERATOR = wellKnownSymbol('iterator');
- module.exports = !fails(function () {
- var url = new URL('b?a=1&b=2&c=3', 'http://a');
- var searchParams = url.searchParams;
- var result = '';
- url.pathname = 'c%20d';
- searchParams.forEach(function (value, key) {
- searchParams['delete']('b');
- result += key + value;
- });
- return (IS_PURE && !url.toJSON)
- || !searchParams.sort
- || url.href !== 'http://a/c%20d?a=1&c=3'
- || searchParams.get('c') !== '3'
- || String(new URLSearchParams('?a=1')) !== 'a=1'
- || !searchParams[ITERATOR]
- // throws in Edge
- || new URL('https://a@b').username !== 'a'
- || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
- // not punycoded in Edge
- || new URL('http://тест').host !== 'xn--e1aybc'
- // not escaped in Chrome 62-
- || new URL('http://a#б').hash !== '#%D0%B1'
- // fails in Chrome 66-
- || result !== 'a1c3'
- // throws in Safari
- || new URL('http://x', undefined).host !== 'x';
- });
- /***/ }),
- /***/ 8536:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_67534__) {
- var global = __nested_webpack_require_67534__(7854);
- var inspectSource = __nested_webpack_require_67534__(2788);
- var WeakMap = global.WeakMap;
- module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
- /***/ }),
- /***/ 1574:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_67846__) {
- "use strict";
- var DESCRIPTORS = __nested_webpack_require_67846__(9781);
- var fails = __nested_webpack_require_67846__(7293);
- var objectKeys = __nested_webpack_require_67846__(1956);
- var getOwnPropertySymbolsModule = __nested_webpack_require_67846__(5181);
- var propertyIsEnumerableModule = __nested_webpack_require_67846__(5296);
- var toObject = __nested_webpack_require_67846__(7908);
- var IndexedObject = __nested_webpack_require_67846__(8361);
- var nativeAssign = Object.assign;
- var defineProperty = Object.defineProperty;
- // `Object.assign` method
- // https://tc39.es/ecma262/#sec-object.assign
- module.exports = !nativeAssign || fails(function () {
- // should have correct order of operations (Edge bug)
- if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
- enumerable: true,
- get: function () {
- defineProperty(this, 'b', {
- value: 3,
- enumerable: false
- });
- }
- }), { b: 2 })).b !== 1) return true;
- // should work with symbols and should have deterministic property order (V8 bug)
- var A = {};
- var B = {};
- /* global Symbol -- required for testing */
- var symbol = Symbol();
- var alphabet = 'abcdefghijklmnopqrst';
- A[symbol] = 7;
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
- return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
- var T = toObject(target);
- var argumentsLength = arguments.length;
- var index = 1;
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
- while (argumentsLength > index) {
- var S = IndexedObject(arguments[index++]);
- var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) {
- key = keys[j++];
- if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
- }
- } return T;
- } : nativeAssign;
- /***/ }),
- /***/ 30:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_69941__) {
- var anObject = __nested_webpack_require_69941__(9670);
- var defineProperties = __nested_webpack_require_69941__(6048);
- var enumBugKeys = __nested_webpack_require_69941__(748);
- var hiddenKeys = __nested_webpack_require_69941__(3501);
- var html = __nested_webpack_require_69941__(490);
- var documentCreateElement = __nested_webpack_require_69941__(317);
- var sharedKey = __nested_webpack_require_69941__(6200);
- var GT = '>';
- var LT = '<';
- var PROTOTYPE = 'prototype';
- var SCRIPT = 'script';
- var IE_PROTO = sharedKey('IE_PROTO');
- var EmptyConstructor = function () { /* empty */ };
- var scriptTag = function (content) {
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
- };
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
- var NullProtoObjectViaActiveX = function (activeXDocument) {
- activeXDocument.write(scriptTag(''));
- activeXDocument.close();
- var temp = activeXDocument.parentWindow.Object;
- activeXDocument = null; // avoid memory leak
- return temp;
- };
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
- var NullProtoObjectViaIFrame = function () {
- // Thrash, waste and sodomy: IE GC bug
- var iframe = documentCreateElement('iframe');
- var JS = 'java' + SCRIPT + ':';
- var iframeDocument;
- iframe.style.display = 'none';
- html.appendChild(iframe);
- // https://github.com/zloirock/core-js/issues/475
- iframe.src = String(JS);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(scriptTag('document.F=Object'));
- iframeDocument.close();
- return iframeDocument.F;
- };
- // Check for document.domain and active x support
- // No need to use active x approach when document.domain is not set
- // see https://github.com/es-shims/es5-shim/issues/150
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
- // avoid IE GC bug
- var activeXDocument;
- var NullProtoObject = function () {
- try {
- /* global ActiveXObject -- old IE */
- activeXDocument = document.domain && new ActiveXObject('htmlfile');
- } catch (error) { /* ignore */ }
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
- var length = enumBugKeys.length;
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
- return NullProtoObject();
- };
- hiddenKeys[IE_PROTO] = true;
- // `Object.create` method
- // https://tc39.es/ecma262/#sec-object.create
- module.exports = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- EmptyConstructor[PROTOTYPE] = anObject(O);
- result = new EmptyConstructor();
- EmptyConstructor[PROTOTYPE] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO] = O;
- } else result = NullProtoObject();
- return Properties === undefined ? result : defineProperties(result, Properties);
- };
- /***/ }),
- /***/ 6048:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_72835__) {
- var DESCRIPTORS = __nested_webpack_require_72835__(9781);
- var definePropertyModule = __nested_webpack_require_72835__(3070);
- var anObject = __nested_webpack_require_72835__(9670);
- var objectKeys = __nested_webpack_require_72835__(1956);
- // `Object.defineProperties` method
- // https://tc39.es/ecma262/#sec-object.defineproperties
- module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
- anObject(O);
- var keys = objectKeys(Properties);
- var length = keys.length;
- var index = 0;
- var key;
- while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
- return O;
- };
- /***/ }),
- /***/ 3070:
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_73525__) {
- var DESCRIPTORS = __nested_webpack_require_73525__(9781);
- var IE8_DOM_DEFINE = __nested_webpack_require_73525__(4664);
- var anObject = __nested_webpack_require_73525__(9670);
- var toPrimitive = __nested_webpack_require_73525__(7593);
- var nativeDefineProperty = Object.defineProperty;
- // `Object.defineProperty` method
- // https://tc39.es/ecma262/#sec-object.defineproperty
- exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPrimitive(P, true);
- anObject(Attributes);
- if (IE8_DOM_DEFINE) try {
- return nativeDefineProperty(O, P, Attributes);
- } catch (error) { /* empty */ }
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
- };
- /***/ }),
- /***/ 1236:
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_74380__) {
- var DESCRIPTORS = __nested_webpack_require_74380__(9781);
- var propertyIsEnumerableModule = __nested_webpack_require_74380__(5296);
- var createPropertyDescriptor = __nested_webpack_require_74380__(9114);
- var toIndexedObject = __nested_webpack_require_74380__(5656);
- var toPrimitive = __nested_webpack_require_74380__(7593);
- var has = __nested_webpack_require_74380__(6656);
- var IE8_DOM_DEFINE = __nested_webpack_require_74380__(4664);
- var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
- exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
- O = toIndexedObject(O);
- P = toPrimitive(P, true);
- if (IE8_DOM_DEFINE) try {
- return nativeGetOwnPropertyDescriptor(O, P);
- } catch (error) { /* empty */ }
- if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
- };
- /***/ }),
- /***/ 8006:
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_75368__) {
- var internalObjectKeys = __nested_webpack_require_75368__(6324);
- var enumBugKeys = __nested_webpack_require_75368__(748);
- var hiddenKeys = enumBugKeys.concat('length', 'prototype');
- // `Object.getOwnPropertyNames` method
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
- exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return internalObjectKeys(O, hiddenKeys);
- };
- /***/ }),
- /***/ 5181:
- /***/ (function(__unused_webpack_module, exports) {
- exports.f = Object.getOwnPropertySymbols;
- /***/ }),
- /***/ 9518:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_75966__) {
- var has = __nested_webpack_require_75966__(6656);
- var toObject = __nested_webpack_require_75966__(7908);
- var sharedKey = __nested_webpack_require_75966__(6200);
- var CORRECT_PROTOTYPE_GETTER = __nested_webpack_require_75966__(8544);
- var IE_PROTO = sharedKey('IE_PROTO');
- var ObjectPrototype = Object.prototype;
- // `Object.getPrototypeOf` method
- // https://tc39.es/ecma262/#sec-object.getprototypeof
- module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
- O = toObject(O);
- if (has(O, IE_PROTO)) return O[IE_PROTO];
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
- return O.constructor.prototype;
- } return O instanceof Object ? ObjectPrototype : null;
- };
- /***/ }),
- /***/ 6324:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_76729__) {
- var has = __nested_webpack_require_76729__(6656);
- var toIndexedObject = __nested_webpack_require_76729__(5656);
- var indexOf = __nested_webpack_require_76729__(1318).indexOf;
- var hiddenKeys = __nested_webpack_require_76729__(3501);
- module.exports = function (object, names) {
- var O = toIndexedObject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
- // Don't enum bug & hidden keys
- while (names.length > i) if (has(O, key = names[i++])) {
- ~indexOf(result, key) || result.push(key);
- }
- return result;
- };
- /***/ }),
- /***/ 1956:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_77369__) {
- var internalObjectKeys = __nested_webpack_require_77369__(6324);
- var enumBugKeys = __nested_webpack_require_77369__(748);
- // `Object.keys` method
- // https://tc39.es/ecma262/#sec-object.keys
- module.exports = Object.keys || function keys(O) {
- return internalObjectKeys(O, enumBugKeys);
- };
- /***/ }),
- /***/ 5296:
- /***/ (function(__unused_webpack_module, exports) {
- "use strict";
- var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- // Nashorn ~ JDK8 bug
- var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
- // `Object.prototype.propertyIsEnumerable` method implementation
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
- exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
- var descriptor = getOwnPropertyDescriptor(this, V);
- return !!descriptor && descriptor.enumerable;
- } : nativePropertyIsEnumerable;
- /***/ }),
- /***/ 7674:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_78394__) {
- /* eslint-disable no-proto -- safe */
- var anObject = __nested_webpack_require_78394__(9670);
- var aPossiblePrototype = __nested_webpack_require_78394__(6077);
- // `Object.setPrototypeOf` method
- // https://tc39.es/ecma262/#sec-object.setprototypeof
- // Works with __proto__ only. Old v8 can't work with null proto objects.
- module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
- var CORRECT_SETTER = false;
- var test = {};
- var setter;
- try {
- setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
- setter.call(test, []);
- CORRECT_SETTER = test instanceof Array;
- } catch (error) { /* empty */ }
- return function setPrototypeOf(O, proto) {
- anObject(O);
- aPossiblePrototype(proto);
- if (CORRECT_SETTER) setter.call(O, proto);
- else O.__proto__ = proto;
- return O;
- };
- }() : undefined);
- /***/ }),
- /***/ 288:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_79325__) {
- "use strict";
- var TO_STRING_TAG_SUPPORT = __nested_webpack_require_79325__(1694);
- var classof = __nested_webpack_require_79325__(648);
- // `Object.prototype.toString` method implementation
- // https://tc39.es/ecma262/#sec-object.prototype.tostring
- module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
- return '[object ' + classof(this) + ']';
- };
- /***/ }),
- /***/ 3887:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_79769__) {
- var getBuiltIn = __nested_webpack_require_79769__(5005);
- var getOwnPropertyNamesModule = __nested_webpack_require_79769__(8006);
- var getOwnPropertySymbolsModule = __nested_webpack_require_79769__(5181);
- var anObject = __nested_webpack_require_79769__(9670);
- // all object keys, includes non-enumerable and symbols
- module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
- var keys = getOwnPropertyNamesModule.f(anObject(it));
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
- };
- /***/ }),
- /***/ 857:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_80406__) {
- var global = __nested_webpack_require_80406__(7854);
- module.exports = global;
- /***/ }),
- /***/ 2248:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_80571__) {
- var redefine = __nested_webpack_require_80571__(1320);
- module.exports = function (target, src, options) {
- for (var key in src) redefine(target, key, src[key], options);
- return target;
- };
- /***/ }),
- /***/ 1320:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_80849__) {
- var global = __nested_webpack_require_80849__(7854);
- var createNonEnumerableProperty = __nested_webpack_require_80849__(8880);
- var has = __nested_webpack_require_80849__(6656);
- var setGlobal = __nested_webpack_require_80849__(3505);
- var inspectSource = __nested_webpack_require_80849__(2788);
- var InternalStateModule = __nested_webpack_require_80849__(9909);
- var getInternalState = InternalStateModule.get;
- var enforceInternalState = InternalStateModule.enforce;
- var TEMPLATE = String(String).split('String');
- (module.exports = function (O, key, value, options) {
- var unsafe = options ? !!options.unsafe : false;
- var simple = options ? !!options.enumerable : false;
- var noTargetGet = options ? !!options.noTargetGet : false;
- var state;
- if (typeof value == 'function') {
- if (typeof key == 'string' && !has(value, 'name')) {
- createNonEnumerableProperty(value, 'name', key);
- }
- state = enforceInternalState(value);
- if (!state.source) {
- state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
- }
- }
- if (O === global) {
- if (simple) O[key] = value;
- else setGlobal(key, value);
- return;
- } else if (!unsafe) {
- delete O[key];
- } else if (!noTargetGet && O[key]) {
- simple = true;
- }
- if (simple) O[key] = value;
- else createNonEnumerableProperty(O, key, value);
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
- })(Function.prototype, 'toString', function toString() {
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
- });
- /***/ }),
- /***/ 7651:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_82466__) {
- var classof = __nested_webpack_require_82466__(4326);
- var regexpExec = __nested_webpack_require_82466__(2261);
- // `RegExpExec` abstract operation
- // https://tc39.es/ecma262/#sec-regexpexec
- module.exports = function (R, S) {
- var exec = R.exec;
- if (typeof exec === 'function') {
- var result = exec.call(R, S);
- if (typeof result !== 'object') {
- throw TypeError('RegExp exec method returned something other than an Object or null');
- }
- return result;
- }
- if (classof(R) !== 'RegExp') {
- throw TypeError('RegExp#exec called on incompatible receiver');
- }
- return regexpExec.call(R, S);
- };
- /***/ }),
- /***/ 2261:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_83158__) {
- "use strict";
- var regexpFlags = __nested_webpack_require_83158__(7066);
- var stickyHelpers = __nested_webpack_require_83158__(2999);
- var nativeExec = RegExp.prototype.exec;
- // This always refers to the native implementation, because the
- // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
- // which loads this file before patching the method.
- var nativeReplace = String.prototype.replace;
- var patchedExec = nativeExec;
- var UPDATES_LAST_INDEX_WRONG = (function () {
- var re1 = /a/;
- var re2 = /b*/g;
- nativeExec.call(re1, 'a');
- nativeExec.call(re2, 'a');
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
- })();
- var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
- // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
- if (PATCH) {
- patchedExec = function exec(str) {
- var re = this;
- var lastIndex, reCopy, match, i;
- var sticky = UNSUPPORTED_Y && re.sticky;
- var flags = regexpFlags.call(re);
- var source = re.source;
- var charsAdded = 0;
- var strCopy = str;
- if (sticky) {
- flags = flags.replace('y', '');
- if (flags.indexOf('g') === -1) {
- flags += 'g';
- }
- strCopy = String(str).slice(re.lastIndex);
- // Support anchored sticky behavior.
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
- source = '(?: ' + source + ')';
- strCopy = ' ' + strCopy;
- charsAdded++;
- }
- // ^(? + rx + ) is needed, in combination with some str slicing, to
- // simulate the 'y' flag.
- reCopy = new RegExp('^(?:' + source + ')', flags);
- }
- if (NPCG_INCLUDED) {
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
- }
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
- match = nativeExec.call(sticky ? reCopy : re, strCopy);
- if (sticky) {
- if (match) {
- match.input = match.input.slice(charsAdded);
- match[0] = match[0].slice(charsAdded);
- match.index = re.lastIndex;
- re.lastIndex += match[0].length;
- } else re.lastIndex = 0;
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
- }
- if (NPCG_INCLUDED && match && match.length > 1) {
- // Fix browsers whose `exec` methods don't consistently return `undefined`
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
- nativeReplace.call(match[0], reCopy, function () {
- for (i = 1; i < arguments.length - 2; i++) {
- if (arguments[i] === undefined) match[i] = undefined;
- }
- });
- }
- return match;
- };
- }
- module.exports = patchedExec;
- /***/ }),
- /***/ 7066:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_86176__) {
- "use strict";
- var anObject = __nested_webpack_require_86176__(9670);
- // `RegExp.prototype.flags` getter implementation
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
- module.exports = function () {
- var that = anObject(this);
- var result = '';
- if (that.global) result += 'g';
- if (that.ignoreCase) result += 'i';
- if (that.multiline) result += 'm';
- if (that.dotAll) result += 's';
- if (that.unicode) result += 'u';
- if (that.sticky) result += 'y';
- return result;
- };
- /***/ }),
- /***/ 2999:
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_86753__) {
- "use strict";
- var fails = __nested_webpack_require_86753__(7293);
- // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
- // so we use an intermediate function.
- function RE(s, f) {
- return RegExp(s, f);
- }
- exports.UNSUPPORTED_Y = fails(function () {
- // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
- var re = RE('a', 'y');
- re.lastIndex = 2;
- return re.exec('abcd') != null;
- });
- exports.BROKEN_CARET = fails(function () {
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
- var re = RE('^r', 'gy');
- re.lastIndex = 2;
- return re.exec('str') != null;
- });
- /***/ }),
- /***/ 4488:
- /***/ (function(module) {
- // `RequireObjectCoercible` abstract operation
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
- module.exports = function (it) {
- if (it == undefined) throw TypeError("Can't call method on " + it);
- return it;
- };
- /***/ }),
- /***/ 3505:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_87737__) {
- var global = __nested_webpack_require_87737__(7854);
- var createNonEnumerableProperty = __nested_webpack_require_87737__(8880);
- module.exports = function (key, value) {
- try {
- createNonEnumerableProperty(global, key, value);
- } catch (error) {
- global[key] = value;
- } return value;
- };
- /***/ }),
- /***/ 6340:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_88106__) {
- "use strict";
- var getBuiltIn = __nested_webpack_require_88106__(5005);
- var definePropertyModule = __nested_webpack_require_88106__(3070);
- var wellKnownSymbol = __nested_webpack_require_88106__(5112);
- var DESCRIPTORS = __nested_webpack_require_88106__(9781);
- var SPECIES = wellKnownSymbol('species');
- module.exports = function (CONSTRUCTOR_NAME) {
- var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
- var defineProperty = definePropertyModule.f;
- if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
- defineProperty(Constructor, SPECIES, {
- configurable: true,
- get: function () { return this; }
- });
- }
- };
- /***/ }),
- /***/ 8003:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_88786__) {
- var defineProperty = __nested_webpack_require_88786__(3070).f;
- var has = __nested_webpack_require_88786__(6656);
- var wellKnownSymbol = __nested_webpack_require_88786__(5112);
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- module.exports = function (it, TAG, STATIC) {
- if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
- defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
- }
- };
- /***/ }),
- /***/ 6200:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_89271__) {
- var shared = __nested_webpack_require_89271__(2309);
- var uid = __nested_webpack_require_89271__(9711);
- var keys = shared('keys');
- module.exports = function (key) {
- return keys[key] || (keys[key] = uid(key));
- };
- /***/ }),
- /***/ 5465:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_89559__) {
- var global = __nested_webpack_require_89559__(7854);
- var setGlobal = __nested_webpack_require_89559__(3505);
- var SHARED = '__core-js_shared__';
- var store = global[SHARED] || setGlobal(SHARED, {});
- module.exports = store;
- /***/ }),
- /***/ 2309:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_89855__) {
- var IS_PURE = __nested_webpack_require_89855__(1913);
- var store = __nested_webpack_require_89855__(5465);
- (module.exports = function (key, value) {
- return store[key] || (store[key] = value !== undefined ? value : {});
- })('versions', []).push({
- version: '3.9.0',
- mode: IS_PURE ? 'pure' : 'global',
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
- });
- /***/ }),
- /***/ 6707:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_90288__) {
- var anObject = __nested_webpack_require_90288__(9670);
- var aFunction = __nested_webpack_require_90288__(3099);
- var wellKnownSymbol = __nested_webpack_require_90288__(5112);
- var SPECIES = wellKnownSymbol('species');
- // `SpeciesConstructor` abstract operation
- // https://tc39.es/ecma262/#sec-speciesconstructor
- module.exports = function (O, defaultConstructor) {
- var C = anObject(O).constructor;
- var S;
- return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
- };
- /***/ }),
- /***/ 8710:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_90863__) {
- var toInteger = __nested_webpack_require_90863__(9958);
- var requireObjectCoercible = __nested_webpack_require_90863__(4488);
- // `String.prototype.{ codePointAt, at }` methods implementation
- var createMethod = function (CONVERT_TO_STRING) {
- return function ($this, pos) {
- var S = String(requireObjectCoercible($this));
- var position = toInteger(pos);
- var size = S.length;
- var first, second;
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
- first = S.charCodeAt(position);
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
- || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
- ? CONVERT_TO_STRING ? S.charAt(position) : first
- : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
- };
- };
- module.exports = {
- // `String.prototype.codePointAt` method
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
- codeAt: createMethod(false),
- // `String.prototype.at` method
- // https://github.com/mathiasbynens/String.prototype.at
- charAt: createMethod(true)
- };
- /***/ }),
- /***/ 3197:
- /***/ (function(module) {
- "use strict";
- // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
- var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
- var base = 36;
- var tMin = 1;
- var tMax = 26;
- var skew = 38;
- var damp = 700;
- var initialBias = 72;
- var initialN = 128; // 0x80
- var delimiter = '-'; // '\x2D'
- var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
- var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
- var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
- var baseMinusTMin = base - tMin;
- var floor = Math.floor;
- var stringFromCharCode = String.fromCharCode;
- /**
- * Creates an array containing the numeric code points of each Unicode
- * character in the string. While JavaScript uses UCS-2 internally,
- * this function will convert a pair of surrogate halves (each of which
- * UCS-2 exposes as separate characters) into a single code point,
- * matching UTF-16.
- */
- var ucs2decode = function (string) {
- var output = [];
- var counter = 0;
- var length = string.length;
- while (counter < length) {
- var value = string.charCodeAt(counter++);
- if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
- // It's a high surrogate, and there is a next character.
- var extra = string.charCodeAt(counter++);
- if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
- output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
- } else {
- // It's an unmatched surrogate; only append this code unit, in case the
- // next code unit is the high surrogate of a surrogate pair.
- output.push(value);
- counter--;
- }
- } else {
- output.push(value);
- }
- }
- return output;
- };
- /**
- * Converts a digit/integer into a basic code point.
- */
- var digitToBasic = function (digit) {
- // 0..25 map to ASCII a..z or A..Z
- // 26..35 map to ASCII 0..9
- return digit + 22 + 75 * (digit < 26);
- };
- /**
- * Bias adaptation function as per section 3.4 of RFC 3492.
- * https://tools.ietf.org/html/rfc3492#section-3.4
- */
- var adapt = function (delta, numPoints, firstTime) {
- var k = 0;
- delta = firstTime ? floor(delta / damp) : delta >> 1;
- delta += floor(delta / numPoints);
- for (; delta > baseMinusTMin * tMax >> 1; k += base) {
- delta = floor(delta / baseMinusTMin);
- }
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
- };
- /**
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
- * Punycode string of ASCII-only symbols.
- */
- // eslint-disable-next-line max-statements -- TODO
- var encode = function (input) {
- var output = [];
- // Convert the input in UCS-2 to an array of Unicode code points.
- input = ucs2decode(input);
- // Cache the length.
- var inputLength = input.length;
- // Initialize the state.
- var n = initialN;
- var delta = 0;
- var bias = initialBias;
- var i, currentValue;
- // Handle the basic code points.
- for (i = 0; i < input.length; i++) {
- currentValue = input[i];
- if (currentValue < 0x80) {
- output.push(stringFromCharCode(currentValue));
- }
- }
- var basicLength = output.length; // number of basic code points.
- var handledCPCount = basicLength; // number of code points that have been handled;
- // Finish the basic string with a delimiter unless it's empty.
- if (basicLength) {
- output.push(delimiter);
- }
- // Main encoding loop:
- while (handledCPCount < inputLength) {
- // All non-basic code points < n have been handled already. Find the next larger one:
- var m = maxInt;
- for (i = 0; i < input.length; i++) {
- currentValue = input[i];
- if (currentValue >= n && currentValue < m) {
- m = currentValue;
- }
- }
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
- var handledCPCountPlusOne = handledCPCount + 1;
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
- throw RangeError(OVERFLOW_ERROR);
- }
- delta += (m - n) * handledCPCountPlusOne;
- n = m;
- for (i = 0; i < input.length; i++) {
- currentValue = input[i];
- if (currentValue < n && ++delta > maxInt) {
- throw RangeError(OVERFLOW_ERROR);
- }
- if (currentValue == n) {
- // Represent delta as a generalized variable-length integer.
- var q = delta;
- for (var k = base; /* no condition */; k += base) {
- var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
- if (q < t) break;
- var qMinusT = q - t;
- var baseMinusT = base - t;
- output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
- q = floor(qMinusT / baseMinusT);
- }
- output.push(stringFromCharCode(digitToBasic(q)));
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
- delta = 0;
- ++handledCPCount;
- }
- }
- ++delta;
- ++n;
- }
- return output.join('');
- };
- module.exports = function (input) {
- var encoded = [];
- var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
- var i, label;
- for (i = 0; i < labels.length; i++) {
- label = labels[i];
- encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
- }
- return encoded.join('.');
- };
- /***/ }),
- /***/ 6091:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_97360__) {
- var fails = __nested_webpack_require_97360__(7293);
- var whitespaces = __nested_webpack_require_97360__(1361);
- var non = '\u200B\u0085\u180E';
- // check that a method works with the correct list
- // of whitespaces and has a correct name
- module.exports = function (METHOD_NAME) {
- return fails(function () {
- return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
- });
- };
- /***/ }),
- /***/ 3111:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_97868__) {
- var requireObjectCoercible = __nested_webpack_require_97868__(4488);
- var whitespaces = __nested_webpack_require_97868__(1361);
- var whitespace = '[' + whitespaces + ']';
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
- var rtrim = RegExp(whitespace + whitespace + '*$');
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
- var createMethod = function (TYPE) {
- return function ($this) {
- var string = String(requireObjectCoercible($this));
- if (TYPE & 1) string = string.replace(ltrim, '');
- if (TYPE & 2) string = string.replace(rtrim, '');
- return string;
- };
- };
- module.exports = {
- // `String.prototype.{ trimLeft, trimStart }` methods
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
- start: createMethod(1),
- // `String.prototype.{ trimRight, trimEnd }` methods
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
- end: createMethod(2),
- // `String.prototype.trim` method
- // https://tc39.es/ecma262/#sec-string.prototype.trim
- trim: createMethod(3)
- };
- /***/ }),
- /***/ 1400:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_98992__) {
- var toInteger = __nested_webpack_require_98992__(9958);
- var max = Math.max;
- var min = Math.min;
- // Helper for a popular repeating case of the spec:
- // Let integer be ? ToInteger(index).
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
- module.exports = function (index, length) {
- var integer = toInteger(index);
- return integer < 0 ? max(integer + length, 0) : min(integer, length);
- };
- /***/ }),
- /***/ 7067:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_99521__) {
- var toInteger = __nested_webpack_require_99521__(9958);
- var toLength = __nested_webpack_require_99521__(7466);
- // `ToIndex` abstract operation
- // https://tc39.es/ecma262/#sec-toindex
- module.exports = function (it) {
- if (it === undefined) return 0;
- var number = toInteger(it);
- var length = toLength(number);
- if (number !== length) throw RangeError('Wrong length or index');
- return length;
- };
- /***/ }),
- /***/ 5656:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_99996__) {
- // toObject with fallback for non-array-like ES3 strings
- var IndexedObject = __nested_webpack_require_99996__(8361);
- var requireObjectCoercible = __nested_webpack_require_99996__(4488);
- module.exports = function (it) {
- return IndexedObject(requireObjectCoercible(it));
- };
- /***/ }),
- /***/ 9958:
- /***/ (function(module) {
- var ceil = Math.ceil;
- var floor = Math.floor;
- // `ToInteger` abstract operation
- // https://tc39.es/ecma262/#sec-tointeger
- module.exports = function (argument) {
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
- };
- /***/ }),
- /***/ 7466:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_100645__) {
- var toInteger = __nested_webpack_require_100645__(9958);
- var min = Math.min;
- // `ToLength` abstract operation
- // https://tc39.es/ecma262/#sec-tolength
- module.exports = function (argument) {
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
- };
- /***/ }),
- /***/ 7908:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_101032__) {
- var requireObjectCoercible = __nested_webpack_require_101032__(4488);
- // `ToObject` abstract operation
- // https://tc39.es/ecma262/#sec-toobject
- module.exports = function (argument) {
- return Object(requireObjectCoercible(argument));
- };
- /***/ }),
- /***/ 4590:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_101355__) {
- var toPositiveInteger = __nested_webpack_require_101355__(3002);
- module.exports = function (it, BYTES) {
- var offset = toPositiveInteger(it);
- if (offset % BYTES) throw RangeError('Wrong offset');
- return offset;
- };
- /***/ }),
- /***/ 3002:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_101660__) {
- var toInteger = __nested_webpack_require_101660__(9958);
- module.exports = function (it) {
- var result = toInteger(it);
- if (result < 0) throw RangeError("The argument can't be less than 0");
- return result;
- };
- /***/ }),
- /***/ 7593:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_101959__) {
- var isObject = __nested_webpack_require_101959__(111);
- // `ToPrimitive` abstract operation
- // https://tc39.es/ecma262/#sec-toprimitive
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
- // and the second argument - flag - preferred type is a string
- module.exports = function (input, PREFERRED_STRING) {
- if (!isObject(input)) return input;
- var fn, val;
- if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
- if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
- if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
- throw TypeError("Can't convert object to primitive value");
- };
- /***/ }),
- /***/ 1694:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_102821__) {
- var wellKnownSymbol = __nested_webpack_require_102821__(5112);
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var test = {};
- test[TO_STRING_TAG] = 'z';
- module.exports = String(test) === '[object z]';
- /***/ }),
- /***/ 9843:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_103114__) {
- "use strict";
- var $ = __nested_webpack_require_103114__(2109);
- var global = __nested_webpack_require_103114__(7854);
- var DESCRIPTORS = __nested_webpack_require_103114__(9781);
- var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __nested_webpack_require_103114__(3832);
- var ArrayBufferViewCore = __nested_webpack_require_103114__(260);
- var ArrayBufferModule = __nested_webpack_require_103114__(3331);
- var anInstance = __nested_webpack_require_103114__(5787);
- var createPropertyDescriptor = __nested_webpack_require_103114__(9114);
- var createNonEnumerableProperty = __nested_webpack_require_103114__(8880);
- var toLength = __nested_webpack_require_103114__(7466);
- var toIndex = __nested_webpack_require_103114__(7067);
- var toOffset = __nested_webpack_require_103114__(4590);
- var toPrimitive = __nested_webpack_require_103114__(7593);
- var has = __nested_webpack_require_103114__(6656);
- var classof = __nested_webpack_require_103114__(648);
- var isObject = __nested_webpack_require_103114__(111);
- var create = __nested_webpack_require_103114__(30);
- var setPrototypeOf = __nested_webpack_require_103114__(7674);
- var getOwnPropertyNames = __nested_webpack_require_103114__(8006).f;
- var typedArrayFrom = __nested_webpack_require_103114__(7321);
- var forEach = __nested_webpack_require_103114__(2092).forEach;
- var setSpecies = __nested_webpack_require_103114__(6340);
- var definePropertyModule = __nested_webpack_require_103114__(3070);
- var getOwnPropertyDescriptorModule = __nested_webpack_require_103114__(1236);
- var InternalStateModule = __nested_webpack_require_103114__(9909);
- var inheritIfRequired = __nested_webpack_require_103114__(9587);
- var getInternalState = InternalStateModule.get;
- var setInternalState = InternalStateModule.set;
- var nativeDefineProperty = definePropertyModule.f;
- var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- var round = Math.round;
- var RangeError = global.RangeError;
- var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
- var DataView = ArrayBufferModule.DataView;
- var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
- var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
- var TypedArray = ArrayBufferViewCore.TypedArray;
- var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
- var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
- var isTypedArray = ArrayBufferViewCore.isTypedArray;
- var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
- var WRONG_LENGTH = 'Wrong length';
- var fromList = function (C, list) {
- var index = 0;
- var length = list.length;
- var result = new (aTypedArrayConstructor(C))(length);
- while (length > index) result[index] = list[index++];
- return result;
- };
- var addGetter = function (it, key) {
- nativeDefineProperty(it, key, { get: function () {
- return getInternalState(this)[key];
- } });
- };
- var isArrayBuffer = function (it) {
- var klass;
- return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer';
- };
- var isTypedArrayIndex = function (target, key) {
- return isTypedArray(target)
- && typeof key != 'symbol'
- && key in target
- && String(+key) == String(key);
- };
- var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
- return isTypedArrayIndex(target, key = toPrimitive(key, true))
- ? createPropertyDescriptor(2, target[key])
- : nativeGetOwnPropertyDescriptor(target, key);
- };
- var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
- if (isTypedArrayIndex(target, key = toPrimitive(key, true))
- && isObject(descriptor)
- && has(descriptor, 'value')
- && !has(descriptor, 'get')
- && !has(descriptor, 'set')
- // TODO: add validation descriptor w/o calling accessors
- && !descriptor.configurable
- && (!has(descriptor, 'writable') || descriptor.writable)
- && (!has(descriptor, 'enumerable') || descriptor.enumerable)
- ) {
- target[key] = descriptor.value;
- return target;
- } return nativeDefineProperty(target, key, descriptor);
- };
- if (DESCRIPTORS) {
- if (!NATIVE_ARRAY_BUFFER_VIEWS) {
- getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
- definePropertyModule.f = wrappedDefineProperty;
- addGetter(TypedArrayPrototype, 'buffer');
- addGetter(TypedArrayPrototype, 'byteOffset');
- addGetter(TypedArrayPrototype, 'byteLength');
- addGetter(TypedArrayPrototype, 'length');
- }
- $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
- getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
- defineProperty: wrappedDefineProperty
- });
- module.exports = function (TYPE, wrapper, CLAMPED) {
- var BYTES = TYPE.match(/\d+$/)[0] / 8;
- var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';
- var GETTER = 'get' + TYPE;
- var SETTER = 'set' + TYPE;
- var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];
- var TypedArrayConstructor = NativeTypedArrayConstructor;
- var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
- var exported = {};
- var getter = function (that, index) {
- var data = getInternalState(that);
- return data.view[GETTER](index * BYTES + data.byteOffset, true);
- };
- var setter = function (that, index, value) {
- var data = getInternalState(that);
- if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;
- data.view[SETTER](index * BYTES + data.byteOffset, value, true);
- };
- var addElement = function (that, index) {
- nativeDefineProperty(that, index, {
- get: function () {
- return getter(this, index);
- },
- set: function (value) {
- return setter(this, index, value);
- },
- enumerable: true
- });
- };
- if (!NATIVE_ARRAY_BUFFER_VIEWS) {
- TypedArrayConstructor = wrapper(function (that, data, offset, $length) {
- anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME);
- var index = 0;
- var byteOffset = 0;
- var buffer, byteLength, length;
- if (!isObject(data)) {
- length = toIndex(data);
- byteLength = length * BYTES;
- buffer = new ArrayBuffer(byteLength);
- } else if (isArrayBuffer(data)) {
- buffer = data;
- byteOffset = toOffset(offset, BYTES);
- var $len = data.byteLength;
- if ($length === undefined) {
- if ($len % BYTES) throw RangeError(WRONG_LENGTH);
- byteLength = $len - byteOffset;
- if (byteLength < 0) throw RangeError(WRONG_LENGTH);
- } else {
- byteLength = toLength($length) * BYTES;
- if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);
- }
- length = byteLength / BYTES;
- } else if (isTypedArray(data)) {
- return fromList(TypedArrayConstructor, data);
- } else {
- return typedArrayFrom.call(TypedArrayConstructor, data);
- }
- setInternalState(that, {
- buffer: buffer,
- byteOffset: byteOffset,
- byteLength: byteLength,
- length: length,
- view: new DataView(buffer)
- });
- while (index < length) addElement(that, index++);
- });
- if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
- TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
- } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
- TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {
- anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME);
- return inheritIfRequired(function () {
- if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));
- if (isArrayBuffer(data)) return $length !== undefined
- ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)
- : typedArrayOffset !== undefined
- ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))
- : new NativeTypedArrayConstructor(data);
- if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);
- return typedArrayFrom.call(TypedArrayConstructor, data);
- }(), dummy, TypedArrayConstructor);
- });
- if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
- forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {
- if (!(key in TypedArrayConstructor)) {
- createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
- }
- });
- TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
- }
- if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
- createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);
- }
- if (TYPED_ARRAY_TAG) {
- createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
- }
- exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
- $({
- global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS
- }, exported);
- if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
- createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
- }
- if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
- createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
- }
- setSpecies(CONSTRUCTOR_NAME);
- };
- } else module.exports = function () { /* empty */ };
- /***/ }),
- /***/ 3832:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_112503__) {
- /* eslint-disable no-new -- required for testing */
- var global = __nested_webpack_require_112503__(7854);
- var fails = __nested_webpack_require_112503__(7293);
- var checkCorrectnessOfIteration = __nested_webpack_require_112503__(7072);
- var NATIVE_ARRAY_BUFFER_VIEWS = __nested_webpack_require_112503__(260).NATIVE_ARRAY_BUFFER_VIEWS;
- var ArrayBuffer = global.ArrayBuffer;
- var Int8Array = global.Int8Array;
- module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
- Int8Array(1);
- }) || !fails(function () {
- new Int8Array(-1);
- }) || !checkCorrectnessOfIteration(function (iterable) {
- new Int8Array();
- new Int8Array(null);
- new Int8Array(1.5);
- new Int8Array(iterable);
- }, true) || fails(function () {
- // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill
- return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
- });
- /***/ }),
- /***/ 3074:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_113426__) {
- var aTypedArrayConstructor = __nested_webpack_require_113426__(260).aTypedArrayConstructor;
- var speciesConstructor = __nested_webpack_require_113426__(6707);
- module.exports = function (instance, list) {
- var C = speciesConstructor(instance, instance.constructor);
- var index = 0;
- var length = list.length;
- var result = new (aTypedArrayConstructor(C))(length);
- while (length > index) result[index] = list[index++];
- return result;
- };
- /***/ }),
- /***/ 7321:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_113940__) {
- var toObject = __nested_webpack_require_113940__(7908);
- var toLength = __nested_webpack_require_113940__(7466);
- var getIteratorMethod = __nested_webpack_require_113940__(1246);
- var isArrayIteratorMethod = __nested_webpack_require_113940__(7659);
- var bind = __nested_webpack_require_113940__(9974);
- var aTypedArrayConstructor = __nested_webpack_require_113940__(260).aTypedArrayConstructor;
- module.exports = function from(source /* , mapfn, thisArg */) {
- var O = toObject(source);
- var argumentsLength = arguments.length;
- var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- var iteratorMethod = getIteratorMethod(O);
- var i, length, result, step, iterator, next;
- if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) {
- iterator = iteratorMethod.call(O);
- next = iterator.next;
- O = [];
- while (!(step = next.call(iterator)).done) {
- O.push(step.value);
- }
- }
- if (mapping && argumentsLength > 2) {
- mapfn = bind(mapfn, arguments[2], 2);
- }
- length = toLength(O.length);
- result = new (aTypedArrayConstructor(this))(length);
- for (i = 0; length > i; i++) {
- result[i] = mapping ? mapfn(O[i], i) : O[i];
- }
- return result;
- };
- /***/ }),
- /***/ 9711:
- /***/ (function(module) {
- var id = 0;
- var postfix = Math.random();
- module.exports = function (key) {
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
- };
- /***/ }),
- /***/ 3307:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_115419__) {
- var NATIVE_SYMBOL = __nested_webpack_require_115419__(133);
- module.exports = NATIVE_SYMBOL
- /* global Symbol -- safe */
- && !Symbol.sham
- && typeof Symbol.iterator == 'symbol';
- /***/ }),
- /***/ 5112:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_115685__) {
- var global = __nested_webpack_require_115685__(7854);
- var shared = __nested_webpack_require_115685__(2309);
- var has = __nested_webpack_require_115685__(6656);
- var uid = __nested_webpack_require_115685__(9711);
- var NATIVE_SYMBOL = __nested_webpack_require_115685__(133);
- var USE_SYMBOL_AS_UID = __nested_webpack_require_115685__(3307);
- var WellKnownSymbolsStore = shared('wks');
- var Symbol = global.Symbol;
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
- module.exports = function (name) {
- if (!has(WellKnownSymbolsStore, name)) {
- if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
- else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
- } return WellKnownSymbolsStore[name];
- };
- /***/ }),
- /***/ 1361:
- /***/ (function(module) {
- // a string of all valid unicode whitespaces
- module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
- /***/ }),
- /***/ 8264:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_116785__) {
- "use strict";
- var $ = __nested_webpack_require_116785__(2109);
- var global = __nested_webpack_require_116785__(7854);
- var arrayBufferModule = __nested_webpack_require_116785__(3331);
- var setSpecies = __nested_webpack_require_116785__(6340);
- var ARRAY_BUFFER = 'ArrayBuffer';
- var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER];
- var NativeArrayBuffer = global[ARRAY_BUFFER];
- // `ArrayBuffer` constructor
- // https://tc39.es/ecma262/#sec-arraybuffer-constructor
- $({ global: true, forced: NativeArrayBuffer !== ArrayBuffer }, {
- ArrayBuffer: ArrayBuffer
- });
- setSpecies(ARRAY_BUFFER);
- /***/ }),
- /***/ 2222:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_117427__) {
- "use strict";
- var $ = __nested_webpack_require_117427__(2109);
- var fails = __nested_webpack_require_117427__(7293);
- var isArray = __nested_webpack_require_117427__(3157);
- var isObject = __nested_webpack_require_117427__(111);
- var toObject = __nested_webpack_require_117427__(7908);
- var toLength = __nested_webpack_require_117427__(7466);
- var createProperty = __nested_webpack_require_117427__(6135);
- var arraySpeciesCreate = __nested_webpack_require_117427__(5417);
- var arrayMethodHasSpeciesSupport = __nested_webpack_require_117427__(1194);
- var wellKnownSymbol = __nested_webpack_require_117427__(5112);
- var V8_VERSION = __nested_webpack_require_117427__(7392);
- var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
- var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
- // We can't use this feature detection in V8 since it causes
- // deoptimization and serious performance degradation
- // https://github.com/zloirock/core-js/issues/679
- var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
- var array = [];
- array[IS_CONCAT_SPREADABLE] = false;
- return array.concat()[0] !== array;
- });
- var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
- var isConcatSpreadable = function (O) {
- if (!isObject(O)) return false;
- var spreadable = O[IS_CONCAT_SPREADABLE];
- return spreadable !== undefined ? !!spreadable : isArray(O);
- };
- var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
- // `Array.prototype.concat` method
- // https://tc39.es/ecma262/#sec-array.prototype.concat
- // with adding support of @@isConcatSpreadable and @@species
- $({ target: 'Array', proto: true, forced: FORCED }, {
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- concat: function concat(arg) {
- var O = toObject(this);
- var A = arraySpeciesCreate(O, 0);
- var n = 0;
- var i, k, length, len, E;
- for (i = -1, length = arguments.length; i < length; i++) {
- E = i === -1 ? O : arguments[i];
- if (isConcatSpreadable(E)) {
- len = toLength(E.length);
- if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
- for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
- } else {
- if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
- createProperty(A, n++, E);
- }
- }
- A.length = n;
- return A;
- }
- });
- /***/ }),
- /***/ 7327:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_119834__) {
- "use strict";
- var $ = __nested_webpack_require_119834__(2109);
- var $filter = __nested_webpack_require_119834__(2092).filter;
- var arrayMethodHasSpeciesSupport = __nested_webpack_require_119834__(1194);
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
- // `Array.prototype.filter` method
- // https://tc39.es/ecma262/#sec-array.prototype.filter
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- filter: function filter(callbackfn /* , thisArg */) {
- return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ 2772:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_120523__) {
- "use strict";
- var $ = __nested_webpack_require_120523__(2109);
- var $indexOf = __nested_webpack_require_120523__(1318).indexOf;
- var arrayMethodIsStrict = __nested_webpack_require_120523__(9341);
- var nativeIndexOf = [].indexOf;
- var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
- var STRICT_METHOD = arrayMethodIsStrict('indexOf');
- // `Array.prototype.indexOf` method
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
- $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
- indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
- return NEGATIVE_ZERO
- // convert -0 to +0
- ? nativeIndexOf.apply(this, arguments) || 0
- : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ 6992:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_121364__) {
- "use strict";
- var toIndexedObject = __nested_webpack_require_121364__(5656);
- var addToUnscopables = __nested_webpack_require_121364__(1223);
- var Iterators = __nested_webpack_require_121364__(7497);
- var InternalStateModule = __nested_webpack_require_121364__(9909);
- var defineIterator = __nested_webpack_require_121364__(654);
- var ARRAY_ITERATOR = 'Array Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
- // `Array.prototype.entries` method
- // https://tc39.es/ecma262/#sec-array.prototype.entries
- // `Array.prototype.keys` method
- // https://tc39.es/ecma262/#sec-array.prototype.keys
- // `Array.prototype.values` method
- // https://tc39.es/ecma262/#sec-array.prototype.values
- // `Array.prototype[@@iterator]` method
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
- // `CreateArrayIterator` internal method
- // https://tc39.es/ecma262/#sec-createarrayiterator
- module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
- setInternalState(this, {
- type: ARRAY_ITERATOR,
- target: toIndexedObject(iterated), // target
- index: 0, // next index
- kind: kind // kind
- });
- // `%ArrayIteratorPrototype%.next` method
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
- }, function () {
- var state = getInternalState(this);
- var target = state.target;
- var kind = state.kind;
- var index = state.index++;
- if (!target || index >= target.length) {
- state.target = undefined;
- return { value: undefined, done: true };
- }
- if (kind == 'keys') return { value: index, done: false };
- if (kind == 'values') return { value: target[index], done: false };
- return { value: [index, target[index]], done: false };
- }, 'values');
- // argumentsList[@@iterator] is %ArrayProto_values%
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
- Iterators.Arguments = Iterators.Array;
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
- addToUnscopables('keys');
- addToUnscopables('values');
- addToUnscopables('entries');
- /***/ }),
- /***/ 1249:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_123565__) {
- "use strict";
- var $ = __nested_webpack_require_123565__(2109);
- var $map = __nested_webpack_require_123565__(2092).map;
- var arrayMethodHasSpeciesSupport = __nested_webpack_require_123565__(1194);
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
- // `Array.prototype.map` method
- // https://tc39.es/ecma262/#sec-array.prototype.map
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- map: function map(callbackfn /* , thisArg */) {
- return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ 7042:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_124230__) {
- "use strict";
- var $ = __nested_webpack_require_124230__(2109);
- var isObject = __nested_webpack_require_124230__(111);
- var isArray = __nested_webpack_require_124230__(3157);
- var toAbsoluteIndex = __nested_webpack_require_124230__(1400);
- var toLength = __nested_webpack_require_124230__(7466);
- var toIndexedObject = __nested_webpack_require_124230__(5656);
- var createProperty = __nested_webpack_require_124230__(6135);
- var wellKnownSymbol = __nested_webpack_require_124230__(5112);
- var arrayMethodHasSpeciesSupport = __nested_webpack_require_124230__(1194);
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
- var SPECIES = wellKnownSymbol('species');
- var nativeSlice = [].slice;
- var max = Math.max;
- // `Array.prototype.slice` method
- // https://tc39.es/ecma262/#sec-array.prototype.slice
- // fallback for not array-like ES3 strings and DOM objects
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- slice: function slice(start, end) {
- var O = toIndexedObject(this);
- var length = toLength(O.length);
- var k = toAbsoluteIndex(start, length);
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
- // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
- var Constructor, result, n;
- if (isArray(O)) {
- Constructor = O.constructor;
- // cross-realm fallback
- if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
- Constructor = undefined;
- } else if (isObject(Constructor)) {
- Constructor = Constructor[SPECIES];
- if (Constructor === null) Constructor = undefined;
- }
- if (Constructor === Array || Constructor === undefined) {
- return nativeSlice.call(O, k, fin);
- }
- }
- result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
- for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
- result.length = n;
- return result;
- }
- });
- /***/ }),
- /***/ 561:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_126211__) {
- "use strict";
- var $ = __nested_webpack_require_126211__(2109);
- var toAbsoluteIndex = __nested_webpack_require_126211__(1400);
- var toInteger = __nested_webpack_require_126211__(9958);
- var toLength = __nested_webpack_require_126211__(7466);
- var toObject = __nested_webpack_require_126211__(7908);
- var arraySpeciesCreate = __nested_webpack_require_126211__(5417);
- var createProperty = __nested_webpack_require_126211__(6135);
- var arrayMethodHasSpeciesSupport = __nested_webpack_require_126211__(1194);
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
- var max = Math.max;
- var min = Math.min;
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
- var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
- // `Array.prototype.splice` method
- // https://tc39.es/ecma262/#sec-array.prototype.splice
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- splice: function splice(start, deleteCount /* , ...items */) {
- var O = toObject(this);
- var len = toLength(O.length);
- var actualStart = toAbsoluteIndex(start, len);
- var argumentsLength = arguments.length;
- var insertCount, actualDeleteCount, A, k, from, to;
- if (argumentsLength === 0) {
- insertCount = actualDeleteCount = 0;
- } else if (argumentsLength === 1) {
- insertCount = 0;
- actualDeleteCount = len - actualStart;
- } else {
- insertCount = argumentsLength - 2;
- actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);
- }
- if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
- throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
- }
- A = arraySpeciesCreate(O, actualDeleteCount);
- for (k = 0; k < actualDeleteCount; k++) {
- from = actualStart + k;
- if (from in O) createProperty(A, k, O[from]);
- }
- A.length = actualDeleteCount;
- if (insertCount < actualDeleteCount) {
- for (k = actualStart; k < len - actualDeleteCount; k++) {
- from = k + actualDeleteCount;
- to = k + insertCount;
- if (from in O) O[to] = O[from];
- else delete O[to];
- }
- for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
- } else if (insertCount > actualDeleteCount) {
- for (k = len - actualDeleteCount; k > actualStart; k--) {
- from = k + actualDeleteCount - 1;
- to = k + insertCount - 1;
- if (from in O) O[to] = O[from];
- else delete O[to];
- }
- }
- for (k = 0; k < insertCount; k++) {
- O[k + actualStart] = arguments[k + 2];
- }
- O.length = len - actualDeleteCount + insertCount;
- return A;
- }
- });
- /***/ }),
- /***/ 8309:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_128857__) {
- var DESCRIPTORS = __nested_webpack_require_128857__(9781);
- var defineProperty = __nested_webpack_require_128857__(3070).f;
- var FunctionPrototype = Function.prototype;
- var FunctionPrototypeToString = FunctionPrototype.toString;
- var nameRE = /^\s*function ([^ (]*)/;
- var NAME = 'name';
- // Function instances `.name` property
- // https://tc39.es/ecma262/#sec-function-instances-name
- if (DESCRIPTORS && !(NAME in FunctionPrototype)) {
- defineProperty(FunctionPrototype, NAME, {
- configurable: true,
- get: function () {
- try {
- return FunctionPrototypeToString.call(this).match(nameRE)[1];
- } catch (error) {
- return '';
- }
- }
- });
- }
- /***/ }),
- /***/ 489:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_129614__) {
- var $ = __nested_webpack_require_129614__(2109);
- var fails = __nested_webpack_require_129614__(7293);
- var toObject = __nested_webpack_require_129614__(7908);
- var nativeGetPrototypeOf = __nested_webpack_require_129614__(9518);
- var CORRECT_PROTOTYPE_GETTER = __nested_webpack_require_129614__(8544);
- var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
- // `Object.getPrototypeOf` method
- // https://tc39.es/ecma262/#sec-object.getprototypeof
- $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
- getPrototypeOf: function getPrototypeOf(it) {
- return nativeGetPrototypeOf(toObject(it));
- }
- });
- /***/ }),
- /***/ 1539:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_130327__) {
- var TO_STRING_TAG_SUPPORT = __nested_webpack_require_130327__(1694);
- var redefine = __nested_webpack_require_130327__(1320);
- var toString = __nested_webpack_require_130327__(288);
- // `Object.prototype.toString` method
- // https://tc39.es/ecma262/#sec-object.prototype.tostring
- if (!TO_STRING_TAG_SUPPORT) {
- redefine(Object.prototype, 'toString', toString, { unsafe: true });
- }
- /***/ }),
- /***/ 4916:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_130780__) {
- "use strict";
- var $ = __nested_webpack_require_130780__(2109);
- var exec = __nested_webpack_require_130780__(2261);
- // `RegExp.prototype.exec` method
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
- $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
- exec: exec
- });
- /***/ }),
- /***/ 9714:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_131156__) {
- "use strict";
- var redefine = __nested_webpack_require_131156__(1320);
- var anObject = __nested_webpack_require_131156__(9670);
- var fails = __nested_webpack_require_131156__(7293);
- var flags = __nested_webpack_require_131156__(7066);
- var TO_STRING = 'toString';
- var RegExpPrototype = RegExp.prototype;
- var nativeToString = RegExpPrototype[TO_STRING];
- var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
- // FF44- RegExp#toString has a wrong name
- var INCORRECT_NAME = nativeToString.name != TO_STRING;
- // `RegExp.prototype.toString` method
- // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
- if (NOT_GENERIC || INCORRECT_NAME) {
- redefine(RegExp.prototype, TO_STRING, function toString() {
- var R = anObject(this);
- var p = String(R.source);
- var rf = R.flags;
- var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
- return '/' + p + '/' + f;
- }, { unsafe: true });
- }
- /***/ }),
- /***/ 8783:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_132221__) {
- "use strict";
- var charAt = __nested_webpack_require_132221__(8710).charAt;
- var InternalStateModule = __nested_webpack_require_132221__(9909);
- var defineIterator = __nested_webpack_require_132221__(654);
- var STRING_ITERATOR = 'String Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
- // `String.prototype[@@iterator]` method
- // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
- defineIterator(String, 'String', function (iterated) {
- setInternalState(this, {
- type: STRING_ITERATOR,
- string: String(iterated),
- index: 0
- });
- // `%StringIteratorPrototype%.next` method
- // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
- }, function next() {
- var state = getInternalState(this);
- var string = state.string;
- var index = state.index;
- var point;
- if (index >= string.length) return { value: undefined, done: true };
- point = charAt(string, index);
- state.index += point.length;
- return { value: point, done: false };
- });
- /***/ }),
- /***/ 4723:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_133333__) {
- "use strict";
- var fixRegExpWellKnownSymbolLogic = __nested_webpack_require_133333__(7007);
- var anObject = __nested_webpack_require_133333__(9670);
- var toLength = __nested_webpack_require_133333__(7466);
- var requireObjectCoercible = __nested_webpack_require_133333__(4488);
- var advanceStringIndex = __nested_webpack_require_133333__(1530);
- var regExpExec = __nested_webpack_require_133333__(7651);
- // @@match logic
- fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
- return [
- // `String.prototype.match` method
- // https://tc39.es/ecma262/#sec-string.prototype.match
- function match(regexp) {
- var O = requireObjectCoercible(this);
- var matcher = regexp == undefined ? undefined : regexp[MATCH];
- return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
- },
- // `RegExp.prototype[@@match]` method
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
- function (regexp) {
- var res = maybeCallNative(nativeMatch, regexp, this);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- if (!rx.global) return regExpExec(rx, S);
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- var A = [];
- var n = 0;
- var result;
- while ((result = regExpExec(rx, S)) !== null) {
- var matchStr = String(result[0]);
- A[n] = matchStr;
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- n++;
- }
- return n === 0 ? null : A;
- }
- ];
- });
- /***/ }),
- /***/ 5306:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_134975__) {
- "use strict";
- var fixRegExpWellKnownSymbolLogic = __nested_webpack_require_134975__(7007);
- var anObject = __nested_webpack_require_134975__(9670);
- var toLength = __nested_webpack_require_134975__(7466);
- var toInteger = __nested_webpack_require_134975__(9958);
- var requireObjectCoercible = __nested_webpack_require_134975__(4488);
- var advanceStringIndex = __nested_webpack_require_134975__(1530);
- var getSubstitution = __nested_webpack_require_134975__(647);
- var regExpExec = __nested_webpack_require_134975__(7651);
- var max = Math.max;
- var min = Math.min;
- var maybeToString = function (it) {
- return it === undefined ? it : String(it);
- };
- // @@replace logic
- fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
- var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
- return [
- // `String.prototype.replace` method
- // https://tc39.es/ecma262/#sec-string.prototype.replace
- function replace(searchValue, replaceValue) {
- var O = requireObjectCoercible(this);
- var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
- return replacer !== undefined
- ? replacer.call(searchValue, O, replaceValue)
- : nativeReplace.call(String(O), searchValue, replaceValue);
- },
- // `RegExp.prototype[@@replace]` method
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
- function (regexp, replaceValue) {
- if (
- (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
- (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
- ) {
- var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
- if (res.done) return res.value;
- }
- var rx = anObject(regexp);
- var S = String(this);
- var functionalReplace = typeof replaceValue === 'function';
- if (!functionalReplace) replaceValue = String(replaceValue);
- var global = rx.global;
- if (global) {
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- }
- var results = [];
- while (true) {
- var result = regExpExec(rx, S);
- if (result === null) break;
- results.push(result);
- if (!global) break;
- var matchStr = String(result[0]);
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- }
- var accumulatedResult = '';
- var nextSourcePosition = 0;
- for (var i = 0; i < results.length; i++) {
- result = results[i];
- var matched = String(result[0]);
- var position = max(min(toInteger(result.index), S.length), 0);
- var captures = [];
- // NOTE: This is equivalent to
- // captures = result.slice(1).map(maybeToString)
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
- for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
- var namedCaptures = result.groups;
- if (functionalReplace) {
- var replacerArgs = [matched].concat(captures, position, S);
- if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
- var replacement = String(replaceValue.apply(undefined, replacerArgs));
- } else {
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
- }
- if (position >= nextSourcePosition) {
- accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
- nextSourcePosition = position + matched.length;
- }
- }
- return accumulatedResult + S.slice(nextSourcePosition);
- }
- ];
- });
- /***/ }),
- /***/ 3123:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_139010__) {
- "use strict";
- var fixRegExpWellKnownSymbolLogic = __nested_webpack_require_139010__(7007);
- var isRegExp = __nested_webpack_require_139010__(7850);
- var anObject = __nested_webpack_require_139010__(9670);
- var requireObjectCoercible = __nested_webpack_require_139010__(4488);
- var speciesConstructor = __nested_webpack_require_139010__(6707);
- var advanceStringIndex = __nested_webpack_require_139010__(1530);
- var toLength = __nested_webpack_require_139010__(7466);
- var callRegExpExec = __nested_webpack_require_139010__(7651);
- var regexpExec = __nested_webpack_require_139010__(2261);
- var fails = __nested_webpack_require_139010__(7293);
- var arrayPush = [].push;
- var min = Math.min;
- var MAX_UINT32 = 0xFFFFFFFF;
- // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
- var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
- // @@split logic
- fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
- var internalSplit;
- if (
- 'abbc'.split(/(b)*/)[1] == 'c' ||
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
- 'test'.split(/(?:)/, -1).length != 4 ||
- 'ab'.split(/(?:ab)*/).length != 2 ||
- '.'.split(/(.?)(.?)/).length != 4 ||
- // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
- '.'.split(/()()/).length > 1 ||
- ''.split(/.?/).length
- ) {
- // based on es5-shim implementation, need to rework it
- internalSplit = function (separator, limit) {
- var string = String(requireObjectCoercible(this));
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
- if (lim === 0) return [];
- if (separator === undefined) return [string];
- // If `separator` is not a regex, use native split
- if (!isRegExp(separator)) {
- return nativeSplit.call(string, separator, lim);
- }
- var output = [];
- var flags = (separator.ignoreCase ? 'i' : '') +
- (separator.multiline ? 'm' : '') +
- (separator.unicode ? 'u' : '') +
- (separator.sticky ? 'y' : '');
- var lastLastIndex = 0;
- // Make `global` and avoid `lastIndex` issues by working with a copy
- var separatorCopy = new RegExp(separator.source, flags + 'g');
- var match, lastIndex, lastLength;
- while (match = regexpExec.call(separatorCopy, string)) {
- lastIndex = separatorCopy.lastIndex;
- if (lastIndex > lastLastIndex) {
- output.push(string.slice(lastLastIndex, match.index));
- if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
- lastLength = match[0].length;
- lastLastIndex = lastIndex;
- if (output.length >= lim) break;
- }
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
- }
- if (lastLastIndex === string.length) {
- if (lastLength || !separatorCopy.test('')) output.push('');
- } else output.push(string.slice(lastLastIndex));
- return output.length > lim ? output.slice(0, lim) : output;
- };
- // Chakra, V8
- } else if ('0'.split(undefined, 0).length) {
- internalSplit = function (separator, limit) {
- return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
- };
- } else internalSplit = nativeSplit;
- return [
- // `String.prototype.split` method
- // https://tc39.es/ecma262/#sec-string.prototype.split
- function split(separator, limit) {
- var O = requireObjectCoercible(this);
- var splitter = separator == undefined ? undefined : separator[SPLIT];
- return splitter !== undefined
- ? splitter.call(separator, O, limit)
- : internalSplit.call(String(O), separator, limit);
- },
- // `RegExp.prototype[@@split]` method
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
- //
- // NOTE: This cannot be properly polyfilled in engines that don't support
- // the 'y' flag.
- function (regexp, limit) {
- var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- var C = speciesConstructor(rx, RegExp);
- var unicodeMatching = rx.unicode;
- var flags = (rx.ignoreCase ? 'i' : '') +
- (rx.multiline ? 'm' : '') +
- (rx.unicode ? 'u' : '') +
- (SUPPORTS_Y ? 'y' : 'g');
- // ^(? + rx + ) is needed, in combination with some S slicing, to
- // simulate the 'y' flag.
- var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
- if (lim === 0) return [];
- if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
- var p = 0;
- var q = 0;
- var A = [];
- while (q < S.length) {
- splitter.lastIndex = SUPPORTS_Y ? q : 0;
- var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
- var e;
- if (
- z === null ||
- (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
- ) {
- q = advanceStringIndex(S, q, unicodeMatching);
- } else {
- A.push(S.slice(p, q));
- if (A.length === lim) return A;
- for (var i = 1; i <= z.length - 1; i++) {
- A.push(z[i]);
- if (A.length === lim) return A;
- }
- q = p = e;
- }
- }
- A.push(S.slice(p));
- return A;
- }
- ];
- }, !SUPPORTS_Y);
- /***/ }),
- /***/ 3210:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_144619__) {
- "use strict";
- var $ = __nested_webpack_require_144619__(2109);
- var $trim = __nested_webpack_require_144619__(3111).trim;
- var forcedStringTrimMethod = __nested_webpack_require_144619__(6091);
- // `String.prototype.trim` method
- // https://tc39.es/ecma262/#sec-string.prototype.trim
- $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
- trim: function trim() {
- return $trim(this);
- }
- });
- /***/ }),
- /***/ 2990:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_145111__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_145111__(260);
- var $copyWithin = __nested_webpack_require_145111__(1048);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.copyWithin` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin
- exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {
- return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
- });
- /***/ }),
- /***/ 8927:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_145777__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_145777__(260);
- var $every = __nested_webpack_require_145777__(2092).every;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.every` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.every
- exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {
- return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ 3105:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_146412__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_146412__(260);
- var $fill = __nested_webpack_require_146412__(1285);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.fill` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- exportTypedArrayMethod('fill', function fill(value /* , start, end */) {
- return $fill.apply(aTypedArray(this), arguments);
- });
- /***/ }),
- /***/ 5035:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_147058__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_147058__(260);
- var $filter = __nested_webpack_require_147058__(2092).filter;
- var fromSpeciesAndList = __nested_webpack_require_147058__(3074);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.filter` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter
- exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {
- var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- return fromSpeciesAndList(this, list);
- });
- /***/ }),
- /***/ 7174:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_147797__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_147797__(260);
- var $findIndex = __nested_webpack_require_147797__(2092).findIndex;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.findIndex` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex
- exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {
- return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ 4345:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_148458__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_148458__(260);
- var $find = __nested_webpack_require_148458__(2092).find;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.find` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.find
- exportTypedArrayMethod('find', function find(predicate /* , thisArg */) {
- return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ 2846:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_149084__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_149084__(260);
- var $forEach = __nested_webpack_require_149084__(2092).forEach;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.forEach` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach
- exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {
- $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ 4731:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_149726__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_149726__(260);
- var $includes = __nested_webpack_require_149726__(1318).includes;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.includes` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes
- exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) {
- return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ 7209:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_150390__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_150390__(260);
- var $indexOf = __nested_webpack_require_150390__(1318).indexOf;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.indexOf` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof
- exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) {
- return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ 6319:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_151047__) {
- "use strict";
- var global = __nested_webpack_require_151047__(7854);
- var ArrayBufferViewCore = __nested_webpack_require_151047__(260);
- var ArrayIterators = __nested_webpack_require_151047__(6992);
- var wellKnownSymbol = __nested_webpack_require_151047__(5112);
- var ITERATOR = wellKnownSymbol('iterator');
- var Uint8Array = global.Uint8Array;
- var arrayValues = ArrayIterators.values;
- var arrayKeys = ArrayIterators.keys;
- var arrayEntries = ArrayIterators.entries;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR];
- var CORRECT_ITER_NAME = !!nativeTypedArrayIterator
- && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined);
- var typedArrayValues = function values() {
- return arrayValues.call(aTypedArray(this));
- };
- // `%TypedArray%.prototype.entries` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries
- exportTypedArrayMethod('entries', function entries() {
- return arrayEntries.call(aTypedArray(this));
- });
- // `%TypedArray%.prototype.keys` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys
- exportTypedArrayMethod('keys', function keys() {
- return arrayKeys.call(aTypedArray(this));
- });
- // `%TypedArray%.prototype.values` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.values
- exportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME);
- // `%TypedArray%.prototype[@@iterator]` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator
- exportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME);
- /***/ }),
- /***/ 8867:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_152782__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_152782__(260);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var $join = [].join;
- // `%TypedArray%.prototype.join` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.join
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- exportTypedArrayMethod('join', function join(separator) {
- return $join.apply(aTypedArray(this), arguments);
- });
- /***/ }),
- /***/ 7789:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_153395__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_153395__(260);
- var $lastIndexOf = __nested_webpack_require_153395__(6583);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.lastIndexOf` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {
- return $lastIndexOf.apply(aTypedArray(this), arguments);
- });
- /***/ }),
- /***/ 3739:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_154090__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_154090__(260);
- var $map = __nested_webpack_require_154090__(2092).map;
- var speciesConstructor = __nested_webpack_require_154090__(6707);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.map` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.map
- exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) {
- return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {
- return new (aTypedArrayConstructor(speciesConstructor(O, O.constructor)))(length);
- });
- });
- /***/ }),
- /***/ 4483:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_154941__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_154941__(260);
- var $reduceRight = __nested_webpack_require_154941__(3671).right;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.reduceRicht` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright
- exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {
- return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ 9368:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_155635__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_155635__(260);
- var $reduce = __nested_webpack_require_155635__(3671).left;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.reduce` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce
- exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) {
- return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ 2056:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_156298__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_156298__(260);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var floor = Math.floor;
- // `%TypedArray%.prototype.reverse` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse
- exportTypedArrayMethod('reverse', function reverse() {
- var that = this;
- var length = aTypedArray(that).length;
- var middle = floor(length / 2);
- var index = 0;
- var value;
- while (index < middle) {
- value = that[index];
- that[index++] = that[--length];
- that[length] = value;
- } return that;
- });
- /***/ }),
- /***/ 3462:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_157051__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_157051__(260);
- var toLength = __nested_webpack_require_157051__(7466);
- var toOffset = __nested_webpack_require_157051__(4590);
- var toObject = __nested_webpack_require_157051__(7908);
- var fails = __nested_webpack_require_157051__(7293);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var FORCED = fails(function () {
- /* global Int8Array -- safe */
- new Int8Array(1).set({});
- });
- // `%TypedArray%.prototype.set` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.set
- exportTypedArrayMethod('set', function set(arrayLike /* , offset */) {
- aTypedArray(this);
- var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
- var length = this.length;
- var src = toObject(arrayLike);
- var len = toLength(src.length);
- var index = 0;
- if (len + offset > length) throw RangeError('Wrong length');
- while (index < len) this[offset + index] = src[index++];
- }, FORCED);
- /***/ }),
- /***/ 678:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_158136__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_158136__(260);
- var speciesConstructor = __nested_webpack_require_158136__(6707);
- var fails = __nested_webpack_require_158136__(7293);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var $slice = [].slice;
- var FORCED = fails(function () {
- /* global Int8Array -- safe */
- new Int8Array(1).slice();
- });
- // `%TypedArray%.prototype.slice` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice
- exportTypedArrayMethod('slice', function slice(start, end) {
- var list = $slice.call(aTypedArray(this), start, end);
- var C = speciesConstructor(this, this.constructor);
- var index = 0;
- var length = list.length;
- var result = new (aTypedArrayConstructor(C))(length);
- while (length > index) result[index] = list[index++];
- return result;
- }, FORCED);
- /***/ }),
- /***/ 7462:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_159191__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_159191__(260);
- var $some = __nested_webpack_require_159191__(2092).some;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.some` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.some
- exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {
- return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- });
- /***/ }),
- /***/ 3824:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_159819__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_159819__(260);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var $sort = [].sort;
- // `%TypedArray%.prototype.sort` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
- exportTypedArrayMethod('sort', function sort(comparefn) {
- return $sort.call(aTypedArray(this), comparefn);
- });
- /***/ }),
- /***/ 5021:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_160362__) {
- "use strict";
- var ArrayBufferViewCore = __nested_webpack_require_160362__(260);
- var toLength = __nested_webpack_require_160362__(7466);
- var toAbsoluteIndex = __nested_webpack_require_160362__(1400);
- var speciesConstructor = __nested_webpack_require_160362__(6707);
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- // `%TypedArray%.prototype.subarray` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray
- exportTypedArrayMethod('subarray', function subarray(begin, end) {
- var O = aTypedArray(this);
- var length = O.length;
- var beginIndex = toAbsoluteIndex(begin, length);
- return new (speciesConstructor(O, O.constructor))(
- O.buffer,
- O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,
- toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)
- );
- });
- /***/ }),
- /***/ 2974:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_161310__) {
- "use strict";
- var global = __nested_webpack_require_161310__(7854);
- var ArrayBufferViewCore = __nested_webpack_require_161310__(260);
- var fails = __nested_webpack_require_161310__(7293);
- var Int8Array = global.Int8Array;
- var aTypedArray = ArrayBufferViewCore.aTypedArray;
- var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
- var $toLocaleString = [].toLocaleString;
- var $slice = [].slice;
- // iOS Safari 6.x fails here
- var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {
- $toLocaleString.call(new Int8Array(1));
- });
- var FORCED = fails(function () {
- return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();
- }) || !fails(function () {
- Int8Array.prototype.toLocaleString.call([1, 2]);
- });
- // `%TypedArray%.prototype.toLocaleString` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring
- exportTypedArrayMethod('toLocaleString', function toLocaleString() {
- return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments);
- }, FORCED);
- /***/ }),
- /***/ 5016:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_162445__) {
- "use strict";
- var exportTypedArrayMethod = __nested_webpack_require_162445__(260).exportTypedArrayMethod;
- var fails = __nested_webpack_require_162445__(7293);
- var global = __nested_webpack_require_162445__(7854);
- var Uint8Array = global.Uint8Array;
- var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};
- var arrayToString = [].toString;
- var arrayJoin = [].join;
- if (fails(function () { arrayToString.call({}); })) {
- arrayToString = function toString() {
- return arrayJoin.call(this);
- };
- }
- var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;
- // `%TypedArray%.prototype.toString` method
- // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring
- exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);
- /***/ }),
- /***/ 2472:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_163286__) {
- var createTypedArrayConstructor = __nested_webpack_require_163286__(9843);
- // `Uint8Array` constructor
- // https://tc39.es/ecma262/#sec-typedarray-objects
- createTypedArrayConstructor('Uint8', function (init) {
- return function Uint8Array(data, byteOffset, length) {
- return init(this, data, byteOffset, length);
- };
- });
- /***/ }),
- /***/ 4747:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_163713__) {
- var global = __nested_webpack_require_163713__(7854);
- var DOMIterables = __nested_webpack_require_163713__(8324);
- var forEach = __nested_webpack_require_163713__(8533);
- var createNonEnumerableProperty = __nested_webpack_require_163713__(8880);
- for (var COLLECTION_NAME in DOMIterables) {
- var Collection = global[COLLECTION_NAME];
- var CollectionPrototype = Collection && Collection.prototype;
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
- createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
- } catch (error) {
- CollectionPrototype.forEach = forEach;
- }
- }
- /***/ }),
- /***/ 3948:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_164461__) {
- var global = __nested_webpack_require_164461__(7854);
- var DOMIterables = __nested_webpack_require_164461__(8324);
- var ArrayIteratorMethods = __nested_webpack_require_164461__(6992);
- var createNonEnumerableProperty = __nested_webpack_require_164461__(8880);
- var wellKnownSymbol = __nested_webpack_require_164461__(5112);
- var ITERATOR = wellKnownSymbol('iterator');
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var ArrayValues = ArrayIteratorMethods.values;
- for (var COLLECTION_NAME in DOMIterables) {
- var Collection = global[COLLECTION_NAME];
- var CollectionPrototype = Collection && Collection.prototype;
- if (CollectionPrototype) {
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
- createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
- } catch (error) {
- CollectionPrototype[ITERATOR] = ArrayValues;
- }
- if (!CollectionPrototype[TO_STRING_TAG]) {
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
- }
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
- } catch (error) {
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
- }
- }
- }
- }
- /***/ }),
- /***/ 1637:
- /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_166049__) {
- "use strict";
- // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
- __nested_webpack_require_166049__(6992);
- var $ = __nested_webpack_require_166049__(2109);
- var getBuiltIn = __nested_webpack_require_166049__(5005);
- var USE_NATIVE_URL = __nested_webpack_require_166049__(590);
- var redefine = __nested_webpack_require_166049__(1320);
- var redefineAll = __nested_webpack_require_166049__(2248);
- var setToStringTag = __nested_webpack_require_166049__(8003);
- var createIteratorConstructor = __nested_webpack_require_166049__(4994);
- var InternalStateModule = __nested_webpack_require_166049__(9909);
- var anInstance = __nested_webpack_require_166049__(5787);
- var hasOwn = __nested_webpack_require_166049__(6656);
- var bind = __nested_webpack_require_166049__(9974);
- var classof = __nested_webpack_require_166049__(648);
- var anObject = __nested_webpack_require_166049__(9670);
- var isObject = __nested_webpack_require_166049__(111);
- var create = __nested_webpack_require_166049__(30);
- var createPropertyDescriptor = __nested_webpack_require_166049__(9114);
- var getIterator = __nested_webpack_require_166049__(8554);
- var getIteratorMethod = __nested_webpack_require_166049__(1246);
- var wellKnownSymbol = __nested_webpack_require_166049__(5112);
- var $fetch = getBuiltIn('fetch');
- var Headers = getBuiltIn('Headers');
- var ITERATOR = wellKnownSymbol('iterator');
- var URL_SEARCH_PARAMS = 'URLSearchParams';
- var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
- var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
- var plus = /\+/g;
- var sequences = Array(4);
- var percentSequence = function (bytes) {
- return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
- };
- var percentDecode = function (sequence) {
- try {
- return decodeURIComponent(sequence);
- } catch (error) {
- return sequence;
- }
- };
- var deserialize = function (it) {
- var result = it.replace(plus, ' ');
- var bytes = 4;
- try {
- return decodeURIComponent(result);
- } catch (error) {
- while (bytes) {
- result = result.replace(percentSequence(bytes--), percentDecode);
- }
- return result;
- }
- };
- var find = /[!'()~]|%20/g;
- var replace = {
- '!': '%21',
- "'": '%27',
- '(': '%28',
- ')': '%29',
- '~': '%7E',
- '%20': '+'
- };
- var replacer = function (match) {
- return replace[match];
- };
- var serialize = function (it) {
- return encodeURIComponent(it).replace(find, replacer);
- };
- var parseSearchParams = function (result, query) {
- if (query) {
- var attributes = query.split('&');
- var index = 0;
- var attribute, entry;
- while (index < attributes.length) {
- attribute = attributes[index++];
- if (attribute.length) {
- entry = attribute.split('=');
- result.push({
- key: deserialize(entry.shift()),
- value: deserialize(entry.join('='))
- });
- }
- }
- }
- };
- var updateSearchParams = function (query) {
- this.entries.length = 0;
- parseSearchParams(this.entries, query);
- };
- var validateArgumentsLength = function (passed, required) {
- if (passed < required) throw TypeError('Not enough arguments');
- };
- var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
- setInternalState(this, {
- type: URL_SEARCH_PARAMS_ITERATOR,
- iterator: getIterator(getInternalParamsState(params).entries),
- kind: kind
- });
- }, 'Iterator', function next() {
- var state = getInternalIteratorState(this);
- var kind = state.kind;
- var step = state.iterator.next();
- var entry = step.value;
- if (!step.done) {
- step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
- } return step;
- });
- // `URLSearchParams` constructor
- // https://url.spec.whatwg.org/#interface-urlsearchparams
- var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
- anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
- var init = arguments.length > 0 ? arguments[0] : undefined;
- var that = this;
- var entries = [];
- var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
- setInternalState(that, {
- type: URL_SEARCH_PARAMS,
- entries: entries,
- updateURL: function () { /* empty */ },
- updateSearchParams: updateSearchParams
- });
- if (init !== undefined) {
- if (isObject(init)) {
- iteratorMethod = getIteratorMethod(init);
- if (typeof iteratorMethod === 'function') {
- iterator = iteratorMethod.call(init);
- next = iterator.next;
- while (!(step = next.call(iterator)).done) {
- entryIterator = getIterator(anObject(step.value));
- entryNext = entryIterator.next;
- if (
- (first = entryNext.call(entryIterator)).done ||
- (second = entryNext.call(entryIterator)).done ||
- !entryNext.call(entryIterator).done
- ) throw TypeError('Expected sequence with length 2');
- entries.push({ key: first.value + '', value: second.value + '' });
- }
- } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
- } else {
- parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
- }
- }
- };
- var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
- redefineAll(URLSearchParamsPrototype, {
- // `URLSearchParams.prototype.append` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-append
- append: function append(name, value) {
- validateArgumentsLength(arguments.length, 2);
- var state = getInternalParamsState(this);
- state.entries.push({ key: name + '', value: value + '' });
- state.updateURL();
- },
- // `URLSearchParams.prototype.delete` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
- 'delete': function (name) {
- validateArgumentsLength(arguments.length, 1);
- var state = getInternalParamsState(this);
- var entries = state.entries;
- var key = name + '';
- var index = 0;
- while (index < entries.length) {
- if (entries[index].key === key) entries.splice(index, 1);
- else index++;
- }
- state.updateURL();
- },
- // `URLSearchParams.prototype.get` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-get
- get: function get(name) {
- validateArgumentsLength(arguments.length, 1);
- var entries = getInternalParamsState(this).entries;
- var key = name + '';
- var index = 0;
- for (; index < entries.length; index++) {
- if (entries[index].key === key) return entries[index].value;
- }
- return null;
- },
- // `URLSearchParams.prototype.getAll` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
- getAll: function getAll(name) {
- validateArgumentsLength(arguments.length, 1);
- var entries = getInternalParamsState(this).entries;
- var key = name + '';
- var result = [];
- var index = 0;
- for (; index < entries.length; index++) {
- if (entries[index].key === key) result.push(entries[index].value);
- }
- return result;
- },
- // `URLSearchParams.prototype.has` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-has
- has: function has(name) {
- validateArgumentsLength(arguments.length, 1);
- var entries = getInternalParamsState(this).entries;
- var key = name + '';
- var index = 0;
- while (index < entries.length) {
- if (entries[index++].key === key) return true;
- }
- return false;
- },
- // `URLSearchParams.prototype.set` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-set
- set: function set(name, value) {
- validateArgumentsLength(arguments.length, 1);
- var state = getInternalParamsState(this);
- var entries = state.entries;
- var found = false;
- var key = name + '';
- var val = value + '';
- var index = 0;
- var entry;
- for (; index < entries.length; index++) {
- entry = entries[index];
- if (entry.key === key) {
- if (found) entries.splice(index--, 1);
- else {
- found = true;
- entry.value = val;
- }
- }
- }
- if (!found) entries.push({ key: key, value: val });
- state.updateURL();
- },
- // `URLSearchParams.prototype.sort` method
- // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
- sort: function sort() {
- var state = getInternalParamsState(this);
- var entries = state.entries;
- // Array#sort is not stable in some engines
- var slice = entries.slice();
- var entry, entriesIndex, sliceIndex;
- entries.length = 0;
- for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
- entry = slice[sliceIndex];
- for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
- if (entries[entriesIndex].key > entry.key) {
- entries.splice(entriesIndex, 0, entry);
- break;
- }
- }
- if (entriesIndex === sliceIndex) entries.push(entry);
- }
- state.updateURL();
- },
- // `URLSearchParams.prototype.forEach` method
- forEach: function forEach(callback /* , thisArg */) {
- var entries = getInternalParamsState(this).entries;
- var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
- var index = 0;
- var entry;
- while (index < entries.length) {
- entry = entries[index++];
- boundFunction(entry.value, entry.key, this);
- }
- },
- // `URLSearchParams.prototype.keys` method
- keys: function keys() {
- return new URLSearchParamsIterator(this, 'keys');
- },
- // `URLSearchParams.prototype.values` method
- values: function values() {
- return new URLSearchParamsIterator(this, 'values');
- },
- // `URLSearchParams.prototype.entries` method
- entries: function entries() {
- return new URLSearchParamsIterator(this, 'entries');
- }
- }, { enumerable: true });
- // `URLSearchParams.prototype[@@iterator]` method
- redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);
- // `URLSearchParams.prototype.toString` method
- // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
- redefine(URLSearchParamsPrototype, 'toString', function toString() {
- var entries = getInternalParamsState(this).entries;
- var result = [];
- var index = 0;
- var entry;
- while (index < entries.length) {
- entry = entries[index++];
- result.push(serialize(entry.key) + '=' + serialize(entry.value));
- } return result.join('&');
- }, { enumerable: true });
- setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
- $({ global: true, forced: !USE_NATIVE_URL }, {
- URLSearchParams: URLSearchParamsConstructor
- });
- // Wrap `fetch` for correct work with polyfilled `URLSearchParams`
- // https://github.com/zloirock/core-js/issues/674
- if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {
- $({ global: true, enumerable: true, forced: true }, {
- fetch: function fetch(input /* , init */) {
- var args = [input];
- var init, body, headers;
- if (arguments.length > 1) {
- init = arguments[1];
- if (isObject(init)) {
- body = init.body;
- if (classof(body) === URL_SEARCH_PARAMS) {
- headers = init.headers ? new Headers(init.headers) : new Headers();
- if (!headers.has('content-type')) {
- headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
- }
- init = create(init, {
- body: createPropertyDescriptor(0, String(body)),
- headers: createPropertyDescriptor(0, headers)
- });
- }
- }
- args.push(init);
- } return $fetch.apply(this, args);
- }
- });
- }
- module.exports = {
- URLSearchParams: URLSearchParamsConstructor,
- getState: getInternalParamsState
- };
- /***/ }),
- /***/ 285:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __nested_webpack_require_177789__) {
- "use strict";
- // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
- __nested_webpack_require_177789__(8783);
- var $ = __nested_webpack_require_177789__(2109);
- var DESCRIPTORS = __nested_webpack_require_177789__(9781);
- var USE_NATIVE_URL = __nested_webpack_require_177789__(590);
- var global = __nested_webpack_require_177789__(7854);
- var defineProperties = __nested_webpack_require_177789__(6048);
- var redefine = __nested_webpack_require_177789__(1320);
- var anInstance = __nested_webpack_require_177789__(5787);
- var has = __nested_webpack_require_177789__(6656);
- var assign = __nested_webpack_require_177789__(1574);
- var arrayFrom = __nested_webpack_require_177789__(8457);
- var codeAt = __nested_webpack_require_177789__(8710).codeAt;
- var toASCII = __nested_webpack_require_177789__(3197);
- var setToStringTag = __nested_webpack_require_177789__(8003);
- var URLSearchParamsModule = __nested_webpack_require_177789__(1637);
- var InternalStateModule = __nested_webpack_require_177789__(9909);
- var NativeURL = global.URL;
- var URLSearchParams = URLSearchParamsModule.URLSearchParams;
- var getInternalSearchParamsState = URLSearchParamsModule.getState;
- var setInternalState = InternalStateModule.set;
- var getInternalURLState = InternalStateModule.getterFor('URL');
- var floor = Math.floor;
- var pow = Math.pow;
- var INVALID_AUTHORITY = 'Invalid authority';
- var INVALID_SCHEME = 'Invalid scheme';
- var INVALID_HOST = 'Invalid host';
- var INVALID_PORT = 'Invalid port';
- var ALPHA = /[A-Za-z]/;
- var ALPHANUMERIC = /[\d+-.A-Za-z]/;
- var DIGIT = /\d/;
- var HEX_START = /^(0x|0X)/;
- var OCT = /^[0-7]+$/;
- var DEC = /^\d+$/;
- var HEX = /^[\dA-Fa-f]+$/;
- /* eslint-disable no-control-regex -- safe */
- var FORBIDDEN_HOST_CODE_POINT = /[\u0000\t\u000A\u000D #%/:?@[\\]]/;
- var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\t\u000A\u000D #/:?@[\\]]/;
- var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
- var TAB_AND_NEW_LINE = /[\t\u000A\u000D]/g;
- /* eslint-enable no-control-regex -- safe */
- var EOF;
- var parseHost = function (url, input) {
- var result, codePoints, index;
- if (input.charAt(0) == '[') {
- if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
- result = parseIPv6(input.slice(1, -1));
- if (!result) return INVALID_HOST;
- url.host = result;
- // opaque host
- } else if (!isSpecial(url)) {
- if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
- result = '';
- codePoints = arrayFrom(input);
- for (index = 0; index < codePoints.length; index++) {
- result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
- }
- url.host = result;
- } else {
- input = toASCII(input);
- if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
- result = parseIPv4(input);
- if (result === null) return INVALID_HOST;
- url.host = result;
- }
- };
- var parseIPv4 = function (input) {
- var parts = input.split('.');
- var partsLength, numbers, index, part, radix, number, ipv4;
- if (parts.length && parts[parts.length - 1] == '') {
- parts.pop();
- }
- partsLength = parts.length;
- if (partsLength > 4) return input;
- numbers = [];
- for (index = 0; index < partsLength; index++) {
- part = parts[index];
- if (part == '') return input;
- radix = 10;
- if (part.length > 1 && part.charAt(0) == '0') {
- radix = HEX_START.test(part) ? 16 : 8;
- part = part.slice(radix == 8 ? 1 : 2);
- }
- if (part === '') {
- number = 0;
- } else {
- if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
- number = parseInt(part, radix);
- }
- numbers.push(number);
- }
- for (index = 0; index < partsLength; index++) {
- number = numbers[index];
- if (index == partsLength - 1) {
- if (number >= pow(256, 5 - partsLength)) return null;
- } else if (number > 255) return null;
- }
- ipv4 = numbers.pop();
- for (index = 0; index < numbers.length; index++) {
- ipv4 += numbers[index] * pow(256, 3 - index);
- }
- return ipv4;
- };
- // eslint-disable-next-line max-statements -- TODO
- var parseIPv6 = function (input) {
- var address = [0, 0, 0, 0, 0, 0, 0, 0];
- var pieceIndex = 0;
- var compress = null;
- var pointer = 0;
- var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
- var char = function () {
- return input.charAt(pointer);
- };
- if (char() == ':') {
- if (input.charAt(1) != ':') return;
- pointer += 2;
- pieceIndex++;
- compress = pieceIndex;
- }
- while (char()) {
- if (pieceIndex == 8) return;
- if (char() == ':') {
- if (compress !== null) return;
- pointer++;
- pieceIndex++;
- compress = pieceIndex;
- continue;
- }
- value = length = 0;
- while (length < 4 && HEX.test(char())) {
- value = value * 16 + parseInt(char(), 16);
- pointer++;
- length++;
- }
- if (char() == '.') {
- if (length == 0) return;
- pointer -= length;
- if (pieceIndex > 6) return;
- numbersSeen = 0;
- while (char()) {
- ipv4Piece = null;
- if (numbersSeen > 0) {
- if (char() == '.' && numbersSeen < 4) pointer++;
- else return;
- }
- if (!DIGIT.test(char())) return;
- while (DIGIT.test(char())) {
- number = parseInt(char(), 10);
- if (ipv4Piece === null) ipv4Piece = number;
- else if (ipv4Piece == 0) return;
- else ipv4Piece = ipv4Piece * 10 + number;
- if (ipv4Piece > 255) return;
- pointer++;
- }
- address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
- numbersSeen++;
- if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
- }
- if (numbersSeen != 4) return;
- break;
- } else if (char() == ':') {
- pointer++;
- if (!char()) return;
- } else if (char()) return;
- address[pieceIndex++] = value;
- }
- if (compress !== null) {
- swaps = pieceIndex - compress;
- pieceIndex = 7;
- while (pieceIndex != 0 && swaps > 0) {
- swap = address[pieceIndex];
- address[pieceIndex--] = address[compress + swaps - 1];
- address[compress + --swaps] = swap;
- }
- } else if (pieceIndex != 8) return;
- return address;
- };
- var findLongestZeroSequence = function (ipv6) {
- var maxIndex = null;
- var maxLength = 1;
- var currStart = null;
- var currLength = 0;
- var index = 0;
- for (; index < 8; index++) {
- if (ipv6[index] !== 0) {
- if (currLength > maxLength) {
- maxIndex = currStart;
- maxLength = currLength;
- }
- currStart = null;
- currLength = 0;
- } else {
- if (currStart === null) currStart = index;
- ++currLength;
- }
- }
- if (currLength > maxLength) {
- maxIndex = currStart;
- maxLength = currLength;
- }
- return maxIndex;
- };
- var serializeHost = function (host) {
- var result, index, compress, ignore0;
- // ipv4
- if (typeof host == 'number') {
- result = [];
- for (index = 0; index < 4; index++) {
- result.unshift(host % 256);
- host = floor(host / 256);
- } return result.join('.');
- // ipv6
- } else if (typeof host == 'object') {
- result = '';
- compress = findLongestZeroSequence(host);
- for (index = 0; index < 8; index++) {
- if (ignore0 && host[index] === 0) continue;
- if (ignore0) ignore0 = false;
- if (compress === index) {
- result += index ? ':' : '::';
- ignore0 = true;
- } else {
- result += host[index].toString(16);
- if (index < 7) result += ':';
- }
- }
- return '[' + result + ']';
- } return host;
- };
- var C0ControlPercentEncodeSet = {};
- var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
- ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
- });
- var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
- '#': 1, '?': 1, '{': 1, '}': 1
- });
- var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
- '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
- });
- var percentEncode = function (char, set) {
- var code = codeAt(char, 0);
- return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);
- };
- var specialSchemes = {
- ftp: 21,
- file: null,
- http: 80,
- https: 443,
- ws: 80,
- wss: 443
- };
- var isSpecial = function (url) {
- return has(specialSchemes, url.scheme);
- };
- var includesCredentials = function (url) {
- return url.username != '' || url.password != '';
- };
- var cannotHaveUsernamePasswordPort = function (url) {
- return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
- };
- var isWindowsDriveLetter = function (string, normalized) {
- var second;
- return string.length == 2 && ALPHA.test(string.charAt(0))
- && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
- };
- var startsWithWindowsDriveLetter = function (string) {
- var third;
- return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
- string.length == 2 ||
- ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
- );
- };
- var shortenURLsPath = function (url) {
- var path = url.path;
- var pathSize = path.length;
- if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
- path.pop();
- }
- };
- var isSingleDot = function (segment) {
- return segment === '.' || segment.toLowerCase() === '%2e';
- };
- var isDoubleDot = function (segment) {
- segment = segment.toLowerCase();
- return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
- };
- // States:
- var SCHEME_START = {};
- var SCHEME = {};
- var NO_SCHEME = {};
- var SPECIAL_RELATIVE_OR_AUTHORITY = {};
- var PATH_OR_AUTHORITY = {};
- var RELATIVE = {};
- var RELATIVE_SLASH = {};
- var SPECIAL_AUTHORITY_SLASHES = {};
- var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
- var AUTHORITY = {};
- var HOST = {};
- var HOSTNAME = {};
- var PORT = {};
- var FILE = {};
- var FILE_SLASH = {};
- var FILE_HOST = {};
- var PATH_START = {};
- var PATH = {};
- var CANNOT_BE_A_BASE_URL_PATH = {};
- var QUERY = {};
- var FRAGMENT = {};
- // eslint-disable-next-line max-statements -- TODO
- var parseURL = function (url, input, stateOverride, base) {
- var state = stateOverride || SCHEME_START;
- var pointer = 0;
- var buffer = '';
- var seenAt = false;
- var seenBracket = false;
- var seenPasswordToken = false;
- var codePoints, char, bufferCodePoints, failure;
- if (!stateOverride) {
- url.scheme = '';
- url.username = '';
- url.password = '';
- url.host = null;
- url.port = null;
- url.path = [];
- url.query = null;
- url.fragment = null;
- url.cannotBeABaseURL = false;
- input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
- }
- input = input.replace(TAB_AND_NEW_LINE, '');
- codePoints = arrayFrom(input);
- while (pointer <= codePoints.length) {
- char = codePoints[pointer];
- switch (state) {
- case SCHEME_START:
- if (char && ALPHA.test(char)) {
- buffer += char.toLowerCase();
- state = SCHEME;
- } else if (!stateOverride) {
- state = NO_SCHEME;
- continue;
- } else return INVALID_SCHEME;
- break;
- case SCHEME:
- if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
- buffer += char.toLowerCase();
- } else if (char == ':') {
- if (stateOverride && (
- (isSpecial(url) != has(specialSchemes, buffer)) ||
- (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
- (url.scheme == 'file' && !url.host)
- )) return;
- url.scheme = buffer;
- if (stateOverride) {
- if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
- return;
- }
- buffer = '';
- if (url.scheme == 'file') {
- state = FILE;
- } else if (isSpecial(url) && base && base.scheme == url.scheme) {
- state = SPECIAL_RELATIVE_OR_AUTHORITY;
- } else if (isSpecial(url)) {
- state = SPECIAL_AUTHORITY_SLASHES;
- } else if (codePoints[pointer + 1] == '/') {
- state = PATH_OR_AUTHORITY;
- pointer++;
- } else {
- url.cannotBeABaseURL = true;
- url.path.push('');
- state = CANNOT_BE_A_BASE_URL_PATH;
- }
- } else if (!stateOverride) {
- buffer = '';
- state = NO_SCHEME;
- pointer = 0;
- continue;
- } else return INVALID_SCHEME;
- break;
- case NO_SCHEME:
- if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;
- if (base.cannotBeABaseURL && char == '#') {
- url.scheme = base.scheme;
- url.path = base.path.slice();
- url.query = base.query;
- url.fragment = '';
- url.cannotBeABaseURL = true;
- state = FRAGMENT;
- break;
- }
- state = base.scheme == 'file' ? FILE : RELATIVE;
- continue;
- case SPECIAL_RELATIVE_OR_AUTHORITY:
- if (char == '/' && codePoints[pointer + 1] == '/') {
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
- pointer++;
- } else {
- state = RELATIVE;
- continue;
- } break;
- case PATH_OR_AUTHORITY:
- if (char == '/') {
- state = AUTHORITY;
- break;
- } else {
- state = PATH;
- continue;
- }
- case RELATIVE:
- url.scheme = base.scheme;
- if (char == EOF) {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.query = base.query;
- } else if (char == '/' || (char == '\\' && isSpecial(url))) {
- state = RELATIVE_SLASH;
- } else if (char == '?') {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.query = base.query;
- url.fragment = '';
- state = FRAGMENT;
- } else {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- url.path = base.path.slice();
- url.path.pop();
- state = PATH;
- continue;
- } break;
- case RELATIVE_SLASH:
- if (isSpecial(url) && (char == '/' || char == '\\')) {
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
- } else if (char == '/') {
- state = AUTHORITY;
- } else {
- url.username = base.username;
- url.password = base.password;
- url.host = base.host;
- url.port = base.port;
- state = PATH;
- continue;
- } break;
- case SPECIAL_AUTHORITY_SLASHES:
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
- if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;
- pointer++;
- break;
- case SPECIAL_AUTHORITY_IGNORE_SLASHES:
- if (char != '/' && char != '\\') {
- state = AUTHORITY;
- continue;
- } break;
- case AUTHORITY:
- if (char == '@') {
- if (seenAt) buffer = '%40' + buffer;
- seenAt = true;
- bufferCodePoints = arrayFrom(buffer);
- for (var i = 0; i < bufferCodePoints.length; i++) {
- var codePoint = bufferCodePoints[i];
- if (codePoint == ':' && !seenPasswordToken) {
- seenPasswordToken = true;
- continue;
- }
- var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
- if (seenPasswordToken) url.password += encodedCodePoints;
- else url.username += encodedCodePoints;
- }
- buffer = '';
- } else if (
- char == EOF || char == '/' || char == '?' || char == '#' ||
- (char == '\\' && isSpecial(url))
- ) {
- if (seenAt && buffer == '') return INVALID_AUTHORITY;
- pointer -= arrayFrom(buffer).length + 1;
- buffer = '';
- state = HOST;
- } else buffer += char;
- break;
- case HOST:
- case HOSTNAME:
- if (stateOverride && url.scheme == 'file') {
- state = FILE_HOST;
- continue;
- } else if (char == ':' && !seenBracket) {
- if (buffer == '') return INVALID_HOST;
- failure = parseHost(url, buffer);
- if (failure) return failure;
- buffer = '';
- state = PORT;
- if (stateOverride == HOSTNAME) return;
- } else if (
- char == EOF || char == '/' || char == '?' || char == '#' ||
- (char == '\\' && isSpecial(url))
- ) {
- if (isSpecial(url) && buffer == '') return INVALID_HOST;
- if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
- failure = parseHost(url, buffer);
- if (failure) return failure;
- buffer = '';
- state = PATH_START;
- if (stateOverride) return;
- continue;
- } else {
- if (char == '[') seenBracket = true;
- else if (char == ']') seenBracket = false;
- buffer += char;
- } break;
- case PORT:
- if (DIGIT.test(char)) {
- buffer += char;
- } else if (
- char == EOF || char == '/' || char == '?' || char == '#' ||
- (char == '\\' && isSpecial(url)) ||
- stateOverride
- ) {
- if (buffer != '') {
- var port = parseInt(buffer, 10);
- if (port > 0xFFFF) return INVALID_PORT;
- url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
- buffer = '';
- }
- if (stateOverride) return;
- state = PATH_START;
- continue;
- } else return INVALID_PORT;
- break;
- case FILE:
- url.scheme = 'file';
- if (char == '/' || char == '\\') state = FILE_SLASH;
- else if (base && base.scheme == 'file') {
- if (char == EOF) {
- url.host = base.host;
- url.path = base.path.slice();
- url.query = base.query;
- } else if (char == '?') {
- url.host = base.host;
- url.path = base.path.slice();
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.host = base.host;
- url.path = base.path.slice();
- url.query = base.query;
- url.fragment = '';
- state = FRAGMENT;
- } else {
- if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
- url.host = base.host;
- url.path = base.path.slice();
- shortenURLsPath(url);
- }
- state = PATH;
- continue;
- }
- } else {
- state = PATH;
- continue;
- } break;
- case FILE_SLASH:
- if (char == '/' || char == '\\') {
- state = FILE_HOST;
- break;
- }
- if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
- if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
- else url.host = base.host;
- }
- state = PATH;
- continue;
- case FILE_HOST:
- if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') {
- if (!stateOverride && isWindowsDriveLetter(buffer)) {
- state = PATH;
- } else if (buffer == '') {
- url.host = '';
- if (stateOverride) return;
- state = PATH_START;
- } else {
- failure = parseHost(url, buffer);
- if (failure) return failure;
- if (url.host == 'localhost') url.host = '';
- if (stateOverride) return;
- buffer = '';
- state = PATH_START;
- } continue;
- } else buffer += char;
- break;
- case PATH_START:
- if (isSpecial(url)) {
- state = PATH;
- if (char != '/' && char != '\\') continue;
- } else if (!stateOverride && char == '?') {
- url.query = '';
- state = QUERY;
- } else if (!stateOverride && char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- } else if (char != EOF) {
- state = PATH;
- if (char != '/') continue;
- } break;
- case PATH:
- if (
- char == EOF || char == '/' ||
- (char == '\\' && isSpecial(url)) ||
- (!stateOverride && (char == '?' || char == '#'))
- ) {
- if (isDoubleDot(buffer)) {
- shortenURLsPath(url);
- if (char != '/' && !(char == '\\' && isSpecial(url))) {
- url.path.push('');
- }
- } else if (isSingleDot(buffer)) {
- if (char != '/' && !(char == '\\' && isSpecial(url))) {
- url.path.push('');
- }
- } else {
- if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
- if (url.host) url.host = '';
- buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
- }
- url.path.push(buffer);
- }
- buffer = '';
- if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {
- while (url.path.length > 1 && url.path[0] === '') {
- url.path.shift();
- }
- }
- if (char == '?') {
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- }
- } else {
- buffer += percentEncode(char, pathPercentEncodeSet);
- } break;
- case CANNOT_BE_A_BASE_URL_PATH:
- if (char == '?') {
- url.query = '';
- state = QUERY;
- } else if (char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- } else if (char != EOF) {
- url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);
- } break;
- case QUERY:
- if (!stateOverride && char == '#') {
- url.fragment = '';
- state = FRAGMENT;
- } else if (char != EOF) {
- if (char == "'" && isSpecial(url)) url.query += '%27';
- else if (char == '#') url.query += '%23';
- else url.query += percentEncode(char, C0ControlPercentEncodeSet);
- } break;
- case FRAGMENT:
- if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);
- break;
- }
- pointer++;
- }
- };
- // `URL` constructor
- // https://url.spec.whatwg.org/#url-class
- var URLConstructor = function URL(url /* , base */) {
- var that = anInstance(this, URLConstructor, 'URL');
- var base = arguments.length > 1 ? arguments[1] : undefined;
- var urlString = String(url);
- var state = setInternalState(that, { type: 'URL' });
- var baseState, failure;
- if (base !== undefined) {
- if (base instanceof URLConstructor) baseState = getInternalURLState(base);
- else {
- failure = parseURL(baseState = {}, String(base));
- if (failure) throw TypeError(failure);
- }
- }
- failure = parseURL(state, urlString, null, baseState);
- if (failure) throw TypeError(failure);
- var searchParams = state.searchParams = new URLSearchParams();
- var searchParamsState = getInternalSearchParamsState(searchParams);
- searchParamsState.updateSearchParams(state.query);
- searchParamsState.updateURL = function () {
- state.query = String(searchParams) || null;
- };
- if (!DESCRIPTORS) {
- that.href = serializeURL.call(that);
- that.origin = getOrigin.call(that);
- that.protocol = getProtocol.call(that);
- that.username = getUsername.call(that);
- that.password = getPassword.call(that);
- that.host = getHost.call(that);
- that.hostname = getHostname.call(that);
- that.port = getPort.call(that);
- that.pathname = getPathname.call(that);
- that.search = getSearch.call(that);
- that.searchParams = getSearchParams.call(that);
- that.hash = getHash.call(that);
- }
- };
- var URLPrototype = URLConstructor.prototype;
- var serializeURL = function () {
- var url = getInternalURLState(this);
- var scheme = url.scheme;
- var username = url.username;
- var password = url.password;
- var host = url.host;
- var port = url.port;
- var path = url.path;
- var query = url.query;
- var fragment = url.fragment;
- var output = scheme + ':';
- if (host !== null) {
- output += '//';
- if (includesCredentials(url)) {
- output += username + (password ? ':' + password : '') + '@';
- }
- output += serializeHost(host);
- if (port !== null) output += ':' + port;
- } else if (scheme == 'file') output += '//';
- output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
- if (query !== null) output += '?' + query;
- if (fragment !== null) output += '#' + fragment;
- return output;
- };
- var getOrigin = function () {
- var url = getInternalURLState(this);
- var scheme = url.scheme;
- var port = url.port;
- if (scheme == 'blob') try {
- return new URL(scheme.path[0]).origin;
- } catch (error) {
- return 'null';
- }
- if (scheme == 'file' || !isSpecial(url)) return 'null';
- return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
- };
- var getProtocol = function () {
- return getInternalURLState(this).scheme + ':';
- };
- var getUsername = function () {
- return getInternalURLState(this).username;
- };
- var getPassword = function () {
- return getInternalURLState(this).password;
- };
- var getHost = function () {
- var url = getInternalURLState(this);
- var host = url.host;
- var port = url.port;
- return host === null ? ''
- : port === null ? serializeHost(host)
- : serializeHost(host) + ':' + port;
- };
- var getHostname = function () {
- var host = getInternalURLState(this).host;
- return host === null ? '' : serializeHost(host);
- };
- var getPort = function () {
- var port = getInternalURLState(this).port;
- return port === null ? '' : String(port);
- };
- var getPathname = function () {
- var url = getInternalURLState(this);
- var path = url.path;
- return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
- };
- var getSearch = function () {
- var query = getInternalURLState(this).query;
- return query ? '?' + query : '';
- };
- var getSearchParams = function () {
- return getInternalURLState(this).searchParams;
- };
- var getHash = function () {
- var fragment = getInternalURLState(this).fragment;
- return fragment ? '#' + fragment : '';
- };
- var accessorDescriptor = function (getter, setter) {
- return { get: getter, set: setter, configurable: true, enumerable: true };
- };
- if (DESCRIPTORS) {
- defineProperties(URLPrototype, {
- // `URL.prototype.href` accessors pair
- // https://url.spec.whatwg.org/#dom-url-href
- href: accessorDescriptor(serializeURL, function (href) {
- var url = getInternalURLState(this);
- var urlString = String(href);
- var failure = parseURL(url, urlString);
- if (failure) throw TypeError(failure);
- getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
- }),
- // `URL.prototype.origin` getter
- // https://url.spec.whatwg.org/#dom-url-origin
- origin: accessorDescriptor(getOrigin),
- // `URL.prototype.protocol` accessors pair
- // https://url.spec.whatwg.org/#dom-url-protocol
- protocol: accessorDescriptor(getProtocol, function (protocol) {
- var url = getInternalURLState(this);
- parseURL(url, String(protocol) + ':', SCHEME_START);
- }),
- // `URL.prototype.username` accessors pair
- // https://url.spec.whatwg.org/#dom-url-username
- username: accessorDescriptor(getUsername, function (username) {
- var url = getInternalURLState(this);
- var codePoints = arrayFrom(String(username));
- if (cannotHaveUsernamePasswordPort(url)) return;
- url.username = '';
- for (var i = 0; i < codePoints.length; i++) {
- url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
- }
- }),
- // `URL.prototype.password` accessors pair
- // https://url.spec.whatwg.org/#dom-url-password
- password: accessorDescriptor(getPassword, function (password) {
- var url = getInternalURLState(this);
- var codePoints = arrayFrom(String(password));
- if (cannotHaveUsernamePasswordPort(url)) return;
- url.password = '';
- for (var i = 0; i < codePoints.length; i++) {
- url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
- }
- }),
- // `URL.prototype.host` accessors pair
- // https://url.spec.whatwg.org/#dom-url-host
- host: accessorDescriptor(getHost, function (host) {
- var url = getInternalURLState(this);
- if (url.cannotBeABaseURL) return;
- parseURL(url, String(host), HOST);
- }),
- // `URL.prototype.hostname` accessors pair
- // https://url.spec.whatwg.org/#dom-url-hostname
- hostname: accessorDescriptor(getHostname, function (hostname) {
- var url = getInternalURLState(this);
- if (url.cannotBeABaseURL) return;
- parseURL(url, String(hostname), HOSTNAME);
- }),
- // `URL.prototype.port` accessors pair
- // https://url.spec.whatwg.org/#dom-url-port
- port: accessorDescriptor(getPort, function (port) {
- var url = getInternalURLState(this);
- if (cannotHaveUsernamePasswordPort(url)) return;
- port = String(port);
- if (port == '') url.port = null;
- else parseURL(url, port, PORT);
- }),
- // `URL.prototype.pathname` accessors pair
- // https://url.spec.whatwg.org/#dom-url-pathname
- pathname: accessorDescriptor(getPathname, function (pathname) {
- var url = getInternalURLState(this);
- if (url.cannotBeABaseURL) return;
- url.path = [];
- parseURL(url, pathname + '', PATH_START);
- }),
- // `URL.prototype.search` accessors pair
- // https://url.spec.whatwg.org/#dom-url-search
- search: accessorDescriptor(getSearch, function (search) {
- var url = getInternalURLState(this);
- search = String(search);
- if (search == '') {
- url.query = null;
- } else {
- if ('?' == search.charAt(0)) search = search.slice(1);
- url.query = '';
- parseURL(url, search, QUERY);
- }
- getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
- }),
- // `URL.prototype.searchParams` getter
- // https://url.spec.whatwg.org/#dom-url-searchparams
- searchParams: accessorDescriptor(getSearchParams),
- // `URL.prototype.hash` accessors pair
- // https://url.spec.whatwg.org/#dom-url-hash
- hash: accessorDescriptor(getHash, function (hash) {
- var url = getInternalURLState(this);
- hash = String(hash);
- if (hash == '') {
- url.fragment = null;
- return;
- }
- if ('#' == hash.charAt(0)) hash = hash.slice(1);
- url.fragment = '';
- parseURL(url, hash, FRAGMENT);
- })
- });
- }
- // `URL.prototype.toJSON` method
- // https://url.spec.whatwg.org/#dom-url-tojson
- redefine(URLPrototype, 'toJSON', function toJSON() {
- return serializeURL.call(this);
- }, { enumerable: true });
- // `URL.prototype.toString` method
- // https://url.spec.whatwg.org/#URL-stringification-behavior
- redefine(URLPrototype, 'toString', function toString() {
- return serializeURL.call(this);
- }, { enumerable: true });
- if (NativeURL) {
- var nativeCreateObjectURL = NativeURL.createObjectURL;
- var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
- // `URL.createObjectURL` method
- // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
- return nativeCreateObjectURL.apply(NativeURL, arguments);
- });
- // `URL.revokeObjectURL` method
- // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
- return nativeRevokeObjectURL.apply(NativeURL, arguments);
- });
- }
- setToStringTag(URLConstructor, 'URL');
- $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
- URL: URLConstructor
- });
- /***/ })
- /******/ });
- /************************************************************************/
- /******/ // The module cache
- /******/ var __webpack_module_cache__ = {};
- /******/
- /******/ // The require function
- /******/ function __nested_webpack_require_210484__(moduleId) {
- /******/ // Check if module is in cache
- /******/ if(__webpack_module_cache__[moduleId]) {
- /******/ return __webpack_module_cache__[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = __webpack_module_cache__[moduleId] = {
- /******/ // no module.id needed
- /******/ // no module.loaded needed
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_210484__);
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /************************************************************************/
- /******/ /* webpack/runtime/define property getters */
- /******/ !function() {
- /******/ // define getter functions for harmony exports
- /******/ __nested_webpack_require_210484__.d = function(exports, definition) {
- /******/ for(var key in definition) {
- /******/ if(__nested_webpack_require_210484__.o(definition, key) && !__nested_webpack_require_210484__.o(exports, key)) {
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
- /******/ }
- /******/ }
- /******/ };
- /******/ }();
- /******/
- /******/ /* webpack/runtime/global */
- /******/ !function() {
- /******/ __nested_webpack_require_210484__.g = (function() {
- /******/ if (typeof globalThis === 'object') return globalThis;
- /******/ try {
- /******/ return this || new Function('return this')();
- /******/ } catch (e) {
- /******/ if (typeof window === 'object') return window;
- /******/ }
- /******/ })();
- /******/ }();
- /******/
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
- /******/ !function() {
- /******/ __nested_webpack_require_210484__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
- /******/ }();
- /******/
- /******/ /* webpack/runtime/make namespace object */
- /******/ !function() {
- /******/ // define __esModule on exports
- /******/ __nested_webpack_require_210484__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/ }();
- /******/
- /************************************************************************/
- var __webpack_exports__ = {};
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
- !function() {
- "use strict";
- // ESM COMPAT FLAG
- __nested_webpack_require_210484__.r(__webpack_exports__);
- // EXPORTS
- __nested_webpack_require_210484__.d(__webpack_exports__, {
- "Dropzone": function() { return /* reexport */ Dropzone; },
- "default": function() { return /* binding */ dropzone_dist; }
- });
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
- var es_array_concat = __nested_webpack_require_210484__(2222);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
- var es_array_filter = __nested_webpack_require_210484__(7327);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.index-of.js
- var es_array_index_of = __nested_webpack_require_210484__(2772);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
- var es_array_iterator = __nested_webpack_require_210484__(6992);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
- var es_array_map = __nested_webpack_require_210484__(1249);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
- var es_array_slice = __nested_webpack_require_210484__(7042);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
- var es_array_splice = __nested_webpack_require_210484__(561);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array-buffer.constructor.js
- var es_array_buffer_constructor = __nested_webpack_require_210484__(8264);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
- var es_function_name = __nested_webpack_require_210484__(8309);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-prototype-of.js
- var es_object_get_prototype_of = __nested_webpack_require_210484__(489);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
- var es_object_to_string = __nested_webpack_require_210484__(1539);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
- var es_regexp_exec = __nested_webpack_require_210484__(4916);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
- var es_regexp_to_string = __nested_webpack_require_210484__(9714);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
- var es_string_iterator = __nested_webpack_require_210484__(8783);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
- var es_string_match = __nested_webpack_require_210484__(4723);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
- var es_string_replace = __nested_webpack_require_210484__(5306);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
- var es_string_split = __nested_webpack_require_210484__(3123);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
- var es_string_trim = __nested_webpack_require_210484__(3210);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.uint8-array.js
- var es_typed_array_uint8_array = __nested_webpack_require_210484__(2472);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.copy-within.js
- var es_typed_array_copy_within = __nested_webpack_require_210484__(2990);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.every.js
- var es_typed_array_every = __nested_webpack_require_210484__(8927);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.fill.js
- var es_typed_array_fill = __nested_webpack_require_210484__(3105);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.filter.js
- var es_typed_array_filter = __nested_webpack_require_210484__(5035);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.find.js
- var es_typed_array_find = __nested_webpack_require_210484__(4345);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.find-index.js
- var es_typed_array_find_index = __nested_webpack_require_210484__(7174);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.for-each.js
- var es_typed_array_for_each = __nested_webpack_require_210484__(2846);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.includes.js
- var es_typed_array_includes = __nested_webpack_require_210484__(4731);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.index-of.js
- var es_typed_array_index_of = __nested_webpack_require_210484__(7209);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.iterator.js
- var es_typed_array_iterator = __nested_webpack_require_210484__(6319);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.join.js
- var es_typed_array_join = __nested_webpack_require_210484__(8867);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.last-index-of.js
- var es_typed_array_last_index_of = __nested_webpack_require_210484__(7789);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.map.js
- var es_typed_array_map = __nested_webpack_require_210484__(3739);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.reduce.js
- var es_typed_array_reduce = __nested_webpack_require_210484__(9368);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.reduce-right.js
- var es_typed_array_reduce_right = __nested_webpack_require_210484__(4483);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.reverse.js
- var es_typed_array_reverse = __nested_webpack_require_210484__(2056);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.set.js
- var es_typed_array_set = __nested_webpack_require_210484__(3462);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.slice.js
- var es_typed_array_slice = __nested_webpack_require_210484__(678);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.some.js
- var es_typed_array_some = __nested_webpack_require_210484__(7462);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.sort.js
- var es_typed_array_sort = __nested_webpack_require_210484__(3824);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.subarray.js
- var es_typed_array_subarray = __nested_webpack_require_210484__(5021);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.to-locale-string.js
- var es_typed_array_to_locale_string = __nested_webpack_require_210484__(2974);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.to-string.js
- var es_typed_array_to_string = __nested_webpack_require_210484__(5016);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
- var web_dom_collections_for_each = __nested_webpack_require_210484__(4747);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
- var web_dom_collections_iterator = __nested_webpack_require_210484__(3948);
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
- var web_url = __nested_webpack_require_210484__(285);
- ;// CONCATENATED MODULE: ./src/emitter.js
- function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
- // The Emitter class provides the ability to call `.on()` on Dropzone to listen
- // to events.
- // It is strongly based on component's emitter class, and I removed the
- // functionality because of the dependency hell with different frameworks.
- var Emitter = /*#__PURE__*/function () {
- function Emitter() {
- _classCallCheck(this, Emitter);
- }
- _createClass(Emitter, [{
- key: "on",
- value: // Add an event listener for given event
- function on(event, fn) {
- this._callbacks = this._callbacks || {}; // Create namespace for this event
- if (!this._callbacks[event]) {
- this._callbacks[event] = [];
- }
- this._callbacks[event].push(fn);
- return this;
- }
- }, {
- key: "emit",
- value: function emit(event) {
- this._callbacks = this._callbacks || {};
- var callbacks = this._callbacks[event];
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- if (callbacks) {
- var _iterator = _createForOfIteratorHelper(callbacks, true),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var callback = _step.value;
- callback.apply(this, args);
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- } // trigger a corresponding DOM event
- if (this.element) {
- this.element.dispatchEvent(this.makeEvent("dropzone:" + event, {
- args: args
- }));
- }
- return this;
- }
- }, {
- key: "makeEvent",
- value: function makeEvent(eventName, detail) {
- var params = {
- bubbles: true,
- cancelable: true,
- detail: detail
- };
- if (typeof window.CustomEvent === "function") {
- return new CustomEvent(eventName, params);
- } else {
- // IE 11 support
- // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
- var evt = document.createEvent("CustomEvent");
- evt.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail);
- return evt;
- }
- } // Remove event listener for given event. If fn is not provided, all event
- // listeners for that event will be removed. If neither is provided, all
- // event listeners will be removed.
- }, {
- key: "off",
- value: function off(event, fn) {
- if (!this._callbacks || arguments.length === 0) {
- this._callbacks = {};
- return this;
- } // specific event
- var callbacks = this._callbacks[event];
- if (!callbacks) {
- return this;
- } // remove all handlers
- if (arguments.length === 1) {
- delete this._callbacks[event];
- return this;
- } // remove specific handler
- for (var i = 0; i < callbacks.length; i++) {
- var callback = callbacks[i];
- if (callback === fn) {
- callbacks.splice(i, 1);
- break;
- }
- }
- return this;
- }
- }]);
- return Emitter;
- }();
- ;// CONCATENATED MODULE: ./src/preview-template.html
- // Module
- var code = "<div class=\"dz-preview dz-file-preview\"> <div class=\"dz-image\"><img data-dz-thumbnail/></div> <div class=\"dz-details\"> <div class=\"dz-size\"><span data-dz-size></span></div> <div class=\"dz-filename\"><span data-dz-name></span></div> </div> <div class=\"dz-progress\"> <span class=\"dz-upload\" data-dz-uploadprogress></span> </div> <div class=\"dz-error-message\"><span data-dz-errormessage></span></div> <div class=\"dz-success-mark\"> <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"> <title>Check</title> <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"> <path d=\"M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" stroke-opacity=\"0.198794158\" stroke=\"#747474\" fill-opacity=\"0.816519475\" fill=\"#FFFFFF\"></path> </g> </svg> </div> <div class=\"dz-error-mark\"> <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"> <title>Error</title> <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"> <g stroke=\"#747474\" stroke-opacity=\"0.198794158\" fill=\"#FFFFFF\" fill-opacity=\"0.816519475\"> <path d=\"M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\"></path> </g> </g> </svg> </div> </div> ";
- // Exports
- /* harmony default export */ var preview_template = (code);
- ;// CONCATENATED MODULE: ./src/options.js
- function options_createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = options_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
- function options_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return options_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return options_arrayLikeToArray(o, minLen); }
- function options_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- var defaultOptions = {
- /**
- * Has to be specified on elements other than form (or when the form
- * doesn't have an `action` attribute). You can also
- * provide a function that will be called with `files` and
- * must return the url (since `v3.12.0`)
- */
- url: null,
- /**
- * Can be changed to `"put"` if necessary. You can also provide a function
- * that will be called with `files` and must return the method (since `v3.12.0`).
- */
- method: "post",
- /**
- * Will be set on the XHRequest.
- */
- withCredentials: false,
- /**
- * The timeout for the XHR requests in milliseconds (since `v4.4.0`).
- * If set to null or 0, no timeout is going to be set.
- */
- timeout: null,
- /**
- * How many file uploads to process in parallel (See the
- * Enqueuing file uploads documentation section for more info)
- */
- parallelUploads: 2,
- /**
- * Whether to send multiple files in one request. If
- * this it set to true, then the fallback file input element will
- * have the `multiple` attribute as well. This option will
- * also trigger additional events (like `processingmultiple`). See the events
- * documentation section for more information.
- */
- uploadMultiple: false,
- /**
- * Whether you want files to be uploaded in chunks to your server. This can't be
- * used in combination with `uploadMultiple`.
- *
- * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload.
- */
- chunking: false,
- /**
- * If `chunking` is enabled, this defines whether **every** file should be chunked,
- * even if the file size is below chunkSize. This means, that the additional chunk
- * form data will be submitted and the `chunksUploaded` callback will be invoked.
- */
- forceChunking: false,
- /**
- * If `chunking` is `true`, then this defines the chunk size in bytes.
- */
- chunkSize: 2000000,
- /**
- * If `true`, the individual chunks of a file are being uploaded simultaneously.
- */
- parallelChunkUploads: false,
- /**
- * Whether a chunk should be retried if it fails.
- */
- retryChunks: false,
- /**
- * If `retryChunks` is true, how many times should it be retried.
- */
- retryChunksLimit: 3,
- /**
- * The maximum filesize (in bytes) that is allowed to be uploaded.
- */
- maxFilesize: 256,
- /**
- * The name of the file param that gets transferred.
- * **NOTE**: If you have the option `uploadMultiple` set to `true`, then
- * Dropzone will append `[]` to the name.
- */
- paramName: "file",
- /**
- * Whether thumbnails for images should be generated
- */
- createImageThumbnails: true,
- /**
- * In MB. When the filename exceeds this limit, the thumbnail will not be generated.
- */
- maxThumbnailFilesize: 10,
- /**
- * If `null`, the ratio of the image will be used to calculate it.
- */
- thumbnailWidth: 120,
- /**
- * The same as `thumbnailWidth`. If both are null, images will not be resized.
- */
- thumbnailHeight: 120,
- /**
- * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided.
- * Can be either `contain` or `crop`.
- */
- thumbnailMethod: "crop",
- /**
- * If set, images will be resized to these dimensions before being **uploaded**.
- * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect
- * ratio of the file will be preserved.
- *
- * The `options.transformFile` function uses these options, so if the `transformFile` function
- * is overridden, these options don't do anything.
- */
- resizeWidth: null,
- /**
- * See `resizeWidth`.
- */
- resizeHeight: null,
- /**
- * The mime type of the resized image (before it gets uploaded to the server).
- * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`.
- * See `resizeWidth` for more information.
- */
- resizeMimeType: null,
- /**
- * The quality of the resized images. See `resizeWidth`.
- */
- resizeQuality: 0.8,
- /**
- * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided.
- * Can be either `contain` or `crop`.
- */
- resizeMethod: "contain",
- /**
- * The base that is used to calculate the **displayed** filesize. You can
- * change this to 1024 if you would rather display kibibytes, mebibytes,
- * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte`
- * not `1 kilobyte`. You can change this to `1024` if you don't care about
- * validity.
- */
- filesizeBase: 1000,
- /**
- * If not `null` defines how many files this Dropzone handles. If it exceeds,
- * the event `maxfilesexceeded` will be called. The dropzone element gets the
- * class `dz-max-files-reached` accordingly so you can provide visual
- * feedback.
- */
- maxFiles: null,
- /**
- * An optional object to send additional headers to the server. Eg:
- * `{ "My-Awesome-Header": "header value" }`
- */
- headers: null,
- /**
- * If `true`, the dropzone element itself will be clickable, if `false`
- * nothing will be clickable.
- *
- * You can also pass an HTML element, a CSS selector (for multiple elements)
- * or an array of those. In that case, all of those elements will trigger an
- * upload when clicked.
- */
- clickable: true,
- /**
- * Whether hidden files in directories should be ignored.
- */
- ignoreHiddenFiles: true,
- /**
- * The default implementation of `accept` checks the file's mime type or
- * extension against this list. This is a comma separated list of mime
- * types or file extensions.
- *
- * Eg.: `image/*,application/pdf,.psd`
- *
- * If the Dropzone is `clickable` this option will also be used as
- * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept)
- * parameter on the hidden file input as well.
- */
- acceptedFiles: null,
- /**
- * **Deprecated!**
- * Use acceptedFiles instead.
- */
- acceptedMimeTypes: null,
- /**
- * If false, files will be added to the queue but the queue will not be
- * processed automatically.
- * This can be useful if you need some additional user input before sending
- * files (or if you want want all files sent at once).
- * If you're ready to send the file simply call `myDropzone.processQueue()`.
- *
- * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation
- * section for more information.
- */
- autoProcessQueue: true,
- /**
- * If false, files added to the dropzone will not be queued by default.
- * You'll have to call `enqueueFile(file)` manually.
- */
- autoQueue: true,
- /**
- * If `true`, this will add a link to every file preview to remove or cancel (if
- * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation`
- * and `dictRemoveFile` options are used for the wording.
- */
- addRemoveLinks: false,
- /**
- * Defines where to display the file previews – if `null` the
- * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS
- * selector. The element should have the `dropzone-previews` class so
- * the previews are displayed properly.
- */
- previewsContainer: null,
- /**
- * Set this to `true` if you don't want previews to be shown.
- */
- disablePreviews: false,
- /**
- * This is the element the hidden input field (which is used when clicking on the
- * dropzone to trigger file selection) will be appended to. This might
- * be important in case you use frameworks to switch the content of your page.
- *
- * Can be a selector string, or an element directly.
- */
- hiddenInputContainer: "body",
- /**
- * If null, no capture type will be specified
- * If camera, mobile devices will skip the file selection and choose camera
- * If microphone, mobile devices will skip the file selection and choose the microphone
- * If camcorder, mobile devices will skip the file selection and choose the camera in video mode
- * On apple devices multiple must be set to false. AcceptedFiles may need to
- * be set to an appropriate mime type (e.g. "image/*", "audio/*", or "video/*").
- */
- capture: null,
- /**
- * **Deprecated**. Use `renameFile` instead.
- */
- renameFilename: null,
- /**
- * A function that is invoked before the file is uploaded to the server and renames the file.
- * This function gets the `File` as argument and can use the `file.name`. The actual name of the
- * file that gets used during the upload can be accessed through `file.upload.filename`.
- */
- renameFile: null,
- /**
- * If `true` the fallback will be forced. This is very useful to test your server
- * implementations first and make sure that everything works as
- * expected without dropzone if you experience problems, and to test
- * how your fallbacks will look.
- */
- forceFallback: false,
- /**
- * The text used before any files are dropped.
- */
- dictDefaultMessage: "Drop files here to upload",
- /**
- * The text that replaces the default message text it the browser is not supported.
- */
- dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.",
- /**
- * The text that will be added before the fallback form.
- * If you provide a fallback element yourself, or if this option is `null` this will
- * be ignored.
- */
- dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.",
- /**
- * If the filesize is too big.
- * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values.
- */
- dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",
- /**
- * If the file doesn't match the file type.
- */
- dictInvalidFileType: "You can't upload files of this type.",
- /**
- * If the server response was invalid.
- * `{{statusCode}}` will be replaced with the servers status code.
- */
- dictResponseError: "Server responded with {{statusCode}} code.",
- /**
- * If `addRemoveLinks` is true, the text to be used for the cancel upload link.
- */
- dictCancelUpload: "Cancel upload",
- /**
- * The text that is displayed if an upload was manually canceled
- */
- dictUploadCanceled: "Upload canceled.",
- /**
- * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload.
- */
- dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?",
- /**
- * If `addRemoveLinks` is true, the text to be used to remove a file.
- */
- dictRemoveFile: "Remove file",
- /**
- * If this is not null, then the user will be prompted before removing a file.
- */
- dictRemoveFileConfirmation: null,
- /**
- * Displayed if `maxFiles` is st and exceeded.
- * The string `{{maxFiles}}` will be replaced by the configuration value.
- */
- dictMaxFilesExceeded: "You can not upload any more files.",
- /**
- * Allows you to translate the different units. Starting with `tb` for terabytes and going down to
- * `b` for bytes.
- */
- dictFileSizeUnits: {
- tb: "TB",
- gb: "GB",
- mb: "MB",
- kb: "KB",
- b: "b"
- },
- /**
- * Called when dropzone initialized
- * You can add event listeners here
- */
- init: function init() {},
- /**
- * Can be an **object** of additional parameters to transfer to the server, **or** a `Function`
- * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case
- * of a function, this needs to return a map.
- *
- * The default implementation does nothing for normal uploads, but adds relevant information for
- * chunked uploads.
- *
- * This is the same as adding hidden input fields in the form element.
- */
- params: function params(files, xhr, chunk) {
- if (chunk) {
- return {
- dzuuid: chunk.file.upload.uuid,
- dzchunkindex: chunk.index,
- dztotalfilesize: chunk.file.size,
- dzchunksize: this.options.chunkSize,
- dztotalchunkcount: chunk.file.upload.totalChunkCount,
- dzchunkbyteoffset: chunk.index * this.options.chunkSize
- };
- }
- },
- /**
- * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File)
- * and a `done` function as parameters.
- *
- * If the done function is invoked without arguments, the file is "accepted" and will
- * be processed. If you pass an error message, the file is rejected, and the error
- * message will be displayed.
- * This function will not be called if the file is too big or doesn't match the mime types.
- */
- accept: function accept(file, done) {
- return done();
- },
- /**
- * The callback that will be invoked when all chunks have been uploaded for a file.
- * It gets the file for which the chunks have been uploaded as the first parameter,
- * and the `done` function as second. `done()` needs to be invoked when everything
- * needed to finish the upload process is done.
- */
- chunksUploaded: function chunksUploaded(file, done) {
- done();
- },
- /**
- * Gets called when the browser is not supported.
- * The default implementation shows the fallback input field and adds
- * a text.
- */
- fallback: function fallback() {
- // This code should pass in IE7... :(
- var messageElement;
- this.element.className = "".concat(this.element.className, " dz-browser-not-supported");
- var _iterator = options_createForOfIteratorHelper(this.element.getElementsByTagName("div"), true),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var child = _step.value;
- if (/(^| )dz-message($| )/.test(child.className)) {
- messageElement = child;
- child.className = "dz-message"; // Removes the 'dz-default' class
- break;
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- if (!messageElement) {
- messageElement = Dropzone.createElement('<div class="dz-message"><span></span></div>');
- this.element.appendChild(messageElement);
- }
- var span = messageElement.getElementsByTagName("span")[0];
- if (span) {
- if (span.textContent != null) {
- span.textContent = this.options.dictFallbackMessage;
- } else if (span.innerText != null) {
- span.innerText = this.options.dictFallbackMessage;
- }
- }
- return this.element.appendChild(this.getFallbackForm());
- },
- /**
- * Gets called to calculate the thumbnail dimensions.
- *
- * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing:
- *
- * - `srcWidth` & `srcHeight` (required)
- * - `trgWidth` & `trgHeight` (required)
- * - `srcX` & `srcY` (optional, default `0`)
- * - `trgX` & `trgY` (optional, default `0`)
- *
- * Those values are going to be used by `ctx.drawImage()`.
- */
- resize: function resize(file, width, height, resizeMethod) {
- var info = {
- srcX: 0,
- srcY: 0,
- srcWidth: file.width,
- srcHeight: file.height
- };
- var srcRatio = file.width / file.height; // Automatically calculate dimensions if not specified
- if (width == null && height == null) {
- width = info.srcWidth;
- height = info.srcHeight;
- } else if (width == null) {
- width = height * srcRatio;
- } else if (height == null) {
- height = width / srcRatio;
- } // Make sure images aren't upscaled
- width = Math.min(width, info.srcWidth);
- height = Math.min(height, info.srcHeight);
- var trgRatio = width / height;
- if (info.srcWidth > width || info.srcHeight > height) {
- // Image is bigger and needs rescaling
- if (resizeMethod === "crop") {
- if (srcRatio > trgRatio) {
- info.srcHeight = file.height;
- info.srcWidth = info.srcHeight * trgRatio;
- } else {
- info.srcWidth = file.width;
- info.srcHeight = info.srcWidth / trgRatio;
- }
- } else if (resizeMethod === "contain") {
- // Method 'contain'
- if (srcRatio > trgRatio) {
- height = width / srcRatio;
- } else {
- width = height * srcRatio;
- }
- } else {
- throw new Error("Unknown resizeMethod '".concat(resizeMethod, "'"));
- }
- }
- info.srcX = (file.width - info.srcWidth) / 2;
- info.srcY = (file.height - info.srcHeight) / 2;
- info.trgWidth = width;
- info.trgHeight = height;
- return info;
- },
- /**
- * Can be used to transform the file (for example, resize an image if necessary).
- *
- * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes
- * images according to those dimensions.
- *
- * Gets the `file` as the first parameter, and a `done()` function as the second, that needs
- * to be invoked with the file when the transformation is done.
- */
- transformFile: function transformFile(file, done) {
- if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) {
- return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done);
- } else {
- return done(file);
- }
- },
- /**
- * A string that contains the template used for each dropped
- * file. Change it to fulfill your needs but make sure to properly
- * provide all elements.
- *
- * If you want to use an actual HTML element instead of providing a String
- * as a config option, you could create a div with the id `tpl`,
- * put the template inside it and provide the element like this:
- *
- * document
- * .querySelector('#tpl')
- * .innerHTML
- *
- */
- previewTemplate: preview_template,
- /*
- Those functions register themselves to the events on init and handle all
- the user interface specific stuff. Overwriting them won't break the upload
- but can break the way it's displayed.
- You can overwrite them if you don't like the default behavior. If you just
- want to add an additional event handler, register it on the dropzone object
- and don't overwrite those options.
- */
- // Those are self explanatory and simply concern the DragnDrop.
- drop: function drop(e) {
- return this.element.classList.remove("dz-drag-hover");
- },
- dragstart: function dragstart(e) {},
- dragend: function dragend(e) {
- return this.element.classList.remove("dz-drag-hover");
- },
- dragenter: function dragenter(e) {
- return this.element.classList.add("dz-drag-hover");
- },
- dragover: function dragover(e) {
- return this.element.classList.add("dz-drag-hover");
- },
- dragleave: function dragleave(e) {
- return this.element.classList.remove("dz-drag-hover");
- },
- paste: function paste(e) {},
- // Called whenever there are no files left in the dropzone anymore, and the
- // dropzone should be displayed as if in the initial state.
- reset: function reset() {
- return this.element.classList.remove("dz-started");
- },
- // Called when a file is added to the queue
- // Receives `file`
- addedfile: function addedfile(file) {
- var _this = this;
- if (this.element === this.previewsContainer) {
- this.element.classList.add("dz-started");
- }
- if (this.previewsContainer && !this.options.disablePreviews) {
- file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim());
- file.previewTemplate = file.previewElement; // Backwards compatibility
- this.previewsContainer.appendChild(file.previewElement);
- var _iterator2 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-name]"), true),
- _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
- var node = _step2.value;
- node.textContent = file.name;
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- var _iterator3 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-size]"), true),
- _step3;
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
- node = _step3.value;
- node.innerHTML = this.filesize(file.size);
- }
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- if (this.options.addRemoveLinks) {
- file._removeLink = Dropzone.createElement("<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>".concat(this.options.dictRemoveFile, "</a>"));
- file.previewElement.appendChild(file._removeLink);
- }
- var removeFileEvent = function removeFileEvent(e) {
- e.preventDefault();
- e.stopPropagation();
- if (file.status === Dropzone.UPLOADING) {
- return Dropzone.confirm(_this.options.dictCancelUploadConfirmation, function () {
- return _this.removeFile(file);
- });
- } else {
- if (_this.options.dictRemoveFileConfirmation) {
- return Dropzone.confirm(_this.options.dictRemoveFileConfirmation, function () {
- return _this.removeFile(file);
- });
- } else {
- return _this.removeFile(file);
- }
- }
- };
- var _iterator4 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-remove]"), true),
- _step4;
- try {
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
- var removeLink = _step4.value;
- removeLink.addEventListener("click", removeFileEvent);
- }
- } catch (err) {
- _iterator4.e(err);
- } finally {
- _iterator4.f();
- }
- }
- },
- // Called whenever a file is removed.
- removedfile: function removedfile(file) {
- if (file.previewElement != null && file.previewElement.parentNode != null) {
- file.previewElement.parentNode.removeChild(file.previewElement);
- }
- return this._updateMaxFilesReachedClass();
- },
- // Called when a thumbnail has been generated
- // Receives `file` and `dataUrl`
- thumbnail: function thumbnail(file, dataUrl) {
- if (file.previewElement) {
- file.previewElement.classList.remove("dz-file-preview");
- var _iterator5 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-thumbnail]"), true),
- _step5;
- try {
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
- var thumbnailElement = _step5.value;
- thumbnailElement.alt = file.name;
- thumbnailElement.src = dataUrl;
- }
- } catch (err) {
- _iterator5.e(err);
- } finally {
- _iterator5.f();
- }
- return setTimeout(function () {
- return file.previewElement.classList.add("dz-image-preview");
- }, 1);
- }
- },
- // Called whenever an error occurs
- // Receives `file` and `message`
- error: function error(file, message) {
- if (file.previewElement) {
- file.previewElement.classList.add("dz-error");
- if (typeof message !== "string" && message.error) {
- message = message.error;
- }
- var _iterator6 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-errormessage]"), true),
- _step6;
- try {
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
- var node = _step6.value;
- node.textContent = message;
- }
- } catch (err) {
- _iterator6.e(err);
- } finally {
- _iterator6.f();
- }
- }
- },
- errormultiple: function errormultiple() {},
- // Called when a file gets processed. Since there is a cue, not all added
- // files are processed immediately.
- // Receives `file`
- processing: function processing(file) {
- if (file.previewElement) {
- file.previewElement.classList.add("dz-processing");
- if (file._removeLink) {
- return file._removeLink.innerHTML = this.options.dictCancelUpload;
- }
- }
- },
- processingmultiple: function processingmultiple() {},
- // Called whenever the upload progress gets updated.
- // Receives `file`, `progress` (percentage 0-100) and `bytesSent`.
- // To get the total number of bytes of the file, use `file.size`
- uploadprogress: function uploadprogress(file, progress, bytesSent) {
- if (file.previewElement) {
- var _iterator7 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll("[data-dz-uploadprogress]"), true),
- _step7;
- try {
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
- var node = _step7.value;
- node.nodeName === "PROGRESS" ? node.value = progress : node.style.width = "".concat(progress, "%");
- }
- } catch (err) {
- _iterator7.e(err);
- } finally {
- _iterator7.f();
- }
- }
- },
- // Called whenever the total upload progress gets updated.
- // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent
- totaluploadprogress: function totaluploadprogress() {},
- // Called just before the file is sent. Gets the `xhr` object as second
- // parameter, so you can modify it (for example to add a CSRF token) and a
- // `formData` object to add additional information.
- sending: function sending() {},
- sendingmultiple: function sendingmultiple() {},
- // When the complete upload is finished and successful
- // Receives `file`
- success: function success(file) {
- if (file.previewElement) {
- return file.previewElement.classList.add("dz-success");
- }
- },
- successmultiple: function successmultiple() {},
- // When the upload is canceled.
- canceled: function canceled(file) {
- return this.emit("error", file, this.options.dictUploadCanceled);
- },
- canceledmultiple: function canceledmultiple() {},
- // When the upload is finished, either with success or an error.
- // Receives `file`
- complete: function complete(file) {
- if (file._removeLink) {
- file._removeLink.innerHTML = this.options.dictRemoveFile;
- }
- if (file.previewElement) {
- return file.previewElement.classList.add("dz-complete");
- }
- },
- completemultiple: function completemultiple() {},
- maxfilesexceeded: function maxfilesexceeded() {},
- maxfilesreached: function maxfilesreached() {},
- queuecomplete: function queuecomplete() {},
- addedfiles: function addedfiles() {}
- };
- /* harmony default export */ var src_options = (defaultOptions);
- ;// CONCATENATED MODULE: ./src/dropzone.js
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
- function dropzone_createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = dropzone_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
- function dropzone_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return dropzone_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return dropzone_arrayLikeToArray(o, minLen); }
- function dropzone_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- function dropzone_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function dropzone_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
- function dropzone_createClass(Constructor, protoProps, staticProps) { if (protoProps) dropzone_defineProperties(Constructor.prototype, protoProps); if (staticProps) dropzone_defineProperties(Constructor, staticProps); return Constructor; }
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
- var Dropzone = /*#__PURE__*/function (_Emitter) {
- _inherits(Dropzone, _Emitter);
- var _super = _createSuper(Dropzone);
- function Dropzone(el, options) {
- var _this;
- dropzone_classCallCheck(this, Dropzone);
- _this = _super.call(this);
- var fallback, left;
- _this.element = el; // For backwards compatibility since the version was in the prototype previously
- _this.version = Dropzone.version;
- _this.clickableElements = [];
- _this.listeners = [];
- _this.files = []; // All files
- if (typeof _this.element === "string") {
- _this.element = document.querySelector(_this.element);
- } // Not checking if instance of HTMLElement or Element since IE9 is extremely weird.
- if (!_this.element || _this.element.nodeType == null) {
- throw new Error("Invalid dropzone element.");
- }
- if (_this.element.dropzone) {
- throw new Error("Dropzone already attached.");
- } // Now add this dropzone to the instances.
- Dropzone.instances.push(_assertThisInitialized(_this)); // Put the dropzone inside the element itself.
- _this.element.dropzone = _assertThisInitialized(_this);
- var elementOptions = (left = Dropzone.optionsForElement(_this.element)) != null ? left : {};
- _this.options = Dropzone.extend({}, src_options, elementOptions, options != null ? options : {});
- _this.options.previewTemplate = _this.options.previewTemplate.replace(/\n*/g, ""); // If the browser failed, just call the fallback and leave
- if (_this.options.forceFallback || !Dropzone.isBrowserSupported()) {
- return _possibleConstructorReturn(_this, _this.options.fallback.call(_assertThisInitialized(_this)));
- } // @options.url = @element.getAttribute "action" unless @options.url?
- if (_this.options.url == null) {
- _this.options.url = _this.element.getAttribute("action");
- }
- if (!_this.options.url) {
- throw new Error("No URL provided.");
- }
- if (_this.options.acceptedFiles && _this.options.acceptedMimeTypes) {
- throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");
- }
- if (_this.options.uploadMultiple && _this.options.chunking) {
- throw new Error("You cannot set both: uploadMultiple and chunking.");
- } // Backwards compatibility
- if (_this.options.acceptedMimeTypes) {
- _this.options.acceptedFiles = _this.options.acceptedMimeTypes;
- delete _this.options.acceptedMimeTypes;
- } // Backwards compatibility
- if (_this.options.renameFilename != null) {
- _this.options.renameFile = function (file) {
- return _this.options.renameFilename.call(_assertThisInitialized(_this), file.name, file);
- };
- }
- if (typeof _this.options.method === "string") {
- _this.options.method = _this.options.method.toUpperCase();
- }
- if ((fallback = _this.getExistingFallback()) && fallback.parentNode) {
- // Remove the fallback
- fallback.parentNode.removeChild(fallback);
- } // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false
- if (_this.options.previewsContainer !== false) {
- if (_this.options.previewsContainer) {
- _this.previewsContainer = Dropzone.getElement(_this.options.previewsContainer, "previewsContainer");
- } else {
- _this.previewsContainer = _this.element;
- }
- }
- if (_this.options.clickable) {
- if (_this.options.clickable === true) {
- _this.clickableElements = [_this.element];
- } else {
- _this.clickableElements = Dropzone.getElements(_this.options.clickable, "clickable");
- }
- }
- _this.init();
- return _this;
- } // Returns all files that have been accepted
- dropzone_createClass(Dropzone, [{
- key: "getAcceptedFiles",
- value: function getAcceptedFiles() {
- return this.files.filter(function (file) {
- return file.accepted;
- }).map(function (file) {
- return file;
- });
- } // Returns all files that have been rejected
- // Not sure when that's going to be useful, but added for completeness.
- }, {
- key: "getRejectedFiles",
- value: function getRejectedFiles() {
- return this.files.filter(function (file) {
- return !file.accepted;
- }).map(function (file) {
- return file;
- });
- }
- }, {
- key: "getFilesWithStatus",
- value: function getFilesWithStatus(status) {
- return this.files.filter(function (file) {
- return file.status === status;
- }).map(function (file) {
- return file;
- });
- } // Returns all files that are in the queue
- }, {
- key: "getQueuedFiles",
- value: function getQueuedFiles() {
- return this.getFilesWithStatus(Dropzone.QUEUED);
- }
- }, {
- key: "getUploadingFiles",
- value: function getUploadingFiles() {
- return this.getFilesWithStatus(Dropzone.UPLOADING);
- }
- }, {
- key: "getAddedFiles",
- value: function getAddedFiles() {
- return this.getFilesWithStatus(Dropzone.ADDED);
- } // Files that are either queued or uploading
- }, {
- key: "getActiveFiles",
- value: function getActiveFiles() {
- return this.files.filter(function (file) {
- return file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED;
- }).map(function (file) {
- return file;
- });
- } // The function that gets called when Dropzone is initialized. You
- // can (and should) setup event listeners inside this function.
- }, {
- key: "init",
- value: function init() {
- var _this2 = this;
- // In case it isn't set already
- if (this.element.tagName === "form") {
- this.element.setAttribute("enctype", "multipart/form-data");
- }
- if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) {
- this.element.appendChild(Dropzone.createElement("<div class=\"dz-default dz-message\"><button class=\"dz-button\" type=\"button\">".concat(this.options.dictDefaultMessage, "</button></div>")));
- }
- if (this.clickableElements.length) {
- var setupHiddenFileInput = function setupHiddenFileInput() {
- if (_this2.hiddenFileInput) {
- _this2.hiddenFileInput.parentNode.removeChild(_this2.hiddenFileInput);
- }
- _this2.hiddenFileInput = document.createElement("input");
- _this2.hiddenFileInput.setAttribute("type", "file");
- if (_this2.options.maxFiles === null || _this2.options.maxFiles > 1) {
- _this2.hiddenFileInput.setAttribute("multiple", "multiple");
- }
- _this2.hiddenFileInput.className = "dz-hidden-input";
- if (_this2.options.acceptedFiles !== null) {
- _this2.hiddenFileInput.setAttribute("accept", _this2.options.acceptedFiles);
- }
- if (_this2.options.capture !== null) {
- _this2.hiddenFileInput.setAttribute("capture", _this2.options.capture);
- } // Making sure that no one can "tab" into this field.
- _this2.hiddenFileInput.setAttribute("tabindex", "-1"); // Not setting `display="none"` because some browsers don't accept clicks
- // on elements that aren't displayed.
- _this2.hiddenFileInput.style.visibility = "hidden";
- _this2.hiddenFileInput.style.position = "absolute";
- _this2.hiddenFileInput.style.top = "0";
- _this2.hiddenFileInput.style.left = "0";
- _this2.hiddenFileInput.style.height = "0";
- _this2.hiddenFileInput.style.width = "0";
- Dropzone.getElement(_this2.options.hiddenInputContainer, "hiddenInputContainer").appendChild(_this2.hiddenFileInput);
- _this2.hiddenFileInput.addEventListener("change", function () {
- var files = _this2.hiddenFileInput.files;
- if (files.length) {
- var _iterator = dropzone_createForOfIteratorHelper(files, true),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var file = _step.value;
- _this2.addFile(file);
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- }
- _this2.emit("addedfiles", files);
- setupHiddenFileInput();
- });
- };
- setupHiddenFileInput();
- }
- this.URL = window.URL !== null ? window.URL : window.webkitURL; // Setup all event listeners on the Dropzone object itself.
- // They're not in @setupEventListeners() because they shouldn't be removed
- // again when the dropzone gets disabled.
- var _iterator2 = dropzone_createForOfIteratorHelper(this.events, true),
- _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
- var eventName = _step2.value;
- this.on(eventName, this.options[eventName]);
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- this.on("uploadprogress", function () {
- return _this2.updateTotalUploadProgress();
- });
- this.on("removedfile", function () {
- return _this2.updateTotalUploadProgress();
- });
- this.on("canceled", function (file) {
- return _this2.emit("complete", file);
- }); // Emit a `queuecomplete` event if all files finished uploading.
- this.on("complete", function (file) {
- if (_this2.getAddedFiles().length === 0 && _this2.getUploadingFiles().length === 0 && _this2.getQueuedFiles().length === 0) {
- // This needs to be deferred so that `queuecomplete` really triggers after `complete`
- return setTimeout(function () {
- return _this2.emit("queuecomplete");
- }, 0);
- }
- });
- var containsFiles = function containsFiles(e) {
- if (e.dataTransfer.types) {
- // Because e.dataTransfer.types is an Object in
- // IE, we need to iterate like this instead of
- // using e.dataTransfer.types.some()
- for (var i = 0; i < e.dataTransfer.types.length; i++) {
- if (e.dataTransfer.types[i] === "Files") return true;
- }
- }
- return false;
- };
- var noPropagation = function noPropagation(e) {
- // If there are no files, we don't want to stop
- // propagation so we don't interfere with other
- // drag and drop behaviour.
- if (!containsFiles(e)) return;
- e.stopPropagation();
- if (e.preventDefault) {
- return e.preventDefault();
- } else {
- return e.returnValue = false;
- }
- }; // Create the listeners
- this.listeners = [{
- element: this.element,
- events: {
- dragstart: function dragstart(e) {
- return _this2.emit("dragstart", e);
- },
- dragenter: function dragenter(e) {
- noPropagation(e);
- return _this2.emit("dragenter", e);
- },
- dragover: function dragover(e) {
- // Makes it possible to drag files from chrome's download bar
- // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar
- // Try is required to prevent bug in Internet Explorer 11 (SCRIPT65535 exception)
- var efct;
- try {
- efct = e.dataTransfer.effectAllowed;
- } catch (error) {}
- e.dataTransfer.dropEffect = "move" === efct || "linkMove" === efct ? "move" : "copy";
- noPropagation(e);
- return _this2.emit("dragover", e);
- },
- dragleave: function dragleave(e) {
- return _this2.emit("dragleave", e);
- },
- drop: function drop(e) {
- noPropagation(e);
- return _this2.drop(e);
- },
- dragend: function dragend(e) {
- return _this2.emit("dragend", e);
- }
- } // This is disabled right now, because the browsers don't implement it properly.
- // "paste": (e) =>
- // noPropagation e
- // @paste e
- }];
- this.clickableElements.forEach(function (clickableElement) {
- return _this2.listeners.push({
- element: clickableElement,
- events: {
- click: function click(evt) {
- // Only the actual dropzone or the message element should trigger file selection
- if (clickableElement !== _this2.element || evt.target === _this2.element || Dropzone.elementInside(evt.target, _this2.element.querySelector(".dz-message"))) {
- _this2.hiddenFileInput.click(); // Forward the click
- }
- return true;
- }
- }
- });
- });
- this.enable();
- return this.options.init.call(this);
- } // Not fully tested yet
- }, {
- key: "destroy",
- value: function destroy() {
- this.disable();
- this.removeAllFiles(true);
- if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) {
- this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);
- this.hiddenFileInput = null;
- }
- delete this.element.dropzone;
- return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);
- }
- }, {
- key: "updateTotalUploadProgress",
- value: function updateTotalUploadProgress() {
- var totalUploadProgress;
- var totalBytesSent = 0;
- var totalBytes = 0;
- var activeFiles = this.getActiveFiles();
- if (activeFiles.length) {
- var _iterator3 = dropzone_createForOfIteratorHelper(this.getActiveFiles(), true),
- _step3;
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
- var file = _step3.value;
- totalBytesSent += file.upload.bytesSent;
- totalBytes += file.upload.total;
- }
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- totalUploadProgress = 100 * totalBytesSent / totalBytes;
- } else {
- totalUploadProgress = 100;
- }
- return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent);
- } // @options.paramName can be a function taking one parameter rather than a string.
- // A parameter name for a file is obtained simply by calling this with an index number.
- }, {
- key: "_getParamName",
- value: function _getParamName(n) {
- if (typeof this.options.paramName === "function") {
- return this.options.paramName(n);
- } else {
- return "".concat(this.options.paramName).concat(this.options.uploadMultiple ? "[".concat(n, "]") : "");
- }
- } // If @options.renameFile is a function,
- // the function will be used to rename the file.name before appending it to the formData
- }, {
- key: "_renameFile",
- value: function _renameFile(file) {
- if (typeof this.options.renameFile !== "function") {
- return file.name;
- }
- return this.options.renameFile(file);
- } // Returns a form that can be used as fallback if the browser does not support DragnDrop
- //
- // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided.
- // This code has to pass in IE7 :(
- }, {
- key: "getFallbackForm",
- value: function getFallbackForm() {
- var existingFallback, form;
- if (existingFallback = this.getExistingFallback()) {
- return existingFallback;
- }
- var fieldsString = '<div class="dz-fallback">';
- if (this.options.dictFallbackText) {
- fieldsString += "<p>".concat(this.options.dictFallbackText, "</p>");
- }
- fieldsString += "<input type=\"file\" name=\"".concat(this._getParamName(0), "\" ").concat(this.options.uploadMultiple ? 'multiple="multiple"' : undefined, " /><input type=\"submit\" value=\"Upload!\"></div>");
- var fields = Dropzone.createElement(fieldsString);
- if (this.element.tagName !== "FORM") {
- form = Dropzone.createElement("<form action=\"".concat(this.options.url, "\" enctype=\"multipart/form-data\" method=\"").concat(this.options.method, "\"></form>"));
- form.appendChild(fields);
- } else {
- // Make sure that the enctype and method attributes are set properly
- this.element.setAttribute("enctype", "multipart/form-data");
- this.element.setAttribute("method", this.options.method);
- }
- return form != null ? form : fields;
- } // Returns the fallback elements if they exist already
- //
- // This code has to pass in IE7 :(
- }, {
- key: "getExistingFallback",
- value: function getExistingFallback() {
- var getFallback = function getFallback(elements) {
- var _iterator4 = dropzone_createForOfIteratorHelper(elements, true),
- _step4;
- try {
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
- var el = _step4.value;
- if (/(^| )fallback($| )/.test(el.className)) {
- return el;
- }
- }
- } catch (err) {
- _iterator4.e(err);
- } finally {
- _iterator4.f();
- }
- };
- for (var _i = 0, _arr = ["div", "form"]; _i < _arr.length; _i++) {
- var tagName = _arr[_i];
- var fallback;
- if (fallback = getFallback(this.element.getElementsByTagName(tagName))) {
- return fallback;
- }
- }
- } // Activates all listeners stored in @listeners
- }, {
- key: "setupEventListeners",
- value: function setupEventListeners() {
- return this.listeners.map(function (elementListeners) {
- return function () {
- var result = [];
- for (var event in elementListeners.events) {
- var listener = elementListeners.events[event];
- result.push(elementListeners.element.addEventListener(event, listener, false));
- }
- return result;
- }();
- });
- } // Deactivates all listeners stored in @listeners
- }, {
- key: "removeEventListeners",
- value: function removeEventListeners() {
- return this.listeners.map(function (elementListeners) {
- return function () {
- var result = [];
- for (var event in elementListeners.events) {
- var listener = elementListeners.events[event];
- result.push(elementListeners.element.removeEventListener(event, listener, false));
- }
- return result;
- }();
- });
- } // Removes all event listeners and cancels all files in the queue or being processed.
- }, {
- key: "disable",
- value: function disable() {
- var _this3 = this;
- this.clickableElements.forEach(function (element) {
- return element.classList.remove("dz-clickable");
- });
- this.removeEventListeners();
- this.disabled = true;
- return this.files.map(function (file) {
- return _this3.cancelUpload(file);
- });
- }
- }, {
- key: "enable",
- value: function enable() {
- delete this.disabled;
- this.clickableElements.forEach(function (element) {
- return element.classList.add("dz-clickable");
- });
- return this.setupEventListeners();
- } // Returns a nicely formatted filesize
- }, {
- key: "filesize",
- value: function filesize(size) {
- var selectedSize = 0;
- var selectedUnit = "b";
- if (size > 0) {
- var units = ["tb", "gb", "mb", "kb", "b"];
- for (var i = 0; i < units.length; i++) {
- var unit = units[i];
- var cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;
- if (size >= cutoff) {
- selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);
- selectedUnit = unit;
- break;
- }
- }
- selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits
- }
- return "<strong>".concat(selectedSize, "</strong> ").concat(this.options.dictFileSizeUnits[selectedUnit]);
- } // Adds or removes the `dz-max-files-reached` class from the form.
- }, {
- key: "_updateMaxFilesReachedClass",
- value: function _updateMaxFilesReachedClass() {
- if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {
- if (this.getAcceptedFiles().length === this.options.maxFiles) {
- this.emit("maxfilesreached", this.files);
- }
- return this.element.classList.add("dz-max-files-reached");
- } else {
- return this.element.classList.remove("dz-max-files-reached");
- }
- }
- }, {
- key: "drop",
- value: function drop(e) {
- if (!e.dataTransfer) {
- return;
- }
- this.emit("drop", e); // Convert the FileList to an Array
- // This is necessary for IE11
- var files = [];
- for (var i = 0; i < e.dataTransfer.files.length; i++) {
- files[i] = e.dataTransfer.files[i];
- } // Even if it's a folder, files.length will contain the folders.
- if (files.length) {
- var items = e.dataTransfer.items;
- if (items && items.length && items[0].webkitGetAsEntry != null) {
- // The browser supports dropping of folders, so handle items instead of files
- this._addFilesFromItems(items);
- } else {
- this.handleFiles(files);
- }
- }
- this.emit("addedfiles", files);
- }
- }, {
- key: "paste",
- value: function paste(e) {
- if (__guard__(e != null ? e.clipboardData : undefined, function (x) {
- return x.items;
- }) == null) {
- return;
- }
- this.emit("paste", e);
- var items = e.clipboardData.items;
- if (items.length) {
- return this._addFilesFromItems(items);
- }
- }
- }, {
- key: "handleFiles",
- value: function handleFiles(files) {
- var _iterator5 = dropzone_createForOfIteratorHelper(files, true),
- _step5;
- try {
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
- var file = _step5.value;
- this.addFile(file);
- }
- } catch (err) {
- _iterator5.e(err);
- } finally {
- _iterator5.f();
- }
- } // When a folder is dropped (or files are pasted), items must be handled
- // instead of files.
- }, {
- key: "_addFilesFromItems",
- value: function _addFilesFromItems(items) {
- var _this4 = this;
- return function () {
- var result = [];
- var _iterator6 = dropzone_createForOfIteratorHelper(items, true),
- _step6;
- try {
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
- var item = _step6.value;
- var entry;
- if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) {
- if (entry.isFile) {
- result.push(_this4.addFile(item.getAsFile()));
- } else if (entry.isDirectory) {
- // Append all files from that directory to files
- result.push(_this4._addFilesFromDirectory(entry, entry.name));
- } else {
- result.push(undefined);
- }
- } else if (item.getAsFile != null) {
- if (item.kind == null || item.kind === "file") {
- result.push(_this4.addFile(item.getAsFile()));
- } else {
- result.push(undefined);
- }
- } else {
- result.push(undefined);
- }
- }
- } catch (err) {
- _iterator6.e(err);
- } finally {
- _iterator6.f();
- }
- return result;
- }();
- } // Goes through the directory, and adds each file it finds recursively
- }, {
- key: "_addFilesFromDirectory",
- value: function _addFilesFromDirectory(directory, path) {
- var _this5 = this;
- var dirReader = directory.createReader();
- var errorHandler = function errorHandler(error) {
- return __guardMethod__(console, "log", function (o) {
- return o.log(error);
- });
- };
- var readEntries = function readEntries() {
- return dirReader.readEntries(function (entries) {
- if (entries.length > 0) {
- var _iterator7 = dropzone_createForOfIteratorHelper(entries, true),
- _step7;
- try {
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
- var entry = _step7.value;
- if (entry.isFile) {
- entry.file(function (file) {
- if (_this5.options.ignoreHiddenFiles && file.name.substring(0, 1) === ".") {
- return;
- }
- file.fullPath = "".concat(path, "/").concat(file.name);
- return _this5.addFile(file);
- });
- } else if (entry.isDirectory) {
- _this5._addFilesFromDirectory(entry, "".concat(path, "/").concat(entry.name));
- }
- } // Recursively call readEntries() again, since browser only handle
- // the first 100 entries.
- // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries
- } catch (err) {
- _iterator7.e(err);
- } finally {
- _iterator7.f();
- }
- readEntries();
- }
- return null;
- }, errorHandler);
- };
- return readEntries();
- } // If `done()` is called without argument the file is accepted
- // If you call it with an error message, the file is rejected
- // (This allows for asynchronous validation)
- //
- // This function checks the filesize, and if the file.type passes the
- // `acceptedFiles` check.
- }, {
- key: "accept",
- value: function accept(file, done) {
- if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1024 * 1024) {
- done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize));
- } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {
- done(this.options.dictInvalidFileType);
- } else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {
- done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles));
- this.emit("maxfilesexceeded", file);
- } else {
- this.options.accept.call(this, file, done);
- }
- }
- }, {
- key: "addFile",
- value: function addFile(file) {
- var _this6 = this;
- file.upload = {
- uuid: Dropzone.uuidv4(),
- progress: 0,
- // Setting the total upload size to file.size for the beginning
- // It's actual different than the size to be transmitted.
- total: file.size,
- bytesSent: 0,
- filename: this._renameFile(file) // Not setting chunking information here, because the acutal data — and
- // thus the chunks — might change if `options.transformFile` is set
- // and does something to the data.
- };
- this.files.push(file);
- file.status = Dropzone.ADDED;
- this.emit("addedfile", file);
- this._enqueueThumbnail(file);
- this.accept(file, function (error) {
- if (error) {
- file.accepted = false;
- _this6._errorProcessing([file], error); // Will set the file.status
- } else {
- file.accepted = true;
- if (_this6.options.autoQueue) {
- _this6.enqueueFile(file);
- } // Will set .accepted = true
- }
- _this6._updateMaxFilesReachedClass();
- });
- } // Wrapper for enqueueFile
- }, {
- key: "enqueueFiles",
- value: function enqueueFiles(files) {
- var _iterator8 = dropzone_createForOfIteratorHelper(files, true),
- _step8;
- try {
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
- var file = _step8.value;
- this.enqueueFile(file);
- }
- } catch (err) {
- _iterator8.e(err);
- } finally {
- _iterator8.f();
- }
- return null;
- }
- }, {
- key: "enqueueFile",
- value: function enqueueFile(file) {
- var _this7 = this;
- if (file.status === Dropzone.ADDED && file.accepted === true) {
- file.status = Dropzone.QUEUED;
- if (this.options.autoProcessQueue) {
- return setTimeout(function () {
- return _this7.processQueue();
- }, 0); // Deferring the call
- }
- } else {
- throw new Error("This file can't be queued because it has already been processed or was rejected.");
- }
- }
- }, {
- key: "_enqueueThumbnail",
- value: function _enqueueThumbnail(file) {
- var _this8 = this;
- if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) {
- this._thumbnailQueue.push(file);
- return setTimeout(function () {
- return _this8._processThumbnailQueue();
- }, 0); // Deferring the call
- }
- }
- }, {
- key: "_processThumbnailQueue",
- value: function _processThumbnailQueue() {
- var _this9 = this;
- if (this._processingThumbnail || this._thumbnailQueue.length === 0) {
- return;
- }
- this._processingThumbnail = true;
- var file = this._thumbnailQueue.shift();
- return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, function (dataUrl) {
- _this9.emit("thumbnail", file, dataUrl);
- _this9._processingThumbnail = false;
- return _this9._processThumbnailQueue();
- });
- } // Can be called by the user to remove a file
- }, {
- key: "removeFile",
- value: function removeFile(file) {
- if (file.status === Dropzone.UPLOADING) {
- this.cancelUpload(file);
- }
- this.files = without(this.files, file);
- this.emit("removedfile", file);
- if (this.files.length === 0) {
- return this.emit("reset");
- }
- } // Removes all files that aren't currently processed from the list
- }, {
- key: "removeAllFiles",
- value: function removeAllFiles(cancelIfNecessary) {
- // Create a copy of files since removeFile() changes the @files array.
- if (cancelIfNecessary == null) {
- cancelIfNecessary = false;
- }
- var _iterator9 = dropzone_createForOfIteratorHelper(this.files.slice(), true),
- _step9;
- try {
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
- var file = _step9.value;
- if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) {
- this.removeFile(file);
- }
- }
- } catch (err) {
- _iterator9.e(err);
- } finally {
- _iterator9.f();
- }
- return null;
- } // Resizes an image before it gets sent to the server. This function is the default behavior of
- // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with
- // the resized blob.
- }, {
- key: "resizeImage",
- value: function resizeImage(file, width, height, resizeMethod, callback) {
- var _this10 = this;
- return this.createThumbnail(file, width, height, resizeMethod, true, function (dataUrl, canvas) {
- if (canvas == null) {
- // The image has not been resized
- return callback(file);
- } else {
- var resizeMimeType = _this10.options.resizeMimeType;
- if (resizeMimeType == null) {
- resizeMimeType = file.type;
- }
- var resizedDataURL = canvas.toDataURL(resizeMimeType, _this10.options.resizeQuality);
- if (resizeMimeType === "image/jpeg" || resizeMimeType === "image/jpg") {
- // Now add the original EXIF information
- resizedDataURL = ExifRestore.restore(file.dataURL, resizedDataURL);
- }
- return callback(Dropzone.dataURItoBlob(resizedDataURL));
- }
- });
- }
- }, {
- key: "createThumbnail",
- value: function createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) {
- var _this11 = this;
- var fileReader = new FileReader();
- fileReader.onload = function () {
- file.dataURL = fileReader.result; // Don't bother creating a thumbnail for SVG images since they're vector
- if (file.type === "image/svg+xml") {
- if (callback != null) {
- callback(fileReader.result);
- }
- return;
- }
- _this11.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback);
- };
- fileReader.readAsDataURL(file);
- } // `mockFile` needs to have these attributes:
- //
- // { name: 'name', size: 12345, imageUrl: '' }
- //
- // `callback` will be invoked when the image has been downloaded and displayed.
- // `crossOrigin` will be added to the `img` tag when accessing the file.
- }, {
- key: "displayExistingFile",
- value: function displayExistingFile(mockFile, imageUrl, callback, crossOrigin) {
- var _this12 = this;
- var resizeThumbnail = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
- this.emit("addedfile", mockFile);
- this.emit("complete", mockFile);
- if (!resizeThumbnail) {
- this.emit("thumbnail", mockFile, imageUrl);
- if (callback) callback();
- } else {
- var onDone = function onDone(thumbnail) {
- _this12.emit("thumbnail", mockFile, thumbnail);
- if (callback) callback();
- };
- mockFile.dataURL = imageUrl;
- this.createThumbnailFromUrl(mockFile, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, this.options.fixOrientation, onDone, crossOrigin);
- }
- }
- }, {
- key: "createThumbnailFromUrl",
- value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) {
- var _this13 = this;
- // Not using `new Image` here because of a bug in latest Chrome versions.
- // See https://github.com/enyo/dropzone/pull/226
- var img = document.createElement("img");
- if (crossOrigin) {
- img.crossOrigin = crossOrigin;
- } // fixOrientation is not needed anymore with browsers handling imageOrientation
- fixOrientation = getComputedStyle(document.body)["imageOrientation"] == "from-image" ? false : fixOrientation;
- img.onload = function () {
- var loadExif = function loadExif(callback) {
- return callback(1);
- };
- if (typeof EXIF !== "undefined" && EXIF !== null && fixOrientation) {
- loadExif = function loadExif(callback) {
- return EXIF.getData(img, function () {
- return callback(EXIF.getTag(this, "Orientation"));
- });
- };
- }
- return loadExif(function (orientation) {
- file.width = img.width;
- file.height = img.height;
- var resizeInfo = _this13.options.resize.call(_this13, file, width, height, resizeMethod);
- var canvas = document.createElement("canvas");
- var ctx = canvas.getContext("2d");
- canvas.width = resizeInfo.trgWidth;
- canvas.height = resizeInfo.trgHeight;
- if (orientation > 4) {
- canvas.width = resizeInfo.trgHeight;
- canvas.height = resizeInfo.trgWidth;
- }
- switch (orientation) {
- case 2:
- // horizontal flip
- ctx.translate(canvas.width, 0);
- ctx.scale(-1, 1);
- break;
- case 3:
- // 180° rotate left
- ctx.translate(canvas.width, canvas.height);
- ctx.rotate(Math.PI);
- break;
- case 4:
- // vertical flip
- ctx.translate(0, canvas.height);
- ctx.scale(1, -1);
- break;
- case 5:
- // vertical flip + 90 rotate right
- ctx.rotate(0.5 * Math.PI);
- ctx.scale(1, -1);
- break;
- case 6:
- // 90° rotate right
- ctx.rotate(0.5 * Math.PI);
- ctx.translate(0, -canvas.width);
- break;
- case 7:
- // horizontal flip + 90 rotate right
- ctx.rotate(0.5 * Math.PI);
- ctx.translate(canvas.height, -canvas.width);
- ctx.scale(-1, 1);
- break;
- case 8:
- // 90° rotate left
- ctx.rotate(-0.5 * Math.PI);
- ctx.translate(-canvas.height, 0);
- break;
- } // This is a bugfix for iOS' scaling bug.
- drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight);
- var thumbnail = canvas.toDataURL("image/png");
- if (callback != null) {
- return callback(thumbnail, canvas);
- }
- });
- };
- if (callback != null) {
- img.onerror = callback;
- }
- return img.src = file.dataURL;
- } // Goes through the queue and processes files if there aren't too many already.
- }, {
- key: "processQueue",
- value: function processQueue() {
- var parallelUploads = this.options.parallelUploads;
- var processingLength = this.getUploadingFiles().length;
- var i = processingLength; // There are already at least as many files uploading than should be
- if (processingLength >= parallelUploads) {
- return;
- }
- var queuedFiles = this.getQueuedFiles();
- if (!(queuedFiles.length > 0)) {
- return;
- }
- if (this.options.uploadMultiple) {
- // The files should be uploaded in one request
- return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));
- } else {
- while (i < parallelUploads) {
- if (!queuedFiles.length) {
- return;
- } // Nothing left to process
- this.processFile(queuedFiles.shift());
- i++;
- }
- }
- } // Wrapper for `processFiles`
- }, {
- key: "processFile",
- value: function processFile(file) {
- return this.processFiles([file]);
- } // Loads the file, then calls finishedLoading()
- }, {
- key: "processFiles",
- value: function processFiles(files) {
- var _iterator10 = dropzone_createForOfIteratorHelper(files, true),
- _step10;
- try {
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
- var file = _step10.value;
- file.processing = true; // Backwards compatibility
- file.status = Dropzone.UPLOADING;
- this.emit("processing", file);
- }
- } catch (err) {
- _iterator10.e(err);
- } finally {
- _iterator10.f();
- }
- if (this.options.uploadMultiple) {
- this.emit("processingmultiple", files);
- }
- return this.uploadFiles(files);
- }
- }, {
- key: "_getFilesWithXhr",
- value: function _getFilesWithXhr(xhr) {
- var files;
- return files = this.files.filter(function (file) {
- return file.xhr === xhr;
- }).map(function (file) {
- return file;
- });
- } // Cancels the file upload and sets the status to CANCELED
- // **if** the file is actually being uploaded.
- // If it's still in the queue, the file is being removed from it and the status
- // set to CANCELED.
- }, {
- key: "cancelUpload",
- value: function cancelUpload(file) {
- if (file.status === Dropzone.UPLOADING) {
- var groupedFiles = this._getFilesWithXhr(file.xhr);
- var _iterator11 = dropzone_createForOfIteratorHelper(groupedFiles, true),
- _step11;
- try {
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
- var groupedFile = _step11.value;
- groupedFile.status = Dropzone.CANCELED;
- }
- } catch (err) {
- _iterator11.e(err);
- } finally {
- _iterator11.f();
- }
- if (typeof file.xhr !== "undefined") {
- file.xhr.abort();
- }
- var _iterator12 = dropzone_createForOfIteratorHelper(groupedFiles, true),
- _step12;
- try {
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
- var _groupedFile = _step12.value;
- this.emit("canceled", _groupedFile);
- }
- } catch (err) {
- _iterator12.e(err);
- } finally {
- _iterator12.f();
- }
- if (this.options.uploadMultiple) {
- this.emit("canceledmultiple", groupedFiles);
- }
- } else if (file.status === Dropzone.ADDED || file.status === Dropzone.QUEUED) {
- file.status = Dropzone.CANCELED;
- this.emit("canceled", file);
- if (this.options.uploadMultiple) {
- this.emit("canceledmultiple", [file]);
- }
- }
- if (this.options.autoProcessQueue) {
- return this.processQueue();
- }
- }
- }, {
- key: "resolveOption",
- value: function resolveOption(option) {
- if (typeof option === "function") {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- return option.apply(this, args);
- }
- return option;
- }
- }, {
- key: "uploadFile",
- value: function uploadFile(file) {
- return this.uploadFiles([file]);
- }
- }, {
- key: "uploadFiles",
- value: function uploadFiles(files) {
- var _this14 = this;
- this._transformFiles(files, function (transformedFiles) {
- if (_this14.options.chunking) {
- // Chunking is not allowed to be used with `uploadMultiple` so we know
- // that there is only __one__file.
- var transformedFile = transformedFiles[0];
- files[0].upload.chunked = _this14.options.chunking && (_this14.options.forceChunking || transformedFile.size > _this14.options.chunkSize);
- files[0].upload.totalChunkCount = Math.ceil(transformedFile.size / _this14.options.chunkSize);
- }
- if (files[0].upload.chunked) {
- // This file should be sent in chunks!
- // If the chunking option is set, we **know** that there can only be **one** file, since
- // uploadMultiple is not allowed with this option.
- var file = files[0];
- var _transformedFile = transformedFiles[0];
- var startedChunkCount = 0;
- file.upload.chunks = [];
- var handleNextChunk = function handleNextChunk() {
- var chunkIndex = 0; // Find the next item in file.upload.chunks that is not defined yet.
- while (file.upload.chunks[chunkIndex] !== undefined) {
- chunkIndex++;
- } // This means, that all chunks have already been started.
- if (chunkIndex >= file.upload.totalChunkCount) return;
- startedChunkCount++;
- var start = chunkIndex * _this14.options.chunkSize;
- var end = Math.min(start + _this14.options.chunkSize, _transformedFile.size);
- var dataBlock = {
- name: _this14._getParamName(0),
- data: _transformedFile.webkitSlice ? _transformedFile.webkitSlice(start, end) : _transformedFile.slice(start, end),
- filename: file.upload.filename,
- chunkIndex: chunkIndex
- };
- file.upload.chunks[chunkIndex] = {
- file: file,
- index: chunkIndex,
- dataBlock: dataBlock,
- // In case we want to retry.
- status: Dropzone.UPLOADING,
- progress: 0,
- retries: 0 // The number of times this block has been retried.
- };
- _this14._uploadData(files, [dataBlock]);
- };
- file.upload.finishedChunkUpload = function (chunk, response) {
- var allFinished = true;
- chunk.status = Dropzone.SUCCESS; // Clear the data from the chunk
- chunk.dataBlock = null; // Leaving this reference to xhr intact here will cause memory leaks in some browsers
- chunk.xhr = null;
- for (var i = 0; i < file.upload.totalChunkCount; i++) {
- if (file.upload.chunks[i] === undefined) {
- return handleNextChunk();
- }
- if (file.upload.chunks[i].status !== Dropzone.SUCCESS) {
- allFinished = false;
- }
- }
- if (allFinished) {
- _this14.options.chunksUploaded(file, function () {
- _this14._finished(files, response, null);
- });
- }
- };
- if (_this14.options.parallelChunkUploads) {
- for (var i = 0; i < file.upload.totalChunkCount; i++) {
- handleNextChunk();
- }
- } else {
- handleNextChunk();
- }
- } else {
- var dataBlocks = [];
- for (var _i2 = 0; _i2 < files.length; _i2++) {
- dataBlocks[_i2] = {
- name: _this14._getParamName(_i2),
- data: transformedFiles[_i2],
- filename: files[_i2].upload.filename
- };
- }
- _this14._uploadData(files, dataBlocks);
- }
- });
- } /// Returns the right chunk for given file and xhr
- }, {
- key: "_getChunk",
- value: function _getChunk(file, xhr) {
- for (var i = 0; i < file.upload.totalChunkCount; i++) {
- if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) {
- return file.upload.chunks[i];
- }
- }
- } // This function actually uploads the file(s) to the server.
- // If dataBlocks contains the actual data to upload (meaning, that this could either be transformed
- // files, or individual chunks for chunked upload).
- }, {
- key: "_uploadData",
- value: function _uploadData(files, dataBlocks) {
- var _this15 = this;
- var xhr = new XMLHttpRequest(); // Put the xhr object in the file objects to be able to reference it later.
- var _iterator13 = dropzone_createForOfIteratorHelper(files, true),
- _step13;
- try {
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
- var file = _step13.value;
- file.xhr = xhr;
- }
- } catch (err) {
- _iterator13.e(err);
- } finally {
- _iterator13.f();
- }
- if (files[0].upload.chunked) {
- // Put the xhr object in the right chunk object, so it can be associated later, and found with _getChunk
- files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr;
- }
- var method = this.resolveOption(this.options.method, files);
- var url = this.resolveOption(this.options.url, files);
- xhr.open(method, url, true); // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8
- var timeout = this.resolveOption(this.options.timeout, files);
- if (timeout) xhr.timeout = this.resolveOption(this.options.timeout, files); // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179
- xhr.withCredentials = !!this.options.withCredentials;
- xhr.onload = function (e) {
- _this15._finishedUploading(files, xhr, e);
- };
- xhr.ontimeout = function () {
- _this15._handleUploadError(files, xhr, "Request timedout after ".concat(_this15.options.timeout / 1000, " seconds"));
- };
- xhr.onerror = function () {
- _this15._handleUploadError(files, xhr);
- }; // Some browsers do not have the .upload property
- var progressObj = xhr.upload != null ? xhr.upload : xhr;
- progressObj.onprogress = function (e) {
- return _this15._updateFilesUploadProgress(files, xhr, e);
- };
- var headers = {
- Accept: "application/json",
- "Cache-Control": "no-cache",
- "X-Requested-With": "XMLHttpRequest"
- };
- if (this.options.headers) {
- Dropzone.extend(headers, this.options.headers);
- }
- for (var headerName in headers) {
- var headerValue = headers[headerName];
- if (headerValue) {
- xhr.setRequestHeader(headerName, headerValue);
- }
- }
- var formData = new FormData(); // Adding all @options parameters
- if (this.options.params) {
- var additionalParams = this.options.params;
- if (typeof additionalParams === "function") {
- additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null);
- }
- for (var key in additionalParams) {
- var value = additionalParams[key];
- if (Array.isArray(value)) {
- // The additional parameter contains an array,
- // so lets iterate over it to attach each value
- // individually.
- for (var i = 0; i < value.length; i++) {
- formData.append(key, value[i]);
- }
- } else {
- formData.append(key, value);
- }
- }
- } // Let the user add additional data if necessary
- var _iterator14 = dropzone_createForOfIteratorHelper(files, true),
- _step14;
- try {
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
- var _file = _step14.value;
- this.emit("sending", _file, xhr, formData);
- }
- } catch (err) {
- _iterator14.e(err);
- } finally {
- _iterator14.f();
- }
- if (this.options.uploadMultiple) {
- this.emit("sendingmultiple", files, xhr, formData);
- }
- this._addFormElementData(formData); // Finally add the files
- // Has to be last because some servers (eg: S3) expect the file to be the last parameter
- for (var _i3 = 0; _i3 < dataBlocks.length; _i3++) {
- var dataBlock = dataBlocks[_i3];
- formData.append(dataBlock.name, dataBlock.data, dataBlock.filename);
- }
- this.submitRequest(xhr, formData, files);
- } // Transforms all files with this.options.transformFile and invokes done with the transformed files when done.
- }, {
- key: "_transformFiles",
- value: function _transformFiles(files, done) {
- var _this16 = this;
- var transformedFiles = []; // Clumsy way of handling asynchronous calls, until I get to add a proper Future library.
- var doneCounter = 0;
- var _loop = function _loop(i) {
- _this16.options.transformFile.call(_this16, files[i], function (transformedFile) {
- transformedFiles[i] = transformedFile;
- if (++doneCounter === files.length) {
- done(transformedFiles);
- }
- });
- };
- for (var i = 0; i < files.length; i++) {
- _loop(i);
- }
- } // Takes care of adding other input elements of the form to the AJAX request
- }, {
- key: "_addFormElementData",
- value: function _addFormElementData(formData) {
- // Take care of other input elements
- if (this.element.tagName === "FORM") {
- var _iterator15 = dropzone_createForOfIteratorHelper(this.element.querySelectorAll("input, textarea, select, button"), true),
- _step15;
- try {
- for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
- var input = _step15.value;
- var inputName = input.getAttribute("name");
- var inputType = input.getAttribute("type");
- if (inputType) inputType = inputType.toLowerCase(); // If the input doesn't have a name, we can't use it.
- if (typeof inputName === "undefined" || inputName === null) continue;
- if (input.tagName === "SELECT" && input.hasAttribute("multiple")) {
- // Possibly multiple values
- var _iterator16 = dropzone_createForOfIteratorHelper(input.options, true),
- _step16;
- try {
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
- var option = _step16.value;
- if (option.selected) {
- formData.append(inputName, option.value);
- }
- }
- } catch (err) {
- _iterator16.e(err);
- } finally {
- _iterator16.f();
- }
- } else if (!inputType || inputType !== "checkbox" && inputType !== "radio" || input.checked) {
- formData.append(inputName, input.value);
- }
- }
- } catch (err) {
- _iterator15.e(err);
- } finally {
- _iterator15.f();
- }
- }
- } // Invoked when there is new progress information about given files.
- // If e is not provided, it is assumed that the upload is finished.
- }, {
- key: "_updateFilesUploadProgress",
- value: function _updateFilesUploadProgress(files, xhr, e) {
- if (!files[0].upload.chunked) {
- // Handle file uploads without chunking
- var _iterator17 = dropzone_createForOfIteratorHelper(files, true),
- _step17;
- try {
- for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
- var file = _step17.value;
- if (file.upload.total && file.upload.bytesSent && file.upload.bytesSent == file.upload.total) {
- // If both, the `total` and `bytesSent` have already been set, and
- // they are equal (meaning progress is at 100%), we can skip this
- // file, since an upload progress shouldn't go down.
- continue;
- }
- if (e) {
- file.upload.progress = 100 * e.loaded / e.total;
- file.upload.total = e.total;
- file.upload.bytesSent = e.loaded;
- } else {
- // No event, so we're at 100%
- file.upload.progress = 100;
- file.upload.bytesSent = file.upload.total;
- }
- this.emit("uploadprogress", file, file.upload.progress, file.upload.bytesSent);
- }
- } catch (err) {
- _iterator17.e(err);
- } finally {
- _iterator17.f();
- }
- } else {
- // Handle chunked file uploads
- // Chunked upload is not compatible with uploading multiple files in one
- // request, so we know there's only one file.
- var _file2 = files[0]; // Since this is a chunked upload, we need to update the appropriate chunk
- // progress.
- var chunk = this._getChunk(_file2, xhr);
- if (e) {
- chunk.progress = 100 * e.loaded / e.total;
- chunk.total = e.total;
- chunk.bytesSent = e.loaded;
- } else {
- // No event, so we're at 100%
- chunk.progress = 100;
- chunk.bytesSent = chunk.total;
- } // Now tally the *file* upload progress from its individual chunks
- _file2.upload.progress = 0;
- _file2.upload.total = 0;
- _file2.upload.bytesSent = 0;
- for (var i = 0; i < _file2.upload.totalChunkCount; i++) {
- if (_file2.upload.chunks[i] && typeof _file2.upload.chunks[i].progress !== "undefined") {
- _file2.upload.progress += _file2.upload.chunks[i].progress;
- _file2.upload.total += _file2.upload.chunks[i].total;
- _file2.upload.bytesSent += _file2.upload.chunks[i].bytesSent;
- }
- } // Since the process is a percentage, we need to divide by the amount of
- // chunks we've used.
- _file2.upload.progress = _file2.upload.progress / _file2.upload.totalChunkCount;
- this.emit("uploadprogress", _file2, _file2.upload.progress, _file2.upload.bytesSent);
- }
- }
- }, {
- key: "_finishedUploading",
- value: function _finishedUploading(files, xhr, e) {
- var response;
- if (files[0].status === Dropzone.CANCELED) {
- return;
- }
- if (xhr.readyState !== 4) {
- return;
- }
- if (xhr.responseType !== "arraybuffer" && xhr.responseType !== "blob") {
- response = xhr.responseText;
- if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) {
- try {
- response = JSON.parse(response);
- } catch (error) {
- e = error;
- response = "Invalid JSON response from server.";
- }
- }
- }
- this._updateFilesUploadProgress(files, xhr);
- if (!(200 <= xhr.status && xhr.status < 300)) {
- this._handleUploadError(files, xhr, response);
- } else {
- if (files[0].upload.chunked) {
- files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr), response);
- } else {
- this._finished(files, response, e);
- }
- }
- }
- }, {
- key: "_handleUploadError",
- value: function _handleUploadError(files, xhr, response) {
- if (files[0].status === Dropzone.CANCELED) {
- return;
- }
- if (files[0].upload.chunked && this.options.retryChunks) {
- var chunk = this._getChunk(files[0], xhr);
- if (chunk.retries++ < this.options.retryChunksLimit) {
- this._uploadData(files, [chunk.dataBlock]);
- return;
- } else {
- console.warn("Retried this chunk too often. Giving up.");
- }
- }
- this._errorProcessing(files, response || this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr);
- }
- }, {
- key: "submitRequest",
- value: function submitRequest(xhr, formData, files) {
- if (xhr.readyState != 1) {
- console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.");
- return;
- }
- xhr.send(formData);
- } // Called internally when processing is finished.
- // Individual callbacks have to be called in the appropriate sections.
- }, {
- key: "_finished",
- value: function _finished(files, responseText, e) {
- var _iterator18 = dropzone_createForOfIteratorHelper(files, true),
- _step18;
- try {
- for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
- var file = _step18.value;
- file.status = Dropzone.SUCCESS;
- this.emit("success", file, responseText, e);
- this.emit("complete", file);
- }
- } catch (err) {
- _iterator18.e(err);
- } finally {
- _iterator18.f();
- }
- if (this.options.uploadMultiple) {
- this.emit("successmultiple", files, responseText, e);
- this.emit("completemultiple", files);
- }
- if (this.options.autoProcessQueue) {
- return this.processQueue();
- }
- } // Called internally when processing is finished.
- // Individual callbacks have to be called in the appropriate sections.
- }, {
- key: "_errorProcessing",
- value: function _errorProcessing(files, message, xhr) {
- var _iterator19 = dropzone_createForOfIteratorHelper(files, true),
- _step19;
- try {
- for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
- var file = _step19.value;
- file.status = Dropzone.ERROR;
- this.emit("error", file, message, xhr);
- this.emit("complete", file);
- }
- } catch (err) {
- _iterator19.e(err);
- } finally {
- _iterator19.f();
- }
- if (this.options.uploadMultiple) {
- this.emit("errormultiple", files, message, xhr);
- this.emit("completemultiple", files);
- }
- if (this.options.autoProcessQueue) {
- return this.processQueue();
- }
- }
- }], [{
- key: "initClass",
- value: function initClass() {
- // Exposing the emitter class, mainly for tests
- this.prototype.Emitter = Emitter;
- /*
- This is a list of all available events you can register on a dropzone object.
- You can register an event handler like this:
- dropzone.on("dragEnter", function() { });
- */
- this.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"];
- this.prototype._thumbnailQueue = [];
- this.prototype._processingThumbnail = false;
- } // global utility
- }, {
- key: "extend",
- value: function extend(target) {
- for (var _len2 = arguments.length, objects = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- objects[_key2 - 1] = arguments[_key2];
- }
- for (var _i4 = 0, _objects = objects; _i4 < _objects.length; _i4++) {
- var object = _objects[_i4];
- for (var key in object) {
- var val = object[key];
- target[key] = val;
- }
- }
- return target;
- }
- }, {
- key: "uuidv4",
- value: function uuidv4() {
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
- var r = Math.random() * 16 | 0,
- v = c === "x" ? r : r & 0x3 | 0x8;
- return v.toString(16);
- });
- }
- }]);
- return Dropzone;
- }(Emitter);
- Dropzone.initClass();
- Dropzone.version = "5.9.3"; // This is a map of options for your different dropzones. Add configurations
- // to this object for your different dropzone elemens.
- //
- // Example:
- //
- // Dropzone.options.myDropzoneElementId = { maxFilesize: 1 };
- //
- // To disable autoDiscover for a specific element, you can set `false` as an option:
- //
- // Dropzone.options.myDisabledElementId = false;
- //
- // And in html:
- //
- // <form action="/upload" id="my-dropzone-element-id" class="dropzone"></form>
- Dropzone.options = {}; // Returns the options for an element or undefined if none available.
- Dropzone.optionsForElement = function (element) {
- // Get the `Dropzone.options.elementId` for this element if it exists
- if (element.getAttribute("id")) {
- return Dropzone.options[camelize(element.getAttribute("id"))];
- } else {
- return undefined;
- }
- }; // Holds a list of all dropzone instances
- Dropzone.instances = []; // Returns the dropzone for given element if any
- Dropzone.forElement = function (element) {
- if (typeof element === "string") {
- element = document.querySelector(element);
- }
- if ((element != null ? element.dropzone : undefined) == null) {
- throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");
- }
- return element.dropzone;
- }; // Set to false if you don't want Dropzone to automatically find and attach to .dropzone elements.
- Dropzone.autoDiscover = true; // Looks for all .dropzone elements and creates a dropzone for them
- Dropzone.discover = function () {
- var dropzones;
- if (document.querySelectorAll) {
- dropzones = document.querySelectorAll(".dropzone");
- } else {
- dropzones = []; // IE :(
- var checkElements = function checkElements(elements) {
- return function () {
- var result = [];
- var _iterator20 = dropzone_createForOfIteratorHelper(elements, true),
- _step20;
- try {
- for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
- var el = _step20.value;
- if (/(^| )dropzone($| )/.test(el.className)) {
- result.push(dropzones.push(el));
- } else {
- result.push(undefined);
- }
- }
- } catch (err) {
- _iterator20.e(err);
- } finally {
- _iterator20.f();
- }
- return result;
- }();
- };
- checkElements(document.getElementsByTagName("div"));
- checkElements(document.getElementsByTagName("form"));
- }
- return function () {
- var result = [];
- var _iterator21 = dropzone_createForOfIteratorHelper(dropzones, true),
- _step21;
- try {
- for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {
- var dropzone = _step21.value;
- // Create a dropzone unless auto discover has been disabled for specific element
- if (Dropzone.optionsForElement(dropzone) !== false) {
- result.push(new Dropzone(dropzone));
- } else {
- result.push(undefined);
- }
- }
- } catch (err) {
- _iterator21.e(err);
- } finally {
- _iterator21.f();
- }
- return result;
- }();
- }; // Some browsers support drag and drog functionality, but not correctly.
- //
- // So I created a blocklist of userAgents. Yes, yes. Browser sniffing, I know.
- // But what to do when browsers *theoretically* support an API, but crash
- // when using it.
- //
- // This is a list of regular expressions tested against navigator.userAgent
- //
- // ** It should only be used on browser that *do* support the API, but
- // incorrectly **
- Dropzone.blockedBrowsers = [// The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.
- /opera.*(Macintosh|Windows Phone).*version\/12/i]; // Checks if the browser is supported
- Dropzone.isBrowserSupported = function () {
- var capableBrowser = true;
- if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
- if (!("classList" in document.createElement("a"))) {
- capableBrowser = false;
- } else {
- if (Dropzone.blacklistedBrowsers !== undefined) {
- // Since this has been renamed, this makes sure we don't break older
- // configuration.
- Dropzone.blockedBrowsers = Dropzone.blacklistedBrowsers;
- } // The browser supports the API, but may be blocked.
- var _iterator22 = dropzone_createForOfIteratorHelper(Dropzone.blockedBrowsers, true),
- _step22;
- try {
- for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
- var regex = _step22.value;
- if (regex.test(navigator.userAgent)) {
- capableBrowser = false;
- continue;
- }
- }
- } catch (err) {
- _iterator22.e(err);
- } finally {
- _iterator22.f();
- }
- }
- } else {
- capableBrowser = false;
- }
- return capableBrowser;
- };
- Dropzone.dataURItoBlob = function (dataURI) {
- // convert base64 to raw binary data held in a string
- // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
- var byteString = atob(dataURI.split(",")[1]); // separate out the mime component
- var mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0]; // write the bytes of the string to an ArrayBuffer
- var ab = new ArrayBuffer(byteString.length);
- var ia = new Uint8Array(ab);
- for (var i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--) {
- ia[i] = byteString.charCodeAt(i);
- } // write the ArrayBuffer to a blob
- return new Blob([ab], {
- type: mimeString
- });
- }; // Returns an array without the rejected item
- var without = function without(list, rejectedItem) {
- return list.filter(function (item) {
- return item !== rejectedItem;
- }).map(function (item) {
- return item;
- });
- }; // abc-def_ghi -> abcDefGhi
- var camelize = function camelize(str) {
- return str.replace(/[\-_](\w)/g, function (match) {
- return match.charAt(1).toUpperCase();
- });
- }; // Creates an element from string
- Dropzone.createElement = function (string) {
- var div = document.createElement("div");
- div.innerHTML = string;
- return div.childNodes[0];
- }; // Tests if given element is inside (or simply is) the container
- Dropzone.elementInside = function (element, container) {
- if (element === container) {
- return true;
- } // Coffeescript doesn't support do/while loops
- while (element = element.parentNode) {
- if (element === container) {
- return true;
- }
- }
- return false;
- };
- Dropzone.getElement = function (el, name) {
- var element;
- if (typeof el === "string") {
- element = document.querySelector(el);
- } else if (el.nodeType != null) {
- element = el;
- }
- if (element == null) {
- throw new Error("Invalid `".concat(name, "` option provided. Please provide a CSS selector or a plain HTML element."));
- }
- return element;
- };
- Dropzone.getElements = function (els, name) {
- var el, elements;
- if (els instanceof Array) {
- elements = [];
- try {
- var _iterator23 = dropzone_createForOfIteratorHelper(els, true),
- _step23;
- try {
- for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
- el = _step23.value;
- elements.push(this.getElement(el, name));
- }
- } catch (err) {
- _iterator23.e(err);
- } finally {
- _iterator23.f();
- }
- } catch (e) {
- elements = null;
- }
- } else if (typeof els === "string") {
- elements = [];
- var _iterator24 = dropzone_createForOfIteratorHelper(document.querySelectorAll(els), true),
- _step24;
- try {
- for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
- el = _step24.value;
- elements.push(el);
- }
- } catch (err) {
- _iterator24.e(err);
- } finally {
- _iterator24.f();
- }
- } else if (els.nodeType != null) {
- elements = [els];
- }
- if (elements == null || !elements.length) {
- throw new Error("Invalid `".concat(name, "` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));
- }
- return elements;
- }; // Asks the user the question and calls accepted or rejected accordingly
- //
- // The default implementation just uses `window.confirm` and then calls the
- // appropriate callback.
- Dropzone.confirm = function (question, accepted, rejected) {
- if (window.confirm(question)) {
- return accepted();
- } else if (rejected != null) {
- return rejected();
- }
- }; // Validates the mime type like this:
- //
- // https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept
- Dropzone.isValidFile = function (file, acceptedFiles) {
- if (!acceptedFiles) {
- return true;
- } // If there are no accepted mime types, it's OK
- acceptedFiles = acceptedFiles.split(",");
- var mimeType = file.type;
- var baseMimeType = mimeType.replace(/\/.*$/, "");
- var _iterator25 = dropzone_createForOfIteratorHelper(acceptedFiles, true),
- _step25;
- try {
- for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
- var validType = _step25.value;
- validType = validType.trim();
- if (validType.charAt(0) === ".") {
- if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {
- return true;
- }
- } else if (/\/\*$/.test(validType)) {
- // This is something like a image/* mime type
- if (baseMimeType === validType.replace(/\/.*$/, "")) {
- return true;
- }
- } else {
- if (mimeType === validType) {
- return true;
- }
- }
- }
- } catch (err) {
- _iterator25.e(err);
- } finally {
- _iterator25.f();
- }
- return false;
- }; // Augment jQuery
- if (typeof jQuery !== "undefined" && jQuery !== null) {
- jQuery.fn.dropzone = function (options) {
- return this.each(function () {
- return new Dropzone(this, options);
- });
- };
- } // Dropzone file status codes
- Dropzone.ADDED = "added";
- Dropzone.QUEUED = "queued"; // For backwards compatibility. Now, if a file is accepted, it's either queued
- // or uploading.
- Dropzone.ACCEPTED = Dropzone.QUEUED;
- Dropzone.UPLOADING = "uploading";
- Dropzone.PROCESSING = Dropzone.UPLOADING; // alias
- Dropzone.CANCELED = "canceled";
- Dropzone.ERROR = "error";
- Dropzone.SUCCESS = "success";
- /*
- Bugfix for iOS 6 and 7
- Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios
- based on the work of https://github.com/stomita/ios-imagefile-megapixel
- */
- // Detecting vertical squash in loaded image.
- // Fixes a bug which squash image vertically while drawing into canvas for some images.
- // This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel
- var detectVerticalSquash = function detectVerticalSquash(img) {
- var iw = img.naturalWidth;
- var ih = img.naturalHeight;
- var canvas = document.createElement("canvas");
- canvas.width = 1;
- canvas.height = ih;
- var ctx = canvas.getContext("2d");
- ctx.drawImage(img, 0, 0);
- var _ctx$getImageData = ctx.getImageData(1, 0, 1, ih),
- data = _ctx$getImageData.data; // search image edge pixel position in case it is squashed vertically.
- var sy = 0;
- var ey = ih;
- var py = ih;
- while (py > sy) {
- var alpha = data[(py - 1) * 4 + 3];
- if (alpha === 0) {
- ey = py;
- } else {
- sy = py;
- }
- py = ey + sy >> 1;
- }
- var ratio = py / ih;
- if (ratio === 0) {
- return 1;
- } else {
- return ratio;
- }
- }; // A replacement for context.drawImage
- // (args are for source and destination).
- var drawImageIOSFix = function drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {
- var vertSquashRatio = detectVerticalSquash(img);
- return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);
- }; // Based on MinifyJpeg
- // Source: http://www.perry.cz/files/ExifRestorer.js
- // http://elicon.blog57.fc2.com/blog-entry-206.html
- var ExifRestore = /*#__PURE__*/function () {
- function ExifRestore() {
- dropzone_classCallCheck(this, ExifRestore);
- }
- dropzone_createClass(ExifRestore, null, [{
- key: "initClass",
- value: function initClass() {
- this.KEY_STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- }
- }, {
- key: "encode64",
- value: function encode64(input) {
- var output = "";
- var chr1 = undefined;
- var chr2 = undefined;
- var chr3 = "";
- var enc1 = undefined;
- var enc2 = undefined;
- var enc3 = undefined;
- var enc4 = "";
- var i = 0;
- while (true) {
- chr1 = input[i++];
- chr2 = input[i++];
- chr3 = input[i++];
- enc1 = chr1 >> 2;
- enc2 = (chr1 & 3) << 4 | chr2 >> 4;
- enc3 = (chr2 & 15) << 2 | chr3 >> 6;
- enc4 = chr3 & 63;
- if (isNaN(chr2)) {
- enc3 = enc4 = 64;
- } else if (isNaN(chr3)) {
- enc4 = 64;
- }
- output = output + this.KEY_STR.charAt(enc1) + this.KEY_STR.charAt(enc2) + this.KEY_STR.charAt(enc3) + this.KEY_STR.charAt(enc4);
- chr1 = chr2 = chr3 = "";
- enc1 = enc2 = enc3 = enc4 = "";
- if (!(i < input.length)) {
- break;
- }
- }
- return output;
- }
- }, {
- key: "restore",
- value: function restore(origFileBase64, resizedFileBase64) {
- if (!origFileBase64.match("data:image/jpeg;base64,")) {
- return resizedFileBase64;
- }
- var rawImage = this.decode64(origFileBase64.replace("data:image/jpeg;base64,", ""));
- var segments = this.slice2Segments(rawImage);
- var image = this.exifManipulation(resizedFileBase64, segments);
- return "data:image/jpeg;base64,".concat(this.encode64(image));
- }
- }, {
- key: "exifManipulation",
- value: function exifManipulation(resizedFileBase64, segments) {
- var exifArray = this.getExifArray(segments);
- var newImageArray = this.insertExif(resizedFileBase64, exifArray);
- var aBuffer = new Uint8Array(newImageArray);
- return aBuffer;
- }
- }, {
- key: "getExifArray",
- value: function getExifArray(segments) {
- var seg = undefined;
- var x = 0;
- while (x < segments.length) {
- seg = segments[x];
- if (seg[0] === 255 & seg[1] === 225) {
- return seg;
- }
- x++;
- }
- return [];
- }
- }, {
- key: "insertExif",
- value: function insertExif(resizedFileBase64, exifArray) {
- var imageData = resizedFileBase64.replace("data:image/jpeg;base64,", "");
- var buf = this.decode64(imageData);
- var separatePoint = buf.indexOf(255, 3);
- var mae = buf.slice(0, separatePoint);
- var ato = buf.slice(separatePoint);
- var array = mae;
- array = array.concat(exifArray);
- array = array.concat(ato);
- return array;
- }
- }, {
- key: "slice2Segments",
- value: function slice2Segments(rawImageArray) {
- var head = 0;
- var segments = [];
- while (true) {
- var length;
- if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 218) {
- break;
- }
- if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 216) {
- head += 2;
- } else {
- length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3];
- var endPoint = head + length + 2;
- var seg = rawImageArray.slice(head, endPoint);
- segments.push(seg);
- head = endPoint;
- }
- if (head > rawImageArray.length) {
- break;
- }
- }
- return segments;
- }
- }, {
- key: "decode64",
- value: function decode64(input) {
- var output = "";
- var chr1 = undefined;
- var chr2 = undefined;
- var chr3 = "";
- var enc1 = undefined;
- var enc2 = undefined;
- var enc3 = undefined;
- var enc4 = "";
- var i = 0;
- var buf = []; // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
- var base64test = /[^A-Za-z0-9\+\/\=]/g;
- if (base64test.exec(input)) {
- console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding.");
- }
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
- while (true) {
- enc1 = this.KEY_STR.indexOf(input.charAt(i++));
- enc2 = this.KEY_STR.indexOf(input.charAt(i++));
- enc3 = this.KEY_STR.indexOf(input.charAt(i++));
- enc4 = this.KEY_STR.indexOf(input.charAt(i++));
- chr1 = enc1 << 2 | enc2 >> 4;
- chr2 = (enc2 & 15) << 4 | enc3 >> 2;
- chr3 = (enc3 & 3) << 6 | enc4;
- buf.push(chr1);
- if (enc3 !== 64) {
- buf.push(chr2);
- }
- if (enc4 !== 64) {
- buf.push(chr3);
- }
- chr1 = chr2 = chr3 = "";
- enc1 = enc2 = enc3 = enc4 = "";
- if (!(i < input.length)) {
- break;
- }
- }
- return buf;
- }
- }]);
- return ExifRestore;
- }();
- ExifRestore.initClass();
- /*
- * contentloaded.js
- *
- * Author: Diego Perini (diego.perini at gmail.com)
- * Summary: cross-browser wrapper for DOMContentLoaded
- * Updated: 20101020
- * License: MIT
- * Version: 1.2
- *
- * URL:
- * http://javascript.nwbox.com/ContentLoaded/
- * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE
- */
- // @win window reference
- // @fn function reference
- var contentLoaded = function contentLoaded(win, fn) {
- var done = false;
- var top = true;
- var doc = win.document;
- var root = doc.documentElement;
- var add = doc.addEventListener ? "addEventListener" : "attachEvent";
- var rem = doc.addEventListener ? "removeEventListener" : "detachEvent";
- var pre = doc.addEventListener ? "" : "on";
- var init = function init(e) {
- if (e.type === "readystatechange" && doc.readyState !== "complete") {
- return;
- }
- (e.type === "load" ? win : doc)[rem](pre + e.type, init, false);
- if (!done && (done = true)) {
- return fn.call(win, e.type || e);
- }
- };
- var poll = function poll() {
- try {
- root.doScroll("left");
- } catch (e) {
- setTimeout(poll, 50);
- return;
- }
- return init("poll");
- };
- if (doc.readyState !== "complete") {
- if (doc.createEventObject && root.doScroll) {
- try {
- top = !win.frameElement;
- } catch (error) {}
- if (top) {
- poll();
- }
- }
- doc[add](pre + "DOMContentLoaded", init, false);
- doc[add](pre + "readystatechange", init, false);
- return win[add](pre + "load", init, false);
- }
- }; // As a single function to be able to write tests.
- Dropzone._autoDiscoverFunction = function () {
- if (Dropzone.autoDiscover) {
- return Dropzone.discover();
- }
- };
- contentLoaded(window, Dropzone._autoDiscoverFunction);
- function __guard__(value, transform) {
- return typeof value !== "undefined" && value !== null ? transform(value) : undefined;
- }
- function __guardMethod__(obj, methodName, transform) {
- if (typeof obj !== "undefined" && obj !== null && typeof obj[methodName] === "function") {
- return transform(obj, methodName);
- } else {
- return undefined;
- }
- }
- ;// CONCATENATED MODULE: ./tool/dropzone.dist.js
- /// Make Dropzone a global variable.
- window.Dropzone = Dropzone;
- /* harmony default export */ var dropzone_dist = (Dropzone);
- }();
- /******/ return __webpack_exports__;
- /******/ })()
- ;
- });
- /***/ }),
- /***/ 26729:
- /***/ ((module) => {
- "use strict";
- var has = Object.prototype.hasOwnProperty
- , prefix = '~';
- /**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @private
- */
- function Events() {}
- //
- // We try to not inherit from `Object.prototype`. In some engines creating an
- // instance in this way is faster than calling `Object.create(null)` directly.
- // If `Object.create(null)` is not supported we prefix the event names with a
- // character to make sure that the built-in object properties are not
- // overridden or used as an attack vector.
- //
- if (Object.create) {
- Events.prototype = Object.create(null);
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
- }
- /**
- * Representation of a single event listener.
- *
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @private
- */
- function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
- }
- /**
- * Add a listener for a given event.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} once Specify if the listener is a one-time listener.
- * @returns {EventEmitter}
- * @private
- */
- function addListener(emitter, event, fn, context, once) {
- if (typeof fn !== 'function') {
- throw new TypeError('The listener must be a function');
- }
- var listener = new EE(fn, context || emitter, once)
- , evt = prefix ? prefix + event : event;
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
- else emitter._events[evt] = [emitter._events[evt], listener];
- return emitter;
- }
- /**
- * Clear event by name.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} evt The Event name.
- * @private
- */
- function clearEvent(emitter, evt) {
- if (--emitter._eventsCount === 0) emitter._events = new Events();
- else delete emitter._events[evt];
- }
- /**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @public
- */
- function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
- }
- /**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @public
- */
- EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
- if (this._eventsCount === 0) return names;
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
- return names;
- };
- /**
- * Return the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Array} The registered listeners.
- * @public
- */
- EventEmitter.prototype.listeners = function listeners(event) {
- var evt = prefix ? prefix + event : event
- , handlers = this._events[evt];
- if (!handlers) return [];
- if (handlers.fn) return [handlers.fn];
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
- ee[i] = handlers[i].fn;
- }
- return ee;
- };
- /**
- * Return the number of listeners listening to a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Number} The number of listeners.
- * @public
- */
- EventEmitter.prototype.listenerCount = function listenerCount(event) {
- var evt = prefix ? prefix + event : event
- , listeners = this._events[evt];
- if (!listeners) return 0;
- if (listeners.fn) return 1;
- return listeners.length;
- };
- /**
- * Calls each of the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @public
- */
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
- if (!this._events[evt]) return false;
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
- for (i = 1, args = new Array(len -1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
- return true;
- };
- /**
- * Add a listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.on = function on(event, fn, context) {
- return addListener(this, event, fn, context, false);
- };
- /**
- * Add a one-time listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.once = function once(event, fn, context) {
- return addListener(this, event, fn, context, true);
- };
- /**
- * Remove the listeners of a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {*} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
- if (!this._events[evt]) return this;
- if (!fn) {
- clearEvent(this, evt);
- return this;
- }
- var listeners = this._events[evt];
- if (listeners.fn) {
- if (
- listeners.fn === fn &&
- (!once || listeners.once) &&
- (!context || listeners.context === context)
- ) {
- clearEvent(this, evt);
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn ||
- (once && !listeners[i].once) ||
- (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
- }
- }
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else clearEvent(this, evt);
- }
- return this;
- };
- /**
- * Remove all listeners, or those of the specified event.
- *
- * @param {(String|Symbol)} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) clearEvent(this, evt);
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
- return this;
- };
- //
- // Alias methods names because people roll like that.
- //
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
- //
- // Expose the prefix.
- //
- EventEmitter.prefixed = prefix;
- //
- // Allow `EventEmitter` to be imported as module namespace.
- //
- EventEmitter.EventEmitter = EventEmitter;
- //
- // Expose the module.
- //
- if (true) {
- module.exports = EventEmitter;
- }
- /***/ }),
- /***/ 17187:
- /***/ ((module) => {
- "use strict";
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // Permission is hereby granted, free of charge, to any person obtaining a
- // copy of this software and associated documentation files (the
- // "Software"), to deal in the Software without restriction, including
- // without limitation the rights to use, copy, modify, merge, publish,
- // distribute, sublicense, and/or sell copies of the Software, and to permit
- // persons to whom the Software is furnished to do so, subject to the
- // following conditions:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
- var R = typeof Reflect === 'object' ? Reflect : null
- var ReflectApply = R && typeof R.apply === 'function'
- ? R.apply
- : function ReflectApply(target, receiver, args) {
- return Function.prototype.apply.call(target, receiver, args);
- }
- var ReflectOwnKeys
- if (R && typeof R.ownKeys === 'function') {
- ReflectOwnKeys = R.ownKeys
- } else if (Object.getOwnPropertySymbols) {
- ReflectOwnKeys = function ReflectOwnKeys(target) {
- return Object.getOwnPropertyNames(target)
- .concat(Object.getOwnPropertySymbols(target));
- };
- } else {
- ReflectOwnKeys = function ReflectOwnKeys(target) {
- return Object.getOwnPropertyNames(target);
- };
- }
- function ProcessEmitWarning(warning) {
- if (console && console.warn) console.warn(warning);
- }
- var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
- return value !== value;
- }
- function EventEmitter() {
- EventEmitter.init.call(this);
- }
- module.exports = EventEmitter;
- module.exports.once = once;
- // Backwards-compat with node 0.10.x
- EventEmitter.EventEmitter = EventEmitter;
- EventEmitter.prototype._events = undefined;
- EventEmitter.prototype._eventsCount = 0;
- EventEmitter.prototype._maxListeners = undefined;
- // By default EventEmitters will print a warning if more than 10 listeners are
- // added to it. This is a useful default which helps finding memory leaks.
- var defaultMaxListeners = 10;
- function checkListener(listener) {
- if (typeof listener !== 'function') {
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
- }
- }
- Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
- enumerable: true,
- get: function() {
- return defaultMaxListeners;
- },
- set: function(arg) {
- if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
- }
- defaultMaxListeners = arg;
- }
- });
- EventEmitter.init = function() {
- if (this._events === undefined ||
- this._events === Object.getPrototypeOf(this)._events) {
- this._events = Object.create(null);
- this._eventsCount = 0;
- }
- this._maxListeners = this._maxListeners || undefined;
- };
- // Obviously not all Emitters should be limited to 10. This function allows
- // that to be increased. Set to zero for unlimited.
- EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
- if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
- }
- this._maxListeners = n;
- return this;
- };
- function _getMaxListeners(that) {
- if (that._maxListeners === undefined)
- return EventEmitter.defaultMaxListeners;
- return that._maxListeners;
- }
- EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
- return _getMaxListeners(this);
- };
- EventEmitter.prototype.emit = function emit(type) {
- var args = [];
- for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
- var doError = (type === 'error');
- var events = this._events;
- if (events !== undefined)
- doError = (doError && events.error === undefined);
- else if (!doError)
- return false;
- // If there is no 'error' event listener then throw.
- if (doError) {
- var er;
- if (args.length > 0)
- er = args[0];
- if (er instanceof Error) {
- // Note: The comments on the `throw` lines are intentional, they show
- // up in Node's output if this results in an unhandled exception.
- throw er; // Unhandled 'error' event
- }
- // At least give some kind of context to the user
- var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
- err.context = er;
- throw err; // Unhandled 'error' event
- }
- var handler = events[type];
- if (handler === undefined)
- return false;
- if (typeof handler === 'function') {
- ReflectApply(handler, this, args);
- } else {
- var len = handler.length;
- var listeners = arrayClone(handler, len);
- for (var i = 0; i < len; ++i)
- ReflectApply(listeners[i], this, args);
- }
- return true;
- };
- function _addListener(target, type, listener, prepend) {
- var m;
- var events;
- var existing;
- checkListener(listener);
- events = target._events;
- if (events === undefined) {
- events = target._events = Object.create(null);
- target._eventsCount = 0;
- } else {
- // To avoid recursion in the case that type === "newListener"! Before
- // adding it to the listeners, first emit "newListener".
- if (events.newListener !== undefined) {
- target.emit('newListener', type,
- listener.listener ? listener.listener : listener);
- // Re-assign `events` because a newListener handler could have caused the
- // this._events to be assigned to a new object
- events = target._events;
- }
- existing = events[type];
- }
- if (existing === undefined) {
- // Optimize the case of one listener. Don't need the extra array object.
- existing = events[type] = listener;
- ++target._eventsCount;
- } else {
- if (typeof existing === 'function') {
- // Adding the second element, need to change to array.
- existing = events[type] =
- prepend ? [listener, existing] : [existing, listener];
- // If we've already got an array, just append.
- } else if (prepend) {
- existing.unshift(listener);
- } else {
- existing.push(listener);
- }
- // Check for listener leak
- m = _getMaxListeners(target);
- if (m > 0 && existing.length > m && !existing.warned) {
- existing.warned = true;
- // No error code for this since it is a Warning
- // eslint-disable-next-line no-restricted-syntax
- var w = new Error('Possible EventEmitter memory leak detected. ' +
- existing.length + ' ' + String(type) + ' listeners ' +
- 'added. Use emitter.setMaxListeners() to ' +
- 'increase limit');
- w.name = 'MaxListenersExceededWarning';
- w.emitter = target;
- w.type = type;
- w.count = existing.length;
- ProcessEmitWarning(w);
- }
- }
- return target;
- }
- EventEmitter.prototype.addListener = function addListener(type, listener) {
- return _addListener(this, type, listener, false);
- };
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
- EventEmitter.prototype.prependListener =
- function prependListener(type, listener) {
- return _addListener(this, type, listener, true);
- };
- function onceWrapper() {
- if (!this.fired) {
- this.target.removeListener(this.type, this.wrapFn);
- this.fired = true;
- if (arguments.length === 0)
- return this.listener.call(this.target);
- return this.listener.apply(this.target, arguments);
- }
- }
- function _onceWrap(target, type, listener) {
- var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
- var wrapped = onceWrapper.bind(state);
- wrapped.listener = listener;
- state.wrapFn = wrapped;
- return wrapped;
- }
- EventEmitter.prototype.once = function once(type, listener) {
- checkListener(listener);
- this.on(type, _onceWrap(this, type, listener));
- return this;
- };
- EventEmitter.prototype.prependOnceListener =
- function prependOnceListener(type, listener) {
- checkListener(listener);
- this.prependListener(type, _onceWrap(this, type, listener));
- return this;
- };
- // Emits a 'removeListener' event if and only if the listener was removed.
- EventEmitter.prototype.removeListener =
- function removeListener(type, listener) {
- var list, events, position, i, originalListener;
- checkListener(listener);
- events = this._events;
- if (events === undefined)
- return this;
- list = events[type];
- if (list === undefined)
- return this;
- if (list === listener || list.listener === listener) {
- if (--this._eventsCount === 0)
- this._events = Object.create(null);
- else {
- delete events[type];
- if (events.removeListener)
- this.emit('removeListener', type, list.listener || listener);
- }
- } else if (typeof list !== 'function') {
- position = -1;
- for (i = list.length - 1; i >= 0; i--) {
- if (list[i] === listener || list[i].listener === listener) {
- originalListener = list[i].listener;
- position = i;
- break;
- }
- }
- if (position < 0)
- return this;
- if (position === 0)
- list.shift();
- else {
- spliceOne(list, position);
- }
- if (list.length === 1)
- events[type] = list[0];
- if (events.removeListener !== undefined)
- this.emit('removeListener', type, originalListener || listener);
- }
- return this;
- };
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.removeAllListeners =
- function removeAllListeners(type) {
- var listeners, events, i;
- events = this._events;
- if (events === undefined)
- return this;
- // not listening for removeListener, no need to emit
- if (events.removeListener === undefined) {
- if (arguments.length === 0) {
- this._events = Object.create(null);
- this._eventsCount = 0;
- } else if (events[type] !== undefined) {
- if (--this._eventsCount === 0)
- this._events = Object.create(null);
- else
- delete events[type];
- }
- return this;
- }
- // emit removeListener for all listeners on all events
- if (arguments.length === 0) {
- var keys = Object.keys(events);
- var key;
- for (i = 0; i < keys.length; ++i) {
- key = keys[i];
- if (key === 'removeListener') continue;
- this.removeAllListeners(key);
- }
- this.removeAllListeners('removeListener');
- this._events = Object.create(null);
- this._eventsCount = 0;
- return this;
- }
- listeners = events[type];
- if (typeof listeners === 'function') {
- this.removeListener(type, listeners);
- } else if (listeners !== undefined) {
- // LIFO order
- for (i = listeners.length - 1; i >= 0; i--) {
- this.removeListener(type, listeners[i]);
- }
- }
- return this;
- };
- function _listeners(target, type, unwrap) {
- var events = target._events;
- if (events === undefined)
- return [];
- var evlistener = events[type];
- if (evlistener === undefined)
- return [];
- if (typeof evlistener === 'function')
- return unwrap ? [evlistener.listener || evlistener] : [evlistener];
- return unwrap ?
- unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
- }
- EventEmitter.prototype.listeners = function listeners(type) {
- return _listeners(this, type, true);
- };
- EventEmitter.prototype.rawListeners = function rawListeners(type) {
- return _listeners(this, type, false);
- };
- EventEmitter.listenerCount = function(emitter, type) {
- if (typeof emitter.listenerCount === 'function') {
- return emitter.listenerCount(type);
- } else {
- return listenerCount.call(emitter, type);
- }
- };
- EventEmitter.prototype.listenerCount = listenerCount;
- function listenerCount(type) {
- var events = this._events;
- if (events !== undefined) {
- var evlistener = events[type];
- if (typeof evlistener === 'function') {
- return 1;
- } else if (evlistener !== undefined) {
- return evlistener.length;
- }
- }
- return 0;
- }
- EventEmitter.prototype.eventNames = function eventNames() {
- return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
- };
- function arrayClone(arr, n) {
- var copy = new Array(n);
- for (var i = 0; i < n; ++i)
- copy[i] = arr[i];
- return copy;
- }
- function spliceOne(list, index) {
- for (; index + 1 < list.length; index++)
- list[index] = list[index + 1];
- list.pop();
- }
- function unwrapListeners(arr) {
- var ret = new Array(arr.length);
- for (var i = 0; i < ret.length; ++i) {
- ret[i] = arr[i].listener || arr[i];
- }
- return ret;
- }
- function once(emitter, name) {
- return new Promise(function (resolve, reject) {
- function errorListener(err) {
- emitter.removeListener(name, resolver);
- reject(err);
- }
- function resolver() {
- if (typeof emitter.removeListener === 'function') {
- emitter.removeListener('error', errorListener);
- }
- resolve([].slice.call(arguments));
- };
- eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
- if (name !== 'error') {
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
- }
- });
- }
- function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
- if (typeof emitter.on === 'function') {
- eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
- }
- }
- function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
- if (typeof emitter.on === 'function') {
- if (flags.once) {
- emitter.once(name, listener);
- } else {
- emitter.on(name, listener);
- }
- } else if (typeof emitter.addEventListener === 'function') {
- // EventTarget does not have `error` event semantics like Node
- // EventEmitters, we do not listen for `error` events here.
- emitter.addEventListener(name, function wrapListener(arg) {
- // IE does not have builtin `{ once: true }` support so we
- // have to do it manually.
- if (flags.once) {
- emitter.removeEventListener(name, wrapListener);
- }
- listener(arg);
- });
- } else {
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
- }
- }
- /***/ }),
- /***/ 35369:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* unused harmony exports Collection, Iterable, List, Map, OrderedMap, OrderedSet, Range, Record, Repeat, Seq, Set, Stack, fromJS, get, getIn, has, hasIn, hash, is, isAssociative, isCollection, isImmutable, isIndexed, isKeyed, isList, isMap, isOrdered, isOrderedMap, isOrderedSet, isPlainObject, isRecord, isSeq, isSet, isStack, isValueObject, merge, mergeDeep, mergeDeepWith, mergeWith, remove, removeIn, set, setIn, update, updateIn, version */
- /**
- * MIT License
- *
- * Copyright (c) 2014-present, Lee Byron and other contributors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
- var DELETE = 'delete';
- // Constants describing the size of trie nodes.
- var SHIFT = 5; // Resulted in best performance after ______?
- var SIZE = 1 << SHIFT;
- var MASK = SIZE - 1;
- // A consistent shared value representing "not set" which equals nothing other
- // than itself, and nothing that could be provided externally.
- var NOT_SET = {};
- // Boolean references, Rough equivalent of `bool &`.
- function MakeRef() {
- return { value: false };
- }
- function SetRef(ref) {
- if (ref) {
- ref.value = true;
- }
- }
- // A function which returns a value representing an "owner" for transient writes
- // to tries. The return value will only ever equal itself, and will not equal
- // the return of any subsequent call of this function.
- function OwnerID() {}
- function ensureSize(iter) {
- if (iter.size === undefined) {
- iter.size = iter.__iterate(returnTrue);
- }
- return iter.size;
- }
- function wrapIndex(iter, index) {
- // This implements "is array index" which the ECMAString spec defines as:
- //
- // A String property name P is an array index if and only if
- // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal
- // to 2^32−1.
- //
- // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects
- if (typeof index !== 'number') {
- var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32
- if ('' + uint32Index !== index || uint32Index === 4294967295) {
- return NaN;
- }
- index = uint32Index;
- }
- return index < 0 ? ensureSize(iter) + index : index;
- }
- function returnTrue() {
- return true;
- }
- function wholeSlice(begin, end, size) {
- return (
- ((begin === 0 && !isNeg(begin)) ||
- (size !== undefined && begin <= -size)) &&
- (end === undefined || (size !== undefined && end >= size))
- );
- }
- function resolveBegin(begin, size) {
- return resolveIndex(begin, size, 0);
- }
- function resolveEnd(end, size) {
- return resolveIndex(end, size, size);
- }
- function resolveIndex(index, size, defaultIndex) {
- // Sanitize indices using this shorthand for ToInt32(argument)
- // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
- return index === undefined
- ? defaultIndex
- : isNeg(index)
- ? size === Infinity
- ? size
- : Math.max(0, size + index) | 0
- : size === undefined || size === index
- ? index
- : Math.min(size, index) | 0;
- }
- function isNeg(value) {
- // Account for -0 which is negative, but not less than 0.
- return value < 0 || (value === 0 && 1 / value === -Infinity);
- }
- var IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@';
- function isCollection(maybeCollection) {
- return Boolean(maybeCollection && maybeCollection[IS_COLLECTION_SYMBOL]);
- }
- var IS_KEYED_SYMBOL = '@@__IMMUTABLE_KEYED__@@';
- function isKeyed(maybeKeyed) {
- return Boolean(maybeKeyed && maybeKeyed[IS_KEYED_SYMBOL]);
- }
- var IS_INDEXED_SYMBOL = '@@__IMMUTABLE_INDEXED__@@';
- function isIndexed(maybeIndexed) {
- return Boolean(maybeIndexed && maybeIndexed[IS_INDEXED_SYMBOL]);
- }
- function isAssociative(maybeAssociative) {
- return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);
- }
- var Collection = function Collection(value) {
- return isCollection(value) ? value : Seq(value);
- };
- var KeyedCollection = /*@__PURE__*/(function (Collection) {
- function KeyedCollection(value) {
- return isKeyed(value) ? value : KeyedSeq(value);
- }
- if ( Collection ) KeyedCollection.__proto__ = Collection;
- KeyedCollection.prototype = Object.create( Collection && Collection.prototype );
- KeyedCollection.prototype.constructor = KeyedCollection;
- return KeyedCollection;
- }(Collection));
- var IndexedCollection = /*@__PURE__*/(function (Collection) {
- function IndexedCollection(value) {
- return isIndexed(value) ? value : IndexedSeq(value);
- }
- if ( Collection ) IndexedCollection.__proto__ = Collection;
- IndexedCollection.prototype = Object.create( Collection && Collection.prototype );
- IndexedCollection.prototype.constructor = IndexedCollection;
- return IndexedCollection;
- }(Collection));
- var SetCollection = /*@__PURE__*/(function (Collection) {
- function SetCollection(value) {
- return isCollection(value) && !isAssociative(value) ? value : SetSeq(value);
- }
- if ( Collection ) SetCollection.__proto__ = Collection;
- SetCollection.prototype = Object.create( Collection && Collection.prototype );
- SetCollection.prototype.constructor = SetCollection;
- return SetCollection;
- }(Collection));
- Collection.Keyed = KeyedCollection;
- Collection.Indexed = IndexedCollection;
- Collection.Set = SetCollection;
- var IS_SEQ_SYMBOL = '@@__IMMUTABLE_SEQ__@@';
- function isSeq(maybeSeq) {
- return Boolean(maybeSeq && maybeSeq[IS_SEQ_SYMBOL]);
- }
- var IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@';
- function isRecord(maybeRecord) {
- return Boolean(maybeRecord && maybeRecord[IS_RECORD_SYMBOL]);
- }
- function isImmutable(maybeImmutable) {
- return isCollection(maybeImmutable) || isRecord(maybeImmutable);
- }
- var IS_ORDERED_SYMBOL = '@@__IMMUTABLE_ORDERED__@@';
- function isOrdered(maybeOrdered) {
- return Boolean(maybeOrdered && maybeOrdered[IS_ORDERED_SYMBOL]);
- }
- var ITERATE_KEYS = 0;
- var ITERATE_VALUES = 1;
- var ITERATE_ENTRIES = 2;
- var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
- var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;
- var Iterator = function Iterator(next) {
- this.next = next;
- };
- Iterator.prototype.toString = function toString () {
- return '[Iterator]';
- };
- Iterator.KEYS = ITERATE_KEYS;
- Iterator.VALUES = ITERATE_VALUES;
- Iterator.ENTRIES = ITERATE_ENTRIES;
- Iterator.prototype.inspect = Iterator.prototype.toSource = function () {
- return this.toString();
- };
- Iterator.prototype[ITERATOR_SYMBOL] = function () {
- return this;
- };
- function iteratorValue(type, k, v, iteratorResult) {
- var value = type === 0 ? k : type === 1 ? v : [k, v];
- iteratorResult
- ? (iteratorResult.value = value)
- : (iteratorResult = {
- value: value,
- done: false,
- });
- return iteratorResult;
- }
- function iteratorDone() {
- return { value: undefined, done: true };
- }
- function hasIterator(maybeIterable) {
- if (Array.isArray(maybeIterable)) {
- // IE11 trick as it does not support `Symbol.iterator`
- return true;
- }
- return !!getIteratorFn(maybeIterable);
- }
- function isIterator(maybeIterator) {
- return maybeIterator && typeof maybeIterator.next === 'function';
- }
- function getIterator(iterable) {
- var iteratorFn = getIteratorFn(iterable);
- return iteratorFn && iteratorFn.call(iterable);
- }
- function getIteratorFn(iterable) {
- var iteratorFn =
- iterable &&
- ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) ||
- iterable[FAUX_ITERATOR_SYMBOL]);
- if (typeof iteratorFn === 'function') {
- return iteratorFn;
- }
- }
- function isEntriesIterable(maybeIterable) {
- var iteratorFn = getIteratorFn(maybeIterable);
- return iteratorFn && iteratorFn === maybeIterable.entries;
- }
- function isKeysIterable(maybeIterable) {
- var iteratorFn = getIteratorFn(maybeIterable);
- return iteratorFn && iteratorFn === maybeIterable.keys;
- }
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function isArrayLike(value) {
- if (Array.isArray(value) || typeof value === 'string') {
- return true;
- }
- return (
- value &&
- typeof value === 'object' &&
- Number.isInteger(value.length) &&
- value.length >= 0 &&
- (value.length === 0
- ? // Only {length: 0} is considered Array-like.
- Object.keys(value).length === 1
- : // An object is only Array-like if it has a property where the last value
- // in the array-like may be found (which could be undefined).
- value.hasOwnProperty(value.length - 1))
- );
- }
- var Seq = /*@__PURE__*/(function (Collection) {
- function Seq(value) {
- return value === null || value === undefined
- ? emptySequence()
- : isImmutable(value)
- ? value.toSeq()
- : seqFromValue(value);
- }
- if ( Collection ) Seq.__proto__ = Collection;
- Seq.prototype = Object.create( Collection && Collection.prototype );
- Seq.prototype.constructor = Seq;
- Seq.prototype.toSeq = function toSeq () {
- return this;
- };
- Seq.prototype.toString = function toString () {
- return this.__toString('Seq {', '}');
- };
- Seq.prototype.cacheResult = function cacheResult () {
- if (!this._cache && this.__iterateUncached) {
- this._cache = this.entrySeq().toArray();
- this.size = this._cache.length;
- }
- return this;
- };
- // abstract __iterateUncached(fn, reverse)
- Seq.prototype.__iterate = function __iterate (fn, reverse) {
- var cache = this._cache;
- if (cache) {
- var size = cache.length;
- var i = 0;
- while (i !== size) {
- var entry = cache[reverse ? size - ++i : i++];
- if (fn(entry[1], entry[0], this) === false) {
- break;
- }
- }
- return i;
- }
- return this.__iterateUncached(fn, reverse);
- };
- // abstract __iteratorUncached(type, reverse)
- Seq.prototype.__iterator = function __iterator (type, reverse) {
- var cache = this._cache;
- if (cache) {
- var size = cache.length;
- var i = 0;
- return new Iterator(function () {
- if (i === size) {
- return iteratorDone();
- }
- var entry = cache[reverse ? size - ++i : i++];
- return iteratorValue(type, entry[0], entry[1]);
- });
- }
- return this.__iteratorUncached(type, reverse);
- };
- return Seq;
- }(Collection));
- var KeyedSeq = /*@__PURE__*/(function (Seq) {
- function KeyedSeq(value) {
- return value === null || value === undefined
- ? emptySequence().toKeyedSeq()
- : isCollection(value)
- ? isKeyed(value)
- ? value.toSeq()
- : value.fromEntrySeq()
- : isRecord(value)
- ? value.toSeq()
- : keyedSeqFromValue(value);
- }
- if ( Seq ) KeyedSeq.__proto__ = Seq;
- KeyedSeq.prototype = Object.create( Seq && Seq.prototype );
- KeyedSeq.prototype.constructor = KeyedSeq;
- KeyedSeq.prototype.toKeyedSeq = function toKeyedSeq () {
- return this;
- };
- return KeyedSeq;
- }(Seq));
- var IndexedSeq = /*@__PURE__*/(function (Seq) {
- function IndexedSeq(value) {
- return value === null || value === undefined
- ? emptySequence()
- : isCollection(value)
- ? isKeyed(value)
- ? value.entrySeq()
- : value.toIndexedSeq()
- : isRecord(value)
- ? value.toSeq().entrySeq()
- : indexedSeqFromValue(value);
- }
- if ( Seq ) IndexedSeq.__proto__ = Seq;
- IndexedSeq.prototype = Object.create( Seq && Seq.prototype );
- IndexedSeq.prototype.constructor = IndexedSeq;
- IndexedSeq.of = function of (/*...values*/) {
- return IndexedSeq(arguments);
- };
- IndexedSeq.prototype.toIndexedSeq = function toIndexedSeq () {
- return this;
- };
- IndexedSeq.prototype.toString = function toString () {
- return this.__toString('Seq [', ']');
- };
- return IndexedSeq;
- }(Seq));
- var SetSeq = /*@__PURE__*/(function (Seq) {
- function SetSeq(value) {
- return (
- isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value)
- ).toSetSeq();
- }
- if ( Seq ) SetSeq.__proto__ = Seq;
- SetSeq.prototype = Object.create( Seq && Seq.prototype );
- SetSeq.prototype.constructor = SetSeq;
- SetSeq.of = function of (/*...values*/) {
- return SetSeq(arguments);
- };
- SetSeq.prototype.toSetSeq = function toSetSeq () {
- return this;
- };
- return SetSeq;
- }(Seq));
- Seq.isSeq = isSeq;
- Seq.Keyed = KeyedSeq;
- Seq.Set = SetSeq;
- Seq.Indexed = IndexedSeq;
- Seq.prototype[IS_SEQ_SYMBOL] = true;
- // #pragma Root Sequences
- var ArraySeq = /*@__PURE__*/(function (IndexedSeq) {
- function ArraySeq(array) {
- this._array = array;
- this.size = array.length;
- }
- if ( IndexedSeq ) ArraySeq.__proto__ = IndexedSeq;
- ArraySeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype );
- ArraySeq.prototype.constructor = ArraySeq;
- ArraySeq.prototype.get = function get (index, notSetValue) {
- return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;
- };
- ArraySeq.prototype.__iterate = function __iterate (fn, reverse) {
- var array = this._array;
- var size = array.length;
- var i = 0;
- while (i !== size) {
- var ii = reverse ? size - ++i : i++;
- if (fn(array[ii], ii, this) === false) {
- break;
- }
- }
- return i;
- };
- ArraySeq.prototype.__iterator = function __iterator (type, reverse) {
- var array = this._array;
- var size = array.length;
- var i = 0;
- return new Iterator(function () {
- if (i === size) {
- return iteratorDone();
- }
- var ii = reverse ? size - ++i : i++;
- return iteratorValue(type, ii, array[ii]);
- });
- };
- return ArraySeq;
- }(IndexedSeq));
- var ObjectSeq = /*@__PURE__*/(function (KeyedSeq) {
- function ObjectSeq(object) {
- var keys = Object.keys(object);
- this._object = object;
- this._keys = keys;
- this.size = keys.length;
- }
- if ( KeyedSeq ) ObjectSeq.__proto__ = KeyedSeq;
- ObjectSeq.prototype = Object.create( KeyedSeq && KeyedSeq.prototype );
- ObjectSeq.prototype.constructor = ObjectSeq;
- ObjectSeq.prototype.get = function get (key, notSetValue) {
- if (notSetValue !== undefined && !this.has(key)) {
- return notSetValue;
- }
- return this._object[key];
- };
- ObjectSeq.prototype.has = function has (key) {
- return hasOwnProperty.call(this._object, key);
- };
- ObjectSeq.prototype.__iterate = function __iterate (fn, reverse) {
- var object = this._object;
- var keys = this._keys;
- var size = keys.length;
- var i = 0;
- while (i !== size) {
- var key = keys[reverse ? size - ++i : i++];
- if (fn(object[key], key, this) === false) {
- break;
- }
- }
- return i;
- };
- ObjectSeq.prototype.__iterator = function __iterator (type, reverse) {
- var object = this._object;
- var keys = this._keys;
- var size = keys.length;
- var i = 0;
- return new Iterator(function () {
- if (i === size) {
- return iteratorDone();
- }
- var key = keys[reverse ? size - ++i : i++];
- return iteratorValue(type, key, object[key]);
- });
- };
- return ObjectSeq;
- }(KeyedSeq));
- ObjectSeq.prototype[IS_ORDERED_SYMBOL] = true;
- var CollectionSeq = /*@__PURE__*/(function (IndexedSeq) {
- function CollectionSeq(collection) {
- this._collection = collection;
- this.size = collection.length || collection.size;
- }
- if ( IndexedSeq ) CollectionSeq.__proto__ = IndexedSeq;
- CollectionSeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype );
- CollectionSeq.prototype.constructor = CollectionSeq;
- CollectionSeq.prototype.__iterateUncached = function __iterateUncached (fn, reverse) {
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var collection = this._collection;
- var iterator = getIterator(collection);
- var iterations = 0;
- if (isIterator(iterator)) {
- var step;
- while (!(step = iterator.next()).done) {
- if (fn(step.value, iterations++, this) === false) {
- break;
- }
- }
- }
- return iterations;
- };
- CollectionSeq.prototype.__iteratorUncached = function __iteratorUncached (type, reverse) {
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var collection = this._collection;
- var iterator = getIterator(collection);
- if (!isIterator(iterator)) {
- return new Iterator(iteratorDone);
- }
- var iterations = 0;
- return new Iterator(function () {
- var step = iterator.next();
- return step.done ? step : iteratorValue(type, iterations++, step.value);
- });
- };
- return CollectionSeq;
- }(IndexedSeq));
- // # pragma Helper functions
- var EMPTY_SEQ;
- function emptySequence() {
- return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));
- }
- function keyedSeqFromValue(value) {
- var seq = maybeIndexedSeqFromValue(value);
- if (seq) {
- return seq.fromEntrySeq();
- }
- if (typeof value === 'object') {
- return new ObjectSeq(value);
- }
- throw new TypeError(
- 'Expected Array or collection object of [k, v] entries, or keyed object: ' +
- value
- );
- }
- function indexedSeqFromValue(value) {
- var seq = maybeIndexedSeqFromValue(value);
- if (seq) {
- return seq;
- }
- throw new TypeError(
- 'Expected Array or collection object of values: ' + value
- );
- }
- function seqFromValue(value) {
- var seq = maybeIndexedSeqFromValue(value);
- if (seq) {
- return isEntriesIterable(value)
- ? seq.fromEntrySeq()
- : isKeysIterable(value)
- ? seq.toSetSeq()
- : seq;
- }
- if (typeof value === 'object') {
- return new ObjectSeq(value);
- }
- throw new TypeError(
- 'Expected Array or collection object of values, or keyed object: ' + value
- );
- }
- function maybeIndexedSeqFromValue(value) {
- return isArrayLike(value)
- ? new ArraySeq(value)
- : hasIterator(value)
- ? new CollectionSeq(value)
- : undefined;
- }
- var IS_MAP_SYMBOL = '@@__IMMUTABLE_MAP__@@';
- function isMap(maybeMap) {
- return Boolean(maybeMap && maybeMap[IS_MAP_SYMBOL]);
- }
- function isOrderedMap(maybeOrderedMap) {
- return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);
- }
- function isValueObject(maybeValue) {
- return Boolean(
- maybeValue &&
- typeof maybeValue.equals === 'function' &&
- typeof maybeValue.hashCode === 'function'
- );
- }
- /**
- * An extension of the "same-value" algorithm as [described for use by ES6 Map
- * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)
- *
- * NaN is considered the same as NaN, however -0 and 0 are considered the same
- * value, which is different from the algorithm described by
- * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
- *
- * This is extended further to allow Objects to describe the values they
- * represent, by way of `valueOf` or `equals` (and `hashCode`).
- *
- * Note: because of this extension, the key equality of Immutable.Map and the
- * value equality of Immutable.Set will differ from ES6 Map and Set.
- *
- * ### Defining custom values
- *
- * The easiest way to describe the value an object represents is by implementing
- * `valueOf`. For example, `Date` represents a value by returning a unix
- * timestamp for `valueOf`:
- *
- * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...
- * var date2 = new Date(1234567890000);
- * date1.valueOf(); // 1234567890000
- * assert( date1 !== date2 );
- * assert( Immutable.is( date1, date2 ) );
- *
- * Note: overriding `valueOf` may have other implications if you use this object
- * where JavaScript expects a primitive, such as implicit string coercion.
- *
- * For more complex types, especially collections, implementing `valueOf` may
- * not be performant. An alternative is to implement `equals` and `hashCode`.
- *
- * `equals` takes another object, presumably of similar type, and returns true
- * if it is equal. Equality is symmetrical, so the same result should be
- * returned if this and the argument are flipped.
- *
- * assert( a.equals(b) === b.equals(a) );
- *
- * `hashCode` returns a 32bit integer number representing the object which will
- * be used to determine how to store the value object in a Map or Set. You must
- * provide both or neither methods, one must not exist without the other.
- *
- * Also, an important relationship between these methods must be upheld: if two
- * values are equal, they *must* return the same hashCode. If the values are not
- * equal, they might have the same hashCode; this is called a hash collision,
- * and while undesirable for performance reasons, it is acceptable.
- *
- * if (a.equals(b)) {
- * assert( a.hashCode() === b.hashCode() );
- * }
- *
- * All Immutable collections are Value Objects: they implement `equals()`
- * and `hashCode()`.
- */
- function is(valueA, valueB) {
- if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
- return true;
- }
- if (!valueA || !valueB) {
- return false;
- }
- if (
- typeof valueA.valueOf === 'function' &&
- typeof valueB.valueOf === 'function'
- ) {
- valueA = valueA.valueOf();
- valueB = valueB.valueOf();
- if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
- return true;
- }
- if (!valueA || !valueB) {
- return false;
- }
- }
- return !!(
- isValueObject(valueA) &&
- isValueObject(valueB) &&
- valueA.equals(valueB)
- );
- }
- var imul =
- typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2
- ? Math.imul
- : function imul(a, b) {
- a |= 0; // int
- b |= 0; // int
- var c = a & 0xffff;
- var d = b & 0xffff;
- // Shift by 0 fixes the sign on the high part.
- return (c * d + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0)) | 0; // int
- };
- // v8 has an optimization for storing 31-bit signed numbers.
- // Values which have either 00 or 11 as the high order bits qualify.
- // This function drops the highest order bit in a signed number, maintaining
- // the sign bit.
- function smi(i32) {
- return ((i32 >>> 1) & 0x40000000) | (i32 & 0xbfffffff);
- }
- var defaultValueOf = Object.prototype.valueOf;
- function hash(o) {
- if (o == null) {
- return hashNullish(o);
- }
- if (typeof o.hashCode === 'function') {
- // Drop any high bits from accidentally long hash codes.
- return smi(o.hashCode(o));
- }
- var v = valueOf(o);
- if (v == null) {
- return hashNullish(v);
- }
- switch (typeof v) {
- case 'boolean':
- // The hash values for built-in constants are a 1 value for each 5-byte
- // shift region expect for the first, which encodes the value. This
- // reduces the odds of a hash collision for these common values.
- return v ? 0x42108421 : 0x42108420;
- case 'number':
- return hashNumber(v);
- case 'string':
- return v.length > STRING_HASH_CACHE_MIN_STRLEN
- ? cachedHashString(v)
- : hashString(v);
- case 'object':
- case 'function':
- return hashJSObj(v);
- case 'symbol':
- return hashSymbol(v);
- default:
- if (typeof v.toString === 'function') {
- return hashString(v.toString());
- }
- throw new Error('Value type ' + typeof v + ' cannot be hashed.');
- }
- }
- function hashNullish(nullish) {
- return nullish === null ? 0x42108422 : /* undefined */ 0x42108423;
- }
- // Compress arbitrarily large numbers into smi hashes.
- function hashNumber(n) {
- if (n !== n || n === Infinity) {
- return 0;
- }
- var hash = n | 0;
- if (hash !== n) {
- hash ^= n * 0xffffffff;
- }
- while (n > 0xffffffff) {
- n /= 0xffffffff;
- hash ^= n;
- }
- return smi(hash);
- }
- function cachedHashString(string) {
- var hashed = stringHashCache[string];
- if (hashed === undefined) {
- hashed = hashString(string);
- if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {
- STRING_HASH_CACHE_SIZE = 0;
- stringHashCache = {};
- }
- STRING_HASH_CACHE_SIZE++;
- stringHashCache[string] = hashed;
- }
- return hashed;
- }
- // http://jsperf.com/hashing-strings
- function hashString(string) {
- // This is the hash from JVM
- // The hash code for a string is computed as
- // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],
- // where s[i] is the ith character of the string and n is the length of
- // the string. We "mod" the result to make it between 0 (inclusive) and 2^31
- // (exclusive) by dropping high bits.
- var hashed = 0;
- for (var ii = 0; ii < string.length; ii++) {
- hashed = (31 * hashed + string.charCodeAt(ii)) | 0;
- }
- return smi(hashed);
- }
- function hashSymbol(sym) {
- var hashed = symbolMap[sym];
- if (hashed !== undefined) {
- return hashed;
- }
- hashed = nextHash();
- symbolMap[sym] = hashed;
- return hashed;
- }
- function hashJSObj(obj) {
- var hashed;
- if (usingWeakMap) {
- hashed = weakMap.get(obj);
- if (hashed !== undefined) {
- return hashed;
- }
- }
- hashed = obj[UID_HASH_KEY];
- if (hashed !== undefined) {
- return hashed;
- }
- if (!canDefineProperty) {
- hashed = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];
- if (hashed !== undefined) {
- return hashed;
- }
- hashed = getIENodeHash(obj);
- if (hashed !== undefined) {
- return hashed;
- }
- }
- hashed = nextHash();
- if (usingWeakMap) {
- weakMap.set(obj, hashed);
- } else if (isExtensible !== undefined && isExtensible(obj) === false) {
- throw new Error('Non-extensible objects are not allowed as keys.');
- } else if (canDefineProperty) {
- Object.defineProperty(obj, UID_HASH_KEY, {
- enumerable: false,
- configurable: false,
- writable: false,
- value: hashed,
- });
- } else if (
- obj.propertyIsEnumerable !== undefined &&
- obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable
- ) {
- // Since we can't define a non-enumerable property on the object
- // we'll hijack one of the less-used non-enumerable properties to
- // save our hash on it. Since this is a function it will not show up in
- // `JSON.stringify` which is what we want.
- obj.propertyIsEnumerable = function () {
- return this.constructor.prototype.propertyIsEnumerable.apply(
- this,
- arguments
- );
- };
- obj.propertyIsEnumerable[UID_HASH_KEY] = hashed;
- } else if (obj.nodeType !== undefined) {
- // At this point we couldn't get the IE `uniqueID` to use as a hash
- // and we couldn't use a non-enumerable property to exploit the
- // dontEnum bug so we simply add the `UID_HASH_KEY` on the node
- // itself.
- obj[UID_HASH_KEY] = hashed;
- } else {
- throw new Error('Unable to set a non-enumerable property on object.');
- }
- return hashed;
- }
- // Get references to ES5 object methods.
- var isExtensible = Object.isExtensible;
- // True if Object.defineProperty works as expected. IE8 fails this test.
- var canDefineProperty = (function () {
- try {
- Object.defineProperty({}, '@', {});
- return true;
- } catch (e) {
- return false;
- }
- })();
- // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it
- // and avoid memory leaks from the IE cloneNode bug.
- function getIENodeHash(node) {
- if (node && node.nodeType > 0) {
- switch (node.nodeType) {
- case 1: // Element
- return node.uniqueID;
- case 9: // Document
- return node.documentElement && node.documentElement.uniqueID;
- }
- }
- }
- function valueOf(obj) {
- return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function'
- ? obj.valueOf(obj)
- : obj;
- }
- function nextHash() {
- var nextHash = ++_objHashUID;
- if (_objHashUID & 0x40000000) {
- _objHashUID = 0;
- }
- return nextHash;
- }
- // If possible, use a WeakMap.
- var usingWeakMap = typeof WeakMap === 'function';
- var weakMap;
- if (usingWeakMap) {
- weakMap = new WeakMap();
- }
- var symbolMap = Object.create(null);
- var _objHashUID = 0;
- var UID_HASH_KEY = '__immutablehash__';
- if (typeof Symbol === 'function') {
- UID_HASH_KEY = Symbol(UID_HASH_KEY);
- }
- var STRING_HASH_CACHE_MIN_STRLEN = 16;
- var STRING_HASH_CACHE_MAX_SIZE = 255;
- var STRING_HASH_CACHE_SIZE = 0;
- var stringHashCache = {};
- var ToKeyedSequence = /*@__PURE__*/(function (KeyedSeq) {
- function ToKeyedSequence(indexed, useKeys) {
- this._iter = indexed;
- this._useKeys = useKeys;
- this.size = indexed.size;
- }
- if ( KeyedSeq ) ToKeyedSequence.__proto__ = KeyedSeq;
- ToKeyedSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype );
- ToKeyedSequence.prototype.constructor = ToKeyedSequence;
- ToKeyedSequence.prototype.get = function get (key, notSetValue) {
- return this._iter.get(key, notSetValue);
- };
- ToKeyedSequence.prototype.has = function has (key) {
- return this._iter.has(key);
- };
- ToKeyedSequence.prototype.valueSeq = function valueSeq () {
- return this._iter.valueSeq();
- };
- ToKeyedSequence.prototype.reverse = function reverse () {
- var this$1$1 = this;
- var reversedSequence = reverseFactory(this, true);
- if (!this._useKeys) {
- reversedSequence.valueSeq = function () { return this$1$1._iter.toSeq().reverse(); };
- }
- return reversedSequence;
- };
- ToKeyedSequence.prototype.map = function map (mapper, context) {
- var this$1$1 = this;
- var mappedSequence = mapFactory(this, mapper, context);
- if (!this._useKeys) {
- mappedSequence.valueSeq = function () { return this$1$1._iter.toSeq().map(mapper, context); };
- }
- return mappedSequence;
- };
- ToKeyedSequence.prototype.__iterate = function __iterate (fn, reverse) {
- var this$1$1 = this;
- return this._iter.__iterate(function (v, k) { return fn(v, k, this$1$1); }, reverse);
- };
- ToKeyedSequence.prototype.__iterator = function __iterator (type, reverse) {
- return this._iter.__iterator(type, reverse);
- };
- return ToKeyedSequence;
- }(KeyedSeq));
- ToKeyedSequence.prototype[IS_ORDERED_SYMBOL] = true;
- var ToIndexedSequence = /*@__PURE__*/(function (IndexedSeq) {
- function ToIndexedSequence(iter) {
- this._iter = iter;
- this.size = iter.size;
- }
- if ( IndexedSeq ) ToIndexedSequence.__proto__ = IndexedSeq;
- ToIndexedSequence.prototype = Object.create( IndexedSeq && IndexedSeq.prototype );
- ToIndexedSequence.prototype.constructor = ToIndexedSequence;
- ToIndexedSequence.prototype.includes = function includes (value) {
- return this._iter.includes(value);
- };
- ToIndexedSequence.prototype.__iterate = function __iterate (fn, reverse) {
- var this$1$1 = this;
- var i = 0;
- reverse && ensureSize(this);
- return this._iter.__iterate(
- function (v) { return fn(v, reverse ? this$1$1.size - ++i : i++, this$1$1); },
- reverse
- );
- };
- ToIndexedSequence.prototype.__iterator = function __iterator (type, reverse) {
- var this$1$1 = this;
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- var i = 0;
- reverse && ensureSize(this);
- return new Iterator(function () {
- var step = iterator.next();
- return step.done
- ? step
- : iteratorValue(
- type,
- reverse ? this$1$1.size - ++i : i++,
- step.value,
- step
- );
- });
- };
- return ToIndexedSequence;
- }(IndexedSeq));
- var ToSetSequence = /*@__PURE__*/(function (SetSeq) {
- function ToSetSequence(iter) {
- this._iter = iter;
- this.size = iter.size;
- }
- if ( SetSeq ) ToSetSequence.__proto__ = SetSeq;
- ToSetSequence.prototype = Object.create( SetSeq && SetSeq.prototype );
- ToSetSequence.prototype.constructor = ToSetSequence;
- ToSetSequence.prototype.has = function has (key) {
- return this._iter.includes(key);
- };
- ToSetSequence.prototype.__iterate = function __iterate (fn, reverse) {
- var this$1$1 = this;
- return this._iter.__iterate(function (v) { return fn(v, v, this$1$1); }, reverse);
- };
- ToSetSequence.prototype.__iterator = function __iterator (type, reverse) {
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- return new Iterator(function () {
- var step = iterator.next();
- return step.done
- ? step
- : iteratorValue(type, step.value, step.value, step);
- });
- };
- return ToSetSequence;
- }(SetSeq));
- var FromEntriesSequence = /*@__PURE__*/(function (KeyedSeq) {
- function FromEntriesSequence(entries) {
- this._iter = entries;
- this.size = entries.size;
- }
- if ( KeyedSeq ) FromEntriesSequence.__proto__ = KeyedSeq;
- FromEntriesSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype );
- FromEntriesSequence.prototype.constructor = FromEntriesSequence;
- FromEntriesSequence.prototype.entrySeq = function entrySeq () {
- return this._iter.toSeq();
- };
- FromEntriesSequence.prototype.__iterate = function __iterate (fn, reverse) {
- var this$1$1 = this;
- return this._iter.__iterate(function (entry) {
- // Check if entry exists first so array access doesn't throw for holes
- // in the parent iteration.
- if (entry) {
- validateEntry(entry);
- var indexedCollection = isCollection(entry);
- return fn(
- indexedCollection ? entry.get(1) : entry[1],
- indexedCollection ? entry.get(0) : entry[0],
- this$1$1
- );
- }
- }, reverse);
- };
- FromEntriesSequence.prototype.__iterator = function __iterator (type, reverse) {
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- return new Iterator(function () {
- while (true) {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- // Check if entry exists first so array access doesn't throw for holes
- // in the parent iteration.
- if (entry) {
- validateEntry(entry);
- var indexedCollection = isCollection(entry);
- return iteratorValue(
- type,
- indexedCollection ? entry.get(0) : entry[0],
- indexedCollection ? entry.get(1) : entry[1],
- step
- );
- }
- }
- });
- };
- return FromEntriesSequence;
- }(KeyedSeq));
- ToIndexedSequence.prototype.cacheResult =
- ToKeyedSequence.prototype.cacheResult =
- ToSetSequence.prototype.cacheResult =
- FromEntriesSequence.prototype.cacheResult =
- cacheResultThrough;
- function flipFactory(collection) {
- var flipSequence = makeSequence(collection);
- flipSequence._iter = collection;
- flipSequence.size = collection.size;
- flipSequence.flip = function () { return collection; };
- flipSequence.reverse = function () {
- var reversedSequence = collection.reverse.apply(this); // super.reverse()
- reversedSequence.flip = function () { return collection.reverse(); };
- return reversedSequence;
- };
- flipSequence.has = function (key) { return collection.includes(key); };
- flipSequence.includes = function (key) { return collection.has(key); };
- flipSequence.cacheResult = cacheResultThrough;
- flipSequence.__iterateUncached = function (fn, reverse) {
- var this$1$1 = this;
- return collection.__iterate(function (v, k) { return fn(k, v, this$1$1) !== false; }, reverse);
- };
- flipSequence.__iteratorUncached = function (type, reverse) {
- if (type === ITERATE_ENTRIES) {
- var iterator = collection.__iterator(type, reverse);
- return new Iterator(function () {
- var step = iterator.next();
- if (!step.done) {
- var k = step.value[0];
- step.value[0] = step.value[1];
- step.value[1] = k;
- }
- return step;
- });
- }
- return collection.__iterator(
- type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES,
- reverse
- );
- };
- return flipSequence;
- }
- function mapFactory(collection, mapper, context) {
- var mappedSequence = makeSequence(collection);
- mappedSequence.size = collection.size;
- mappedSequence.has = function (key) { return collection.has(key); };
- mappedSequence.get = function (key, notSetValue) {
- var v = collection.get(key, NOT_SET);
- return v === NOT_SET
- ? notSetValue
- : mapper.call(context, v, key, collection);
- };
- mappedSequence.__iterateUncached = function (fn, reverse) {
- var this$1$1 = this;
- return collection.__iterate(
- function (v, k, c) { return fn(mapper.call(context, v, k, c), k, this$1$1) !== false; },
- reverse
- );
- };
- mappedSequence.__iteratorUncached = function (type, reverse) {
- var iterator = collection.__iterator(ITERATE_ENTRIES, reverse);
- return new Iterator(function () {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- var key = entry[0];
- return iteratorValue(
- type,
- key,
- mapper.call(context, entry[1], key, collection),
- step
- );
- });
- };
- return mappedSequence;
- }
- function reverseFactory(collection, useKeys) {
- var this$1$1 = this;
- var reversedSequence = makeSequence(collection);
- reversedSequence._iter = collection;
- reversedSequence.size = collection.size;
- reversedSequence.reverse = function () { return collection; };
- if (collection.flip) {
- reversedSequence.flip = function () {
- var flipSequence = flipFactory(collection);
- flipSequence.reverse = function () { return collection.flip(); };
- return flipSequence;
- };
- }
- reversedSequence.get = function (key, notSetValue) { return collection.get(useKeys ? key : -1 - key, notSetValue); };
- reversedSequence.has = function (key) { return collection.has(useKeys ? key : -1 - key); };
- reversedSequence.includes = function (value) { return collection.includes(value); };
- reversedSequence.cacheResult = cacheResultThrough;
- reversedSequence.__iterate = function (fn, reverse) {
- var this$1$1 = this;
- var i = 0;
- reverse && ensureSize(collection);
- return collection.__iterate(
- function (v, k) { return fn(v, useKeys ? k : reverse ? this$1$1.size - ++i : i++, this$1$1); },
- !reverse
- );
- };
- reversedSequence.__iterator = function (type, reverse) {
- var i = 0;
- reverse && ensureSize(collection);
- var iterator = collection.__iterator(ITERATE_ENTRIES, !reverse);
- return new Iterator(function () {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- return iteratorValue(
- type,
- useKeys ? entry[0] : reverse ? this$1$1.size - ++i : i++,
- entry[1],
- step
- );
- });
- };
- return reversedSequence;
- }
- function filterFactory(collection, predicate, context, useKeys) {
- var filterSequence = makeSequence(collection);
- if (useKeys) {
- filterSequence.has = function (key) {
- var v = collection.get(key, NOT_SET);
- return v !== NOT_SET && !!predicate.call(context, v, key, collection);
- };
- filterSequence.get = function (key, notSetValue) {
- var v = collection.get(key, NOT_SET);
- return v !== NOT_SET && predicate.call(context, v, key, collection)
- ? v
- : notSetValue;
- };
- }
- filterSequence.__iterateUncached = function (fn, reverse) {
- var this$1$1 = this;
- var iterations = 0;
- collection.__iterate(function (v, k, c) {
- if (predicate.call(context, v, k, c)) {
- iterations++;
- return fn(v, useKeys ? k : iterations - 1, this$1$1);
- }
- }, reverse);
- return iterations;
- };
- filterSequence.__iteratorUncached = function (type, reverse) {
- var iterator = collection.__iterator(ITERATE_ENTRIES, reverse);
- var iterations = 0;
- return new Iterator(function () {
- while (true) {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- var key = entry[0];
- var value = entry[1];
- if (predicate.call(context, value, key, collection)) {
- return iteratorValue(type, useKeys ? key : iterations++, value, step);
- }
- }
- });
- };
- return filterSequence;
- }
- function countByFactory(collection, grouper, context) {
- var groups = Map().asMutable();
- collection.__iterate(function (v, k) {
- groups.update(grouper.call(context, v, k, collection), 0, function (a) { return a + 1; });
- });
- return groups.asImmutable();
- }
- function groupByFactory(collection, grouper, context) {
- var isKeyedIter = isKeyed(collection);
- var groups = (isOrdered(collection) ? OrderedMap() : Map()).asMutable();
- collection.__iterate(function (v, k) {
- groups.update(
- grouper.call(context, v, k, collection),
- function (a) { return ((a = a || []), a.push(isKeyedIter ? [k, v] : v), a); }
- );
- });
- var coerce = collectionClass(collection);
- return groups.map(function (arr) { return reify(collection, coerce(arr)); }).asImmutable();
- }
- function sliceFactory(collection, begin, end, useKeys) {
- var originalSize = collection.size;
- if (wholeSlice(begin, end, originalSize)) {
- return collection;
- }
- var resolvedBegin = resolveBegin(begin, originalSize);
- var resolvedEnd = resolveEnd(end, originalSize);
- // begin or end will be NaN if they were provided as negative numbers and
- // this collection's size is unknown. In that case, cache first so there is
- // a known size and these do not resolve to NaN.
- if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {
- return sliceFactory(collection.toSeq().cacheResult(), begin, end, useKeys);
- }
- // Note: resolvedEnd is undefined when the original sequence's length is
- // unknown and this slice did not supply an end and should contain all
- // elements after resolvedBegin.
- // In that case, resolvedSize will be NaN and sliceSize will remain undefined.
- var resolvedSize = resolvedEnd - resolvedBegin;
- var sliceSize;
- if (resolvedSize === resolvedSize) {
- sliceSize = resolvedSize < 0 ? 0 : resolvedSize;
- }
- var sliceSeq = makeSequence(collection);
- // If collection.size is undefined, the size of the realized sliceSeq is
- // unknown at this point unless the number of items to slice is 0
- sliceSeq.size =
- sliceSize === 0 ? sliceSize : (collection.size && sliceSize) || undefined;
- if (!useKeys && isSeq(collection) && sliceSize >= 0) {
- sliceSeq.get = function (index, notSetValue) {
- index = wrapIndex(this, index);
- return index >= 0 && index < sliceSize
- ? collection.get(index + resolvedBegin, notSetValue)
- : notSetValue;
- };
- }
- sliceSeq.__iterateUncached = function (fn, reverse) {
- var this$1$1 = this;
- if (sliceSize === 0) {
- return 0;
- }
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var skipped = 0;
- var isSkipping = true;
- var iterations = 0;
- collection.__iterate(function (v, k) {
- if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {
- iterations++;
- return (
- fn(v, useKeys ? k : iterations - 1, this$1$1) !== false &&
- iterations !== sliceSize
- );
- }
- });
- return iterations;
- };
- sliceSeq.__iteratorUncached = function (type, reverse) {
- if (sliceSize !== 0 && reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- // Don't bother instantiating parent iterator if taking 0.
- if (sliceSize === 0) {
- return new Iterator(iteratorDone);
- }
- var iterator = collection.__iterator(type, reverse);
- var skipped = 0;
- var iterations = 0;
- return new Iterator(function () {
- while (skipped++ < resolvedBegin) {
- iterator.next();
- }
- if (++iterations > sliceSize) {
- return iteratorDone();
- }
- var step = iterator.next();
- if (useKeys || type === ITERATE_VALUES || step.done) {
- return step;
- }
- if (type === ITERATE_KEYS) {
- return iteratorValue(type, iterations - 1, undefined, step);
- }
- return iteratorValue(type, iterations - 1, step.value[1], step);
- });
- };
- return sliceSeq;
- }
- function takeWhileFactory(collection, predicate, context) {
- var takeSequence = makeSequence(collection);
- takeSequence.__iterateUncached = function (fn, reverse) {
- var this$1$1 = this;
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var iterations = 0;
- collection.__iterate(
- function (v, k, c) { return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$1$1); }
- );
- return iterations;
- };
- takeSequence.__iteratorUncached = function (type, reverse) {
- var this$1$1 = this;
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterator = collection.__iterator(ITERATE_ENTRIES, reverse);
- var iterating = true;
- return new Iterator(function () {
- if (!iterating) {
- return iteratorDone();
- }
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- var k = entry[0];
- var v = entry[1];
- if (!predicate.call(context, v, k, this$1$1)) {
- iterating = false;
- return iteratorDone();
- }
- return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);
- });
- };
- return takeSequence;
- }
- function skipWhileFactory(collection, predicate, context, useKeys) {
- var skipSequence = makeSequence(collection);
- skipSequence.__iterateUncached = function (fn, reverse) {
- var this$1$1 = this;
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var isSkipping = true;
- var iterations = 0;
- collection.__iterate(function (v, k, c) {
- if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {
- iterations++;
- return fn(v, useKeys ? k : iterations - 1, this$1$1);
- }
- });
- return iterations;
- };
- skipSequence.__iteratorUncached = function (type, reverse) {
- var this$1$1 = this;
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterator = collection.__iterator(ITERATE_ENTRIES, reverse);
- var skipping = true;
- var iterations = 0;
- return new Iterator(function () {
- var step;
- var k;
- var v;
- do {
- step = iterator.next();
- if (step.done) {
- if (useKeys || type === ITERATE_VALUES) {
- return step;
- }
- if (type === ITERATE_KEYS) {
- return iteratorValue(type, iterations++, undefined, step);
- }
- return iteratorValue(type, iterations++, step.value[1], step);
- }
- var entry = step.value;
- k = entry[0];
- v = entry[1];
- skipping && (skipping = predicate.call(context, v, k, this$1$1));
- } while (skipping);
- return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);
- });
- };
- return skipSequence;
- }
- function concatFactory(collection, values) {
- var isKeyedCollection = isKeyed(collection);
- var iters = [collection]
- .concat(values)
- .map(function (v) {
- if (!isCollection(v)) {
- v = isKeyedCollection
- ? keyedSeqFromValue(v)
- : indexedSeqFromValue(Array.isArray(v) ? v : [v]);
- } else if (isKeyedCollection) {
- v = KeyedCollection(v);
- }
- return v;
- })
- .filter(function (v) { return v.size !== 0; });
- if (iters.length === 0) {
- return collection;
- }
- if (iters.length === 1) {
- var singleton = iters[0];
- if (
- singleton === collection ||
- (isKeyedCollection && isKeyed(singleton)) ||
- (isIndexed(collection) && isIndexed(singleton))
- ) {
- return singleton;
- }
- }
- var concatSeq = new ArraySeq(iters);
- if (isKeyedCollection) {
- concatSeq = concatSeq.toKeyedSeq();
- } else if (!isIndexed(collection)) {
- concatSeq = concatSeq.toSetSeq();
- }
- concatSeq = concatSeq.flatten(true);
- concatSeq.size = iters.reduce(function (sum, seq) {
- if (sum !== undefined) {
- var size = seq.size;
- if (size !== undefined) {
- return sum + size;
- }
- }
- }, 0);
- return concatSeq;
- }
- function flattenFactory(collection, depth, useKeys) {
- var flatSequence = makeSequence(collection);
- flatSequence.__iterateUncached = function (fn, reverse) {
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var iterations = 0;
- var stopped = false;
- function flatDeep(iter, currentDepth) {
- iter.__iterate(function (v, k) {
- if ((!depth || currentDepth < depth) && isCollection(v)) {
- flatDeep(v, currentDepth + 1);
- } else {
- iterations++;
- if (fn(v, useKeys ? k : iterations - 1, flatSequence) === false) {
- stopped = true;
- }
- }
- return !stopped;
- }, reverse);
- }
- flatDeep(collection, 0);
- return iterations;
- };
- flatSequence.__iteratorUncached = function (type, reverse) {
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterator = collection.__iterator(type, reverse);
- var stack = [];
- var iterations = 0;
- return new Iterator(function () {
- while (iterator) {
- var step = iterator.next();
- if (step.done !== false) {
- iterator = stack.pop();
- continue;
- }
- var v = step.value;
- if (type === ITERATE_ENTRIES) {
- v = v[1];
- }
- if ((!depth || stack.length < depth) && isCollection(v)) {
- stack.push(iterator);
- iterator = v.__iterator(type, reverse);
- } else {
- return useKeys ? step : iteratorValue(type, iterations++, v, step);
- }
- }
- return iteratorDone();
- });
- };
- return flatSequence;
- }
- function flatMapFactory(collection, mapper, context) {
- var coerce = collectionClass(collection);
- return collection
- .toSeq()
- .map(function (v, k) { return coerce(mapper.call(context, v, k, collection)); })
- .flatten(true);
- }
- function interposeFactory(collection, separator) {
- var interposedSequence = makeSequence(collection);
- interposedSequence.size = collection.size && collection.size * 2 - 1;
- interposedSequence.__iterateUncached = function (fn, reverse) {
- var this$1$1 = this;
- var iterations = 0;
- collection.__iterate(
- function (v) { return (!iterations || fn(separator, iterations++, this$1$1) !== false) &&
- fn(v, iterations++, this$1$1) !== false; },
- reverse
- );
- return iterations;
- };
- interposedSequence.__iteratorUncached = function (type, reverse) {
- var iterator = collection.__iterator(ITERATE_VALUES, reverse);
- var iterations = 0;
- var step;
- return new Iterator(function () {
- if (!step || iterations % 2) {
- step = iterator.next();
- if (step.done) {
- return step;
- }
- }
- return iterations % 2
- ? iteratorValue(type, iterations++, separator)
- : iteratorValue(type, iterations++, step.value, step);
- });
- };
- return interposedSequence;
- }
- function sortFactory(collection, comparator, mapper) {
- if (!comparator) {
- comparator = defaultComparator;
- }
- var isKeyedCollection = isKeyed(collection);
- var index = 0;
- var entries = collection
- .toSeq()
- .map(function (v, k) { return [k, v, index++, mapper ? mapper(v, k, collection) : v]; })
- .valueSeq()
- .toArray();
- entries
- .sort(function (a, b) { return comparator(a[3], b[3]) || a[2] - b[2]; })
- .forEach(
- isKeyedCollection
- ? function (v, i) {
- entries[i].length = 2;
- }
- : function (v, i) {
- entries[i] = v[1];
- }
- );
- return isKeyedCollection
- ? KeyedSeq(entries)
- : isIndexed(collection)
- ? IndexedSeq(entries)
- : SetSeq(entries);
- }
- function maxFactory(collection, comparator, mapper) {
- if (!comparator) {
- comparator = defaultComparator;
- }
- if (mapper) {
- var entry = collection
- .toSeq()
- .map(function (v, k) { return [v, mapper(v, k, collection)]; })
- .reduce(function (a, b) { return (maxCompare(comparator, a[1], b[1]) ? b : a); });
- return entry && entry[0];
- }
- return collection.reduce(function (a, b) { return (maxCompare(comparator, a, b) ? b : a); });
- }
- function maxCompare(comparator, a, b) {
- var comp = comparator(b, a);
- // b is considered the new max if the comparator declares them equal, but
- // they are not equal and b is in fact a nullish value.
- return (
- (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) ||
- comp > 0
- );
- }
- function zipWithFactory(keyIter, zipper, iters, zipAll) {
- var zipSequence = makeSequence(keyIter);
- var sizes = new ArraySeq(iters).map(function (i) { return i.size; });
- zipSequence.size = zipAll ? sizes.max() : sizes.min();
- // Note: this a generic base implementation of __iterate in terms of
- // __iterator which may be more generically useful in the future.
- zipSequence.__iterate = function (fn, reverse) {
- /* generic:
- var iterator = this.__iterator(ITERATE_ENTRIES, reverse);
- var step;
- var iterations = 0;
- while (!(step = iterator.next()).done) {
- iterations++;
- if (fn(step.value[1], step.value[0], this) === false) {
- break;
- }
- }
- return iterations;
- */
- // indexed:
- var iterator = this.__iterator(ITERATE_VALUES, reverse);
- var step;
- var iterations = 0;
- while (!(step = iterator.next()).done) {
- if (fn(step.value, iterations++, this) === false) {
- break;
- }
- }
- return iterations;
- };
- zipSequence.__iteratorUncached = function (type, reverse) {
- var iterators = iters.map(
- function (i) { return ((i = Collection(i)), getIterator(reverse ? i.reverse() : i)); }
- );
- var iterations = 0;
- var isDone = false;
- return new Iterator(function () {
- var steps;
- if (!isDone) {
- steps = iterators.map(function (i) { return i.next(); });
- isDone = zipAll ? steps.every(function (s) { return s.done; }) : steps.some(function (s) { return s.done; });
- }
- if (isDone) {
- return iteratorDone();
- }
- return iteratorValue(
- type,
- iterations++,
- zipper.apply(
- null,
- steps.map(function (s) { return s.value; })
- )
- );
- });
- };
- return zipSequence;
- }
- // #pragma Helper Functions
- function reify(iter, seq) {
- return iter === seq ? iter : isSeq(iter) ? seq : iter.constructor(seq);
- }
- function validateEntry(entry) {
- if (entry !== Object(entry)) {
- throw new TypeError('Expected [K, V] tuple: ' + entry);
- }
- }
- function collectionClass(collection) {
- return isKeyed(collection)
- ? KeyedCollection
- : isIndexed(collection)
- ? IndexedCollection
- : SetCollection;
- }
- function makeSequence(collection) {
- return Object.create(
- (isKeyed(collection)
- ? KeyedSeq
- : isIndexed(collection)
- ? IndexedSeq
- : SetSeq
- ).prototype
- );
- }
- function cacheResultThrough() {
- if (this._iter.cacheResult) {
- this._iter.cacheResult();
- this.size = this._iter.size;
- return this;
- }
- return Seq.prototype.cacheResult.call(this);
- }
- function defaultComparator(a, b) {
- if (a === undefined && b === undefined) {
- return 0;
- }
- if (a === undefined) {
- return 1;
- }
- if (b === undefined) {
- return -1;
- }
- return a > b ? 1 : a < b ? -1 : 0;
- }
- function arrCopy(arr, offset) {
- offset = offset || 0;
- var len = Math.max(0, arr.length - offset);
- var newArr = new Array(len);
- for (var ii = 0; ii < len; ii++) {
- newArr[ii] = arr[ii + offset];
- }
- return newArr;
- }
- function invariant(condition, error) {
- if (!condition) { throw new Error(error); }
- }
- function assertNotInfinite(size) {
- invariant(
- size !== Infinity,
- 'Cannot perform this action with an infinite size.'
- );
- }
- function coerceKeyPath(keyPath) {
- if (isArrayLike(keyPath) && typeof keyPath !== 'string') {
- return keyPath;
- }
- if (isOrdered(keyPath)) {
- return keyPath.toArray();
- }
- throw new TypeError(
- 'Invalid keyPath: expected Ordered Collection or Array: ' + keyPath
- );
- }
- var toString = Object.prototype.toString;
- function isPlainObject(value) {
- // The base prototype's toString deals with Argument objects and native namespaces like Math
- if (
- !value ||
- typeof value !== 'object' ||
- toString.call(value) !== '[object Object]'
- ) {
- return false;
- }
- var proto = Object.getPrototypeOf(value);
- if (proto === null) {
- return true;
- }
- // Iteratively going up the prototype chain is needed for cross-realm environments (differing contexts, iframes, etc)
- var parentProto = proto;
- var nextProto = Object.getPrototypeOf(proto);
- while (nextProto !== null) {
- parentProto = nextProto;
- nextProto = Object.getPrototypeOf(parentProto);
- }
- return parentProto === proto;
- }
- /**
- * Returns true if the value is a potentially-persistent data structure, either
- * provided by Immutable.js or a plain Array or Object.
- */
- function isDataStructure(value) {
- return (
- typeof value === 'object' &&
- (isImmutable(value) || Array.isArray(value) || isPlainObject(value))
- );
- }
- function quoteString(value) {
- try {
- return typeof value === 'string' ? JSON.stringify(value) : String(value);
- } catch (_ignoreError) {
- return JSON.stringify(value);
- }
- }
- function has(collection, key) {
- return isImmutable(collection)
- ? collection.has(key)
- : isDataStructure(collection) && hasOwnProperty.call(collection, key);
- }
- function get(collection, key, notSetValue) {
- return isImmutable(collection)
- ? collection.get(key, notSetValue)
- : !has(collection, key)
- ? notSetValue
- : typeof collection.get === 'function'
- ? collection.get(key)
- : collection[key];
- }
- function shallowCopy(from) {
- if (Array.isArray(from)) {
- return arrCopy(from);
- }
- var to = {};
- for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
- to[key] = from[key];
- }
- }
- return to;
- }
- function remove(collection, key) {
- if (!isDataStructure(collection)) {
- throw new TypeError(
- 'Cannot update non-data-structure value: ' + collection
- );
- }
- if (isImmutable(collection)) {
- if (!collection.remove) {
- throw new TypeError(
- 'Cannot update immutable value without .remove() method: ' + collection
- );
- }
- return collection.remove(key);
- }
- if (!hasOwnProperty.call(collection, key)) {
- return collection;
- }
- var collectionCopy = shallowCopy(collection);
- if (Array.isArray(collectionCopy)) {
- collectionCopy.splice(key, 1);
- } else {
- delete collectionCopy[key];
- }
- return collectionCopy;
- }
- function set(collection, key, value) {
- if (!isDataStructure(collection)) {
- throw new TypeError(
- 'Cannot update non-data-structure value: ' + collection
- );
- }
- if (isImmutable(collection)) {
- if (!collection.set) {
- throw new TypeError(
- 'Cannot update immutable value without .set() method: ' + collection
- );
- }
- return collection.set(key, value);
- }
- if (hasOwnProperty.call(collection, key) && value === collection[key]) {
- return collection;
- }
- var collectionCopy = shallowCopy(collection);
- collectionCopy[key] = value;
- return collectionCopy;
- }
- function updateIn$1(collection, keyPath, notSetValue, updater) {
- if (!updater) {
- updater = notSetValue;
- notSetValue = undefined;
- }
- var updatedValue = updateInDeeply(
- isImmutable(collection),
- collection,
- coerceKeyPath(keyPath),
- 0,
- notSetValue,
- updater
- );
- return updatedValue === NOT_SET ? notSetValue : updatedValue;
- }
- function updateInDeeply(
- inImmutable,
- existing,
- keyPath,
- i,
- notSetValue,
- updater
- ) {
- var wasNotSet = existing === NOT_SET;
- if (i === keyPath.length) {
- var existingValue = wasNotSet ? notSetValue : existing;
- var newValue = updater(existingValue);
- return newValue === existingValue ? existing : newValue;
- }
- if (!wasNotSet && !isDataStructure(existing)) {
- throw new TypeError(
- 'Cannot update within non-data-structure value in path [' +
- keyPath.slice(0, i).map(quoteString) +
- ']: ' +
- existing
- );
- }
- var key = keyPath[i];
- var nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET);
- var nextUpdated = updateInDeeply(
- nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting),
- nextExisting,
- keyPath,
- i + 1,
- notSetValue,
- updater
- );
- return nextUpdated === nextExisting
- ? existing
- : nextUpdated === NOT_SET
- ? remove(existing, key)
- : set(
- wasNotSet ? (inImmutable ? emptyMap() : {}) : existing,
- key,
- nextUpdated
- );
- }
- function setIn$1(collection, keyPath, value) {
- return updateIn$1(collection, keyPath, NOT_SET, function () { return value; });
- }
- function setIn(keyPath, v) {
- return setIn$1(this, keyPath, v);
- }
- function removeIn(collection, keyPath) {
- return updateIn$1(collection, keyPath, function () { return NOT_SET; });
- }
- function deleteIn(keyPath) {
- return removeIn(this, keyPath);
- }
- function update$1(collection, key, notSetValue, updater) {
- return updateIn$1(collection, [key], notSetValue, updater);
- }
- function update(key, notSetValue, updater) {
- return arguments.length === 1
- ? key(this)
- : update$1(this, key, notSetValue, updater);
- }
- function updateIn(keyPath, notSetValue, updater) {
- return updateIn$1(this, keyPath, notSetValue, updater);
- }
- function merge$1() {
- var iters = [], len = arguments.length;
- while ( len-- ) iters[ len ] = arguments[ len ];
- return mergeIntoKeyedWith(this, iters);
- }
- function mergeWith$1(merger) {
- var iters = [], len = arguments.length - 1;
- while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ];
- if (typeof merger !== 'function') {
- throw new TypeError('Invalid merger function: ' + merger);
- }
- return mergeIntoKeyedWith(this, iters, merger);
- }
- function mergeIntoKeyedWith(collection, collections, merger) {
- var iters = [];
- for (var ii = 0; ii < collections.length; ii++) {
- var collection$1 = KeyedCollection(collections[ii]);
- if (collection$1.size !== 0) {
- iters.push(collection$1);
- }
- }
- if (iters.length === 0) {
- return collection;
- }
- if (
- collection.toSeq().size === 0 &&
- !collection.__ownerID &&
- iters.length === 1
- ) {
- return collection.constructor(iters[0]);
- }
- return collection.withMutations(function (collection) {
- var mergeIntoCollection = merger
- ? function (value, key) {
- update$1(collection, key, NOT_SET, function (oldVal) { return oldVal === NOT_SET ? value : merger(oldVal, value, key); }
- );
- }
- : function (value, key) {
- collection.set(key, value);
- };
- for (var ii = 0; ii < iters.length; ii++) {
- iters[ii].forEach(mergeIntoCollection);
- }
- });
- }
- function merge(collection) {
- var sources = [], len = arguments.length - 1;
- while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ];
- return mergeWithSources(collection, sources);
- }
- function mergeWith(merger, collection) {
- var sources = [], len = arguments.length - 2;
- while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ];
- return mergeWithSources(collection, sources, merger);
- }
- function mergeDeep$1(collection) {
- var sources = [], len = arguments.length - 1;
- while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ];
- return mergeDeepWithSources(collection, sources);
- }
- function mergeDeepWith$1(merger, collection) {
- var sources = [], len = arguments.length - 2;
- while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ];
- return mergeDeepWithSources(collection, sources, merger);
- }
- function mergeDeepWithSources(collection, sources, merger) {
- return mergeWithSources(collection, sources, deepMergerWith(merger));
- }
- function mergeWithSources(collection, sources, merger) {
- if (!isDataStructure(collection)) {
- throw new TypeError(
- 'Cannot merge into non-data-structure value: ' + collection
- );
- }
- if (isImmutable(collection)) {
- return typeof merger === 'function' && collection.mergeWith
- ? collection.mergeWith.apply(collection, [ merger ].concat( sources ))
- : collection.merge
- ? collection.merge.apply(collection, sources)
- : collection.concat.apply(collection, sources);
- }
- var isArray = Array.isArray(collection);
- var merged = collection;
- var Collection = isArray ? IndexedCollection : KeyedCollection;
- var mergeItem = isArray
- ? function (value) {
- // Copy on write
- if (merged === collection) {
- merged = shallowCopy(merged);
- }
- merged.push(value);
- }
- : function (value, key) {
- var hasVal = hasOwnProperty.call(merged, key);
- var nextVal =
- hasVal && merger ? merger(merged[key], value, key) : value;
- if (!hasVal || nextVal !== merged[key]) {
- // Copy on write
- if (merged === collection) {
- merged = shallowCopy(merged);
- }
- merged[key] = nextVal;
- }
- };
- for (var i = 0; i < sources.length; i++) {
- Collection(sources[i]).forEach(mergeItem);
- }
- return merged;
- }
- function deepMergerWith(merger) {
- function deepMerger(oldValue, newValue, key) {
- return isDataStructure(oldValue) &&
- isDataStructure(newValue) &&
- areMergeable(oldValue, newValue)
- ? mergeWithSources(oldValue, [newValue], deepMerger)
- : merger
- ? merger(oldValue, newValue, key)
- : newValue;
- }
- return deepMerger;
- }
- /**
- * It's unclear what the desired behavior is for merging two collections that
- * fall into separate categories between keyed, indexed, or set-like, so we only
- * consider them mergeable if they fall into the same category.
- */
- function areMergeable(oldDataStructure, newDataStructure) {
- var oldSeq = Seq(oldDataStructure);
- var newSeq = Seq(newDataStructure);
- // This logic assumes that a sequence can only fall into one of the three
- // categories mentioned above (since there's no `isSetLike()` method).
- return (
- isIndexed(oldSeq) === isIndexed(newSeq) &&
- isKeyed(oldSeq) === isKeyed(newSeq)
- );
- }
- function mergeDeep() {
- var iters = [], len = arguments.length;
- while ( len-- ) iters[ len ] = arguments[ len ];
- return mergeDeepWithSources(this, iters);
- }
- function mergeDeepWith(merger) {
- var iters = [], len = arguments.length - 1;
- while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ];
- return mergeDeepWithSources(this, iters, merger);
- }
- function mergeIn(keyPath) {
- var iters = [], len = arguments.length - 1;
- while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ];
- return updateIn$1(this, keyPath, emptyMap(), function (m) { return mergeWithSources(m, iters); });
- }
- function mergeDeepIn(keyPath) {
- var iters = [], len = arguments.length - 1;
- while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ];
- return updateIn$1(this, keyPath, emptyMap(), function (m) { return mergeDeepWithSources(m, iters); }
- );
- }
- function withMutations(fn) {
- var mutable = this.asMutable();
- fn(mutable);
- return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;
- }
- function asMutable() {
- return this.__ownerID ? this : this.__ensureOwner(new OwnerID());
- }
- function asImmutable() {
- return this.__ensureOwner();
- }
- function wasAltered() {
- return this.__altered;
- }
- var Map = /*@__PURE__*/(function (KeyedCollection) {
- function Map(value) {
- return value === null || value === undefined
- ? emptyMap()
- : isMap(value) && !isOrdered(value)
- ? value
- : emptyMap().withMutations(function (map) {
- var iter = KeyedCollection(value);
- assertNotInfinite(iter.size);
- iter.forEach(function (v, k) { return map.set(k, v); });
- });
- }
- if ( KeyedCollection ) Map.__proto__ = KeyedCollection;
- Map.prototype = Object.create( KeyedCollection && KeyedCollection.prototype );
- Map.prototype.constructor = Map;
- Map.of = function of () {
- var keyValues = [], len = arguments.length;
- while ( len-- ) keyValues[ len ] = arguments[ len ];
- return emptyMap().withMutations(function (map) {
- for (var i = 0; i < keyValues.length; i += 2) {
- if (i + 1 >= keyValues.length) {
- throw new Error('Missing value for key: ' + keyValues[i]);
- }
- map.set(keyValues[i], keyValues[i + 1]);
- }
- });
- };
- Map.prototype.toString = function toString () {
- return this.__toString('Map {', '}');
- };
- // @pragma Access
- Map.prototype.get = function get (k, notSetValue) {
- return this._root
- ? this._root.get(0, undefined, k, notSetValue)
- : notSetValue;
- };
- // @pragma Modification
- Map.prototype.set = function set (k, v) {
- return updateMap(this, k, v);
- };
- Map.prototype.remove = function remove (k) {
- return updateMap(this, k, NOT_SET);
- };
- Map.prototype.deleteAll = function deleteAll (keys) {
- var collection = Collection(keys);
- if (collection.size === 0) {
- return this;
- }
- return this.withMutations(function (map) {
- collection.forEach(function (key) { return map.remove(key); });
- });
- };
- Map.prototype.clear = function clear () {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = 0;
- this._root = null;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return emptyMap();
- };
- // @pragma Composition
- Map.prototype.sort = function sort (comparator) {
- // Late binding
- return OrderedMap(sortFactory(this, comparator));
- };
- Map.prototype.sortBy = function sortBy (mapper, comparator) {
- // Late binding
- return OrderedMap(sortFactory(this, comparator, mapper));
- };
- Map.prototype.map = function map (mapper, context) {
- var this$1$1 = this;
- return this.withMutations(function (map) {
- map.forEach(function (value, key) {
- map.set(key, mapper.call(context, value, key, this$1$1));
- });
- });
- };
- // @pragma Mutability
- Map.prototype.__iterator = function __iterator (type, reverse) {
- return new MapIterator(this, type, reverse);
- };
- Map.prototype.__iterate = function __iterate (fn, reverse) {
- var this$1$1 = this;
- var iterations = 0;
- this._root &&
- this._root.iterate(function (entry) {
- iterations++;
- return fn(entry[1], entry[0], this$1$1);
- }, reverse);
- return iterations;
- };
- Map.prototype.__ensureOwner = function __ensureOwner (ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- if (!ownerID) {
- if (this.size === 0) {
- return emptyMap();
- }
- this.__ownerID = ownerID;
- this.__altered = false;
- return this;
- }
- return makeMap(this.size, this._root, ownerID, this.__hash);
- };
- return Map;
- }(KeyedCollection));
- Map.isMap = isMap;
- var MapPrototype = Map.prototype;
- MapPrototype[IS_MAP_SYMBOL] = true;
- MapPrototype[DELETE] = MapPrototype.remove;
- MapPrototype.removeAll = MapPrototype.deleteAll;
- MapPrototype.setIn = setIn;
- MapPrototype.removeIn = MapPrototype.deleteIn = deleteIn;
- MapPrototype.update = update;
- MapPrototype.updateIn = updateIn;
- MapPrototype.merge = MapPrototype.concat = merge$1;
- MapPrototype.mergeWith = mergeWith$1;
- MapPrototype.mergeDeep = mergeDeep;
- MapPrototype.mergeDeepWith = mergeDeepWith;
- MapPrototype.mergeIn = mergeIn;
- MapPrototype.mergeDeepIn = mergeDeepIn;
- MapPrototype.withMutations = withMutations;
- MapPrototype.wasAltered = wasAltered;
- MapPrototype.asImmutable = asImmutable;
- MapPrototype['@@transducer/init'] = MapPrototype.asMutable = asMutable;
- MapPrototype['@@transducer/step'] = function (result, arr) {
- return result.set(arr[0], arr[1]);
- };
- MapPrototype['@@transducer/result'] = function (obj) {
- return obj.asImmutable();
- };
- // #pragma Trie Nodes
- var ArrayMapNode = function ArrayMapNode(ownerID, entries) {
- this.ownerID = ownerID;
- this.entries = entries;
- };
- ArrayMapNode.prototype.get = function get (shift, keyHash, key, notSetValue) {
- var entries = this.entries;
- for (var ii = 0, len = entries.length; ii < len; ii++) {
- if (is(key, entries[ii][0])) {
- return entries[ii][1];
- }
- }
- return notSetValue;
- };
- ArrayMapNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- var removed = value === NOT_SET;
- var entries = this.entries;
- var idx = 0;
- var len = entries.length;
- for (; idx < len; idx++) {
- if (is(key, entries[idx][0])) {
- break;
- }
- }
- var exists = idx < len;
- if (exists ? entries[idx][1] === value : removed) {
- return this;
- }
- SetRef(didAlter);
- (removed || !exists) && SetRef(didChangeSize);
- if (removed && entries.length === 1) {
- return; // undefined
- }
- if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {
- return createNodes(ownerID, entries, key, value);
- }
- var isEditable = ownerID && ownerID === this.ownerID;
- var newEntries = isEditable ? entries : arrCopy(entries);
- if (exists) {
- if (removed) {
- idx === len - 1
- ? newEntries.pop()
- : (newEntries[idx] = newEntries.pop());
- } else {
- newEntries[idx] = [key, value];
- }
- } else {
- newEntries.push([key, value]);
- }
- if (isEditable) {
- this.entries = newEntries;
- return this;
- }
- return new ArrayMapNode(ownerID, newEntries);
- };
- var BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) {
- this.ownerID = ownerID;
- this.bitmap = bitmap;
- this.nodes = nodes;
- };
- BitmapIndexedNode.prototype.get = function get (shift, keyHash, key, notSetValue) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var bit = 1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK);
- var bitmap = this.bitmap;
- return (bitmap & bit) === 0
- ? notSetValue
- : this.nodes[popCount(bitmap & (bit - 1))].get(
- shift + SHIFT,
- keyHash,
- key,
- notSetValue
- );
- };
- BitmapIndexedNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var bit = 1 << keyHashFrag;
- var bitmap = this.bitmap;
- var exists = (bitmap & bit) !== 0;
- if (!exists && value === NOT_SET) {
- return this;
- }
- var idx = popCount(bitmap & (bit - 1));
- var nodes = this.nodes;
- var node = exists ? nodes[idx] : undefined;
- var newNode = updateNode(
- node,
- ownerID,
- shift + SHIFT,
- keyHash,
- key,
- value,
- didChangeSize,
- didAlter
- );
- if (newNode === node) {
- return this;
- }
- if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {
- return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);
- }
- if (
- exists &&
- !newNode &&
- nodes.length === 2 &&
- isLeafNode(nodes[idx ^ 1])
- ) {
- return nodes[idx ^ 1];
- }
- if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {
- return newNode;
- }
- var isEditable = ownerID && ownerID === this.ownerID;
- var newBitmap = exists ? (newNode ? bitmap : bitmap ^ bit) : bitmap | bit;
- var newNodes = exists
- ? newNode
- ? setAt(nodes, idx, newNode, isEditable)
- : spliceOut(nodes, idx, isEditable)
- : spliceIn(nodes, idx, newNode, isEditable);
- if (isEditable) {
- this.bitmap = newBitmap;
- this.nodes = newNodes;
- return this;
- }
- return new BitmapIndexedNode(ownerID, newBitmap, newNodes);
- };
- var HashArrayMapNode = function HashArrayMapNode(ownerID, count, nodes) {
- this.ownerID = ownerID;
- this.count = count;
- this.nodes = nodes;
- };
- HashArrayMapNode.prototype.get = function get (shift, keyHash, key, notSetValue) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var node = this.nodes[idx];
- return node
- ? node.get(shift + SHIFT, keyHash, key, notSetValue)
- : notSetValue;
- };
- HashArrayMapNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var removed = value === NOT_SET;
- var nodes = this.nodes;
- var node = nodes[idx];
- if (removed && !node) {
- return this;
- }
- var newNode = updateNode(
- node,
- ownerID,
- shift + SHIFT,
- keyHash,
- key,
- value,
- didChangeSize,
- didAlter
- );
- if (newNode === node) {
- return this;
- }
- var newCount = this.count;
- if (!node) {
- newCount++;
- } else if (!newNode) {
- newCount--;
- if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {
- return packNodes(ownerID, nodes, newCount, idx);
- }
- }
- var isEditable = ownerID && ownerID === this.ownerID;
- var newNodes = setAt(nodes, idx, newNode, isEditable);
- if (isEditable) {
- this.count = newCount;
- this.nodes = newNodes;
- return this;
- }
- return new HashArrayMapNode(ownerID, newCount, newNodes);
- };
- var HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) {
- this.ownerID = ownerID;
- this.keyHash = keyHash;
- this.entries = entries;
- };
- HashCollisionNode.prototype.get = function get (shift, keyHash, key, notSetValue) {
- var entries = this.entries;
- for (var ii = 0, len = entries.length; ii < len; ii++) {
- if (is(key, entries[ii][0])) {
- return entries[ii][1];
- }
- }
- return notSetValue;
- };
- HashCollisionNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var removed = value === NOT_SET;
- if (keyHash !== this.keyHash) {
- if (removed) {
- return this;
- }
- SetRef(didAlter);
- SetRef(didChangeSize);
- return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);
- }
- var entries = this.entries;
- var idx = 0;
- var len = entries.length;
- for (; idx < len; idx++) {
- if (is(key, entries[idx][0])) {
- break;
- }
- }
- var exists = idx < len;
- if (exists ? entries[idx][1] === value : removed) {
- return this;
- }
- SetRef(didAlter);
- (removed || !exists) && SetRef(didChangeSize);
- if (removed && len === 2) {
- return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);
- }
- var isEditable = ownerID && ownerID === this.ownerID;
- var newEntries = isEditable ? entries : arrCopy(entries);
- if (exists) {
- if (removed) {
- idx === len - 1
- ? newEntries.pop()
- : (newEntries[idx] = newEntries.pop());
- } else {
- newEntries[idx] = [key, value];
- }
- } else {
- newEntries.push([key, value]);
- }
- if (isEditable) {
- this.entries = newEntries;
- return this;
- }
- return new HashCollisionNode(ownerID, this.keyHash, newEntries);
- };
- var ValueNode = function ValueNode(ownerID, keyHash, entry) {
- this.ownerID = ownerID;
- this.keyHash = keyHash;
- this.entry = entry;
- };
- ValueNode.prototype.get = function get (shift, keyHash, key, notSetValue) {
- return is(key, this.entry[0]) ? this.entry[1] : notSetValue;
- };
- ValueNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- var removed = value === NOT_SET;
- var keyMatch = is(key, this.entry[0]);
- if (keyMatch ? value === this.entry[1] : removed) {
- return this;
- }
- SetRef(didAlter);
- if (removed) {
- SetRef(didChangeSize);
- return; // undefined
- }
- if (keyMatch) {
- if (ownerID && ownerID === this.ownerID) {
- this.entry[1] = value;
- return this;
- }
- return new ValueNode(ownerID, this.keyHash, [key, value]);
- }
- SetRef(didChangeSize);
- return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);
- };
- // #pragma Iterators
- ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate =
- function (fn, reverse) {
- var entries = this.entries;
- for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {
- if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {
- return false;
- }
- }
- };
- BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate =
- function (fn, reverse) {
- var nodes = this.nodes;
- for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
- var node = nodes[reverse ? maxIndex - ii : ii];
- if (node && node.iterate(fn, reverse) === false) {
- return false;
- }
- }
- };
- // eslint-disable-next-line no-unused-vars
- ValueNode.prototype.iterate = function (fn, reverse) {
- return fn(this.entry);
- };
- var MapIterator = /*@__PURE__*/(function (Iterator) {
- function MapIterator(map, type, reverse) {
- this._type = type;
- this._reverse = reverse;
- this._stack = map._root && mapIteratorFrame(map._root);
- }
- if ( Iterator ) MapIterator.__proto__ = Iterator;
- MapIterator.prototype = Object.create( Iterator && Iterator.prototype );
- MapIterator.prototype.constructor = MapIterator;
- MapIterator.prototype.next = function next () {
- var type = this._type;
- var stack = this._stack;
- while (stack) {
- var node = stack.node;
- var index = stack.index++;
- var maxIndex = (void 0);
- if (node.entry) {
- if (index === 0) {
- return mapIteratorValue(type, node.entry);
- }
- } else if (node.entries) {
- maxIndex = node.entries.length - 1;
- if (index <= maxIndex) {
- return mapIteratorValue(
- type,
- node.entries[this._reverse ? maxIndex - index : index]
- );
- }
- } else {
- maxIndex = node.nodes.length - 1;
- if (index <= maxIndex) {
- var subNode = node.nodes[this._reverse ? maxIndex - index : index];
- if (subNode) {
- if (subNode.entry) {
- return mapIteratorValue(type, subNode.entry);
- }
- stack = this._stack = mapIteratorFrame(subNode, stack);
- }
- continue;
- }
- }
- stack = this._stack = this._stack.__prev;
- }
- return iteratorDone();
- };
- return MapIterator;
- }(Iterator));
- function mapIteratorValue(type, entry) {
- return iteratorValue(type, entry[0], entry[1]);
- }
- function mapIteratorFrame(node, prev) {
- return {
- node: node,
- index: 0,
- __prev: prev,
- };
- }
- function makeMap(size, root, ownerID, hash) {
- var map = Object.create(MapPrototype);
- map.size = size;
- map._root = root;
- map.__ownerID = ownerID;
- map.__hash = hash;
- map.__altered = false;
- return map;
- }
- var EMPTY_MAP;
- function emptyMap() {
- return EMPTY_MAP || (EMPTY_MAP = makeMap(0));
- }
- function updateMap(map, k, v) {
- var newRoot;
- var newSize;
- if (!map._root) {
- if (v === NOT_SET) {
- return map;
- }
- newSize = 1;
- newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);
- } else {
- var didChangeSize = MakeRef();
- var didAlter = MakeRef();
- newRoot = updateNode(
- map._root,
- map.__ownerID,
- 0,
- undefined,
- k,
- v,
- didChangeSize,
- didAlter
- );
- if (!didAlter.value) {
- return map;
- }
- newSize = map.size + (didChangeSize.value ? (v === NOT_SET ? -1 : 1) : 0);
- }
- if (map.__ownerID) {
- map.size = newSize;
- map._root = newRoot;
- map.__hash = undefined;
- map.__altered = true;
- return map;
- }
- return newRoot ? makeMap(newSize, newRoot) : emptyMap();
- }
- function updateNode(
- node,
- ownerID,
- shift,
- keyHash,
- key,
- value,
- didChangeSize,
- didAlter
- ) {
- if (!node) {
- if (value === NOT_SET) {
- return node;
- }
- SetRef(didAlter);
- SetRef(didChangeSize);
- return new ValueNode(ownerID, keyHash, [key, value]);
- }
- return node.update(
- ownerID,
- shift,
- keyHash,
- key,
- value,
- didChangeSize,
- didAlter
- );
- }
- function isLeafNode(node) {
- return (
- node.constructor === ValueNode || node.constructor === HashCollisionNode
- );
- }
- function mergeIntoNode(node, ownerID, shift, keyHash, entry) {
- if (node.keyHash === keyHash) {
- return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);
- }
- var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;
- var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var newNode;
- var nodes =
- idx1 === idx2
- ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)]
- : ((newNode = new ValueNode(ownerID, keyHash, entry)),
- idx1 < idx2 ? [node, newNode] : [newNode, node]);
- return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);
- }
- function createNodes(ownerID, entries, key, value) {
- if (!ownerID) {
- ownerID = new OwnerID();
- }
- var node = new ValueNode(ownerID, hash(key), [key, value]);
- for (var ii = 0; ii < entries.length; ii++) {
- var entry = entries[ii];
- node = node.update(ownerID, 0, undefined, entry[0], entry[1]);
- }
- return node;
- }
- function packNodes(ownerID, nodes, count, excluding) {
- var bitmap = 0;
- var packedII = 0;
- var packedNodes = new Array(count);
- for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {
- var node = nodes[ii];
- if (node !== undefined && ii !== excluding) {
- bitmap |= bit;
- packedNodes[packedII++] = node;
- }
- }
- return new BitmapIndexedNode(ownerID, bitmap, packedNodes);
- }
- function expandNodes(ownerID, nodes, bitmap, including, node) {
- var count = 0;
- var expandedNodes = new Array(SIZE);
- for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {
- expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;
- }
- expandedNodes[including] = node;
- return new HashArrayMapNode(ownerID, count + 1, expandedNodes);
- }
- function popCount(x) {
- x -= (x >> 1) & 0x55555555;
- x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
- x = (x + (x >> 4)) & 0x0f0f0f0f;
- x += x >> 8;
- x += x >> 16;
- return x & 0x7f;
- }
- function setAt(array, idx, val, canEdit) {
- var newArray = canEdit ? array : arrCopy(array);
- newArray[idx] = val;
- return newArray;
- }
- function spliceIn(array, idx, val, canEdit) {
- var newLen = array.length + 1;
- if (canEdit && idx + 1 === newLen) {
- array[idx] = val;
- return array;
- }
- var newArray = new Array(newLen);
- var after = 0;
- for (var ii = 0; ii < newLen; ii++) {
- if (ii === idx) {
- newArray[ii] = val;
- after = -1;
- } else {
- newArray[ii] = array[ii + after];
- }
- }
- return newArray;
- }
- function spliceOut(array, idx, canEdit) {
- var newLen = array.length - 1;
- if (canEdit && idx === newLen) {
- array.pop();
- return array;
- }
- var newArray = new Array(newLen);
- var after = 0;
- for (var ii = 0; ii < newLen; ii++) {
- if (ii === idx) {
- after = 1;
- }
- newArray[ii] = array[ii + after];
- }
- return newArray;
- }
- var MAX_ARRAY_MAP_SIZE = SIZE / 4;
- var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;
- var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;
- var IS_LIST_SYMBOL = '@@__IMMUTABLE_LIST__@@';
- function isList(maybeList) {
- return Boolean(maybeList && maybeList[IS_LIST_SYMBOL]);
- }
- var List = /*@__PURE__*/(function (IndexedCollection) {
- function List(value) {
- var empty = emptyList();
- if (value === null || value === undefined) {
- return empty;
- }
- if (isList(value)) {
- return value;
- }
- var iter = IndexedCollection(value);
- var size = iter.size;
- if (size === 0) {
- return empty;
- }
- assertNotInfinite(size);
- if (size > 0 && size < SIZE) {
- return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
- }
- return empty.withMutations(function (list) {
- list.setSize(size);
- iter.forEach(function (v, i) { return list.set(i, v); });
- });
- }
- if ( IndexedCollection ) List.__proto__ = IndexedCollection;
- List.prototype = Object.create( IndexedCollection && IndexedCollection.prototype );
- List.prototype.constructor = List;
- List.of = function of (/*...values*/) {
- return this(arguments);
- };
- List.prototype.toString = function toString () {
- return this.__toString('List [', ']');
- };
- // @pragma Access
- List.prototype.get = function get (index, notSetValue) {
- index = wrapIndex(this, index);
- if (index >= 0 && index < this.size) {
- index += this._origin;
- var node = listNodeFor(this, index);
- return node && node.array[index & MASK];
- }
- return notSetValue;
- };
- // @pragma Modification
- List.prototype.set = function set (index, value) {
- return updateList(this, index, value);
- };
- List.prototype.remove = function remove (index) {
- return !this.has(index)
- ? this
- : index === 0
- ? this.shift()
- : index === this.size - 1
- ? this.pop()
- : this.splice(index, 1);
- };
- List.prototype.insert = function insert (index, value) {
- return this.splice(index, 0, value);
- };
- List.prototype.clear = function clear () {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = this._origin = this._capacity = 0;
- this._level = SHIFT;
- this._root = this._tail = this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return emptyList();
- };
- List.prototype.push = function push (/*...values*/) {
- var values = arguments;
- var oldSize = this.size;
- return this.withMutations(function (list) {
- setListBounds(list, 0, oldSize + values.length);
- for (var ii = 0; ii < values.length; ii++) {
- list.set(oldSize + ii, values[ii]);
- }
- });
- };
- List.prototype.pop = function pop () {
- return setListBounds(this, 0, -1);
- };
- List.prototype.unshift = function unshift (/*...values*/) {
- var values = arguments;
- return this.withMutations(function (list) {
- setListBounds(list, -values.length);
- for (var ii = 0; ii < values.length; ii++) {
- list.set(ii, values[ii]);
- }
- });
- };
- List.prototype.shift = function shift () {
- return setListBounds(this, 1);
- };
- // @pragma Composition
- List.prototype.concat = function concat (/*...collections*/) {
- var arguments$1 = arguments;
- var seqs = [];
- for (var i = 0; i < arguments.length; i++) {
- var argument = arguments$1[i];
- var seq = IndexedCollection(
- typeof argument !== 'string' && hasIterator(argument)
- ? argument
- : [argument]
- );
- if (seq.size !== 0) {
- seqs.push(seq);
- }
- }
- if (seqs.length === 0) {
- return this;
- }
- if (this.size === 0 && !this.__ownerID && seqs.length === 1) {
- return this.constructor(seqs[0]);
- }
- return this.withMutations(function (list) {
- seqs.forEach(function (seq) { return seq.forEach(function (value) { return list.push(value); }); });
- });
- };
- List.prototype.setSize = function setSize (size) {
- return setListBounds(this, 0, size);
- };
- List.prototype.map = function map (mapper, context) {
- var this$1$1 = this;
- return this.withMutations(function (list) {
- for (var i = 0; i < this$1$1.size; i++) {
- list.set(i, mapper.call(context, list.get(i), i, this$1$1));
- }
- });
- };
- // @pragma Iteration
- List.prototype.slice = function slice (begin, end) {
- var size = this.size;
- if (wholeSlice(begin, end, size)) {
- return this;
- }
- return setListBounds(
- this,
- resolveBegin(begin, size),
- resolveEnd(end, size)
- );
- };
- List.prototype.__iterator = function __iterator (type, reverse) {
- var index = reverse ? this.size : 0;
- var values = iterateList(this, reverse);
- return new Iterator(function () {
- var value = values();
- return value === DONE
- ? iteratorDone()
- : iteratorValue(type, reverse ? --index : index++, value);
- });
- };
- List.prototype.__iterate = function __iterate (fn, reverse) {
- var index = reverse ? this.size : 0;
- var values = iterateList(this, reverse);
- var value;
- while ((value = values()) !== DONE) {
- if (fn(value, reverse ? --index : index++, this) === false) {
- break;
- }
- }
- return index;
- };
- List.prototype.__ensureOwner = function __ensureOwner (ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- if (!ownerID) {
- if (this.size === 0) {
- return emptyList();
- }
- this.__ownerID = ownerID;
- this.__altered = false;
- return this;
- }
- return makeList(
- this._origin,
- this._capacity,
- this._level,
- this._root,
- this._tail,
- ownerID,
- this.__hash
- );
- };
- return List;
- }(IndexedCollection));
- List.isList = isList;
- var ListPrototype = List.prototype;
- ListPrototype[IS_LIST_SYMBOL] = true;
- ListPrototype[DELETE] = ListPrototype.remove;
- ListPrototype.merge = ListPrototype.concat;
- ListPrototype.setIn = setIn;
- ListPrototype.deleteIn = ListPrototype.removeIn = deleteIn;
- ListPrototype.update = update;
- ListPrototype.updateIn = updateIn;
- ListPrototype.mergeIn = mergeIn;
- ListPrototype.mergeDeepIn = mergeDeepIn;
- ListPrototype.withMutations = withMutations;
- ListPrototype.wasAltered = wasAltered;
- ListPrototype.asImmutable = asImmutable;
- ListPrototype['@@transducer/init'] = ListPrototype.asMutable = asMutable;
- ListPrototype['@@transducer/step'] = function (result, arr) {
- return result.push(arr);
- };
- ListPrototype['@@transducer/result'] = function (obj) {
- return obj.asImmutable();
- };
- var VNode = function VNode(array, ownerID) {
- this.array = array;
- this.ownerID = ownerID;
- };
- // TODO: seems like these methods are very similar
- VNode.prototype.removeBefore = function removeBefore (ownerID, level, index) {
- if (index === level ? 1 << level : this.array.length === 0) {
- return this;
- }
- var originIndex = (index >>> level) & MASK;
- if (originIndex >= this.array.length) {
- return new VNode([], ownerID);
- }
- var removingFirst = originIndex === 0;
- var newChild;
- if (level > 0) {
- var oldChild = this.array[originIndex];
- newChild =
- oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);
- if (newChild === oldChild && removingFirst) {
- return this;
- }
- }
- if (removingFirst && !newChild) {
- return this;
- }
- var editable = editableVNode(this, ownerID);
- if (!removingFirst) {
- for (var ii = 0; ii < originIndex; ii++) {
- editable.array[ii] = undefined;
- }
- }
- if (newChild) {
- editable.array[originIndex] = newChild;
- }
- return editable;
- };
- VNode.prototype.removeAfter = function removeAfter (ownerID, level, index) {
- if (index === (level ? 1 << level : 0) || this.array.length === 0) {
- return this;
- }
- var sizeIndex = ((index - 1) >>> level) & MASK;
- if (sizeIndex >= this.array.length) {
- return this;
- }
- var newChild;
- if (level > 0) {
- var oldChild = this.array[sizeIndex];
- newChild =
- oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);
- if (newChild === oldChild && sizeIndex === this.array.length - 1) {
- return this;
- }
- }
- var editable = editableVNode(this, ownerID);
- editable.array.splice(sizeIndex + 1);
- if (newChild) {
- editable.array[sizeIndex] = newChild;
- }
- return editable;
- };
- var DONE = {};
- function iterateList(list, reverse) {
- var left = list._origin;
- var right = list._capacity;
- var tailPos = getTailOffset(right);
- var tail = list._tail;
- return iterateNodeOrLeaf(list._root, list._level, 0);
- function iterateNodeOrLeaf(node, level, offset) {
- return level === 0
- ? iterateLeaf(node, offset)
- : iterateNode(node, level, offset);
- }
- function iterateLeaf(node, offset) {
- var array = offset === tailPos ? tail && tail.array : node && node.array;
- var from = offset > left ? 0 : left - offset;
- var to = right - offset;
- if (to > SIZE) {
- to = SIZE;
- }
- return function () {
- if (from === to) {
- return DONE;
- }
- var idx = reverse ? --to : from++;
- return array && array[idx];
- };
- }
- function iterateNode(node, level, offset) {
- var values;
- var array = node && node.array;
- var from = offset > left ? 0 : (left - offset) >> level;
- var to = ((right - offset) >> level) + 1;
- if (to > SIZE) {
- to = SIZE;
- }
- return function () {
- while (true) {
- if (values) {
- var value = values();
- if (value !== DONE) {
- return value;
- }
- values = null;
- }
- if (from === to) {
- return DONE;
- }
- var idx = reverse ? --to : from++;
- values = iterateNodeOrLeaf(
- array && array[idx],
- level - SHIFT,
- offset + (idx << level)
- );
- }
- };
- }
- }
- function makeList(origin, capacity, level, root, tail, ownerID, hash) {
- var list = Object.create(ListPrototype);
- list.size = capacity - origin;
- list._origin = origin;
- list._capacity = capacity;
- list._level = level;
- list._root = root;
- list._tail = tail;
- list.__ownerID = ownerID;
- list.__hash = hash;
- list.__altered = false;
- return list;
- }
- var EMPTY_LIST;
- function emptyList() {
- return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
- }
- function updateList(list, index, value) {
- index = wrapIndex(list, index);
- if (index !== index) {
- return list;
- }
- if (index >= list.size || index < 0) {
- return list.withMutations(function (list) {
- index < 0
- ? setListBounds(list, index).set(0, value)
- : setListBounds(list, 0, index + 1).set(index, value);
- });
- }
- index += list._origin;
- var newTail = list._tail;
- var newRoot = list._root;
- var didAlter = MakeRef();
- if (index >= getTailOffset(list._capacity)) {
- newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);
- } else {
- newRoot = updateVNode(
- newRoot,
- list.__ownerID,
- list._level,
- index,
- value,
- didAlter
- );
- }
- if (!didAlter.value) {
- return list;
- }
- if (list.__ownerID) {
- list._root = newRoot;
- list._tail = newTail;
- list.__hash = undefined;
- list.__altered = true;
- return list;
- }
- return makeList(list._origin, list._capacity, list._level, newRoot, newTail);
- }
- function updateVNode(node, ownerID, level, index, value, didAlter) {
- var idx = (index >>> level) & MASK;
- var nodeHas = node && idx < node.array.length;
- if (!nodeHas && value === undefined) {
- return node;
- }
- var newNode;
- if (level > 0) {
- var lowerNode = node && node.array[idx];
- var newLowerNode = updateVNode(
- lowerNode,
- ownerID,
- level - SHIFT,
- index,
- value,
- didAlter
- );
- if (newLowerNode === lowerNode) {
- return node;
- }
- newNode = editableVNode(node, ownerID);
- newNode.array[idx] = newLowerNode;
- return newNode;
- }
- if (nodeHas && node.array[idx] === value) {
- return node;
- }
- if (didAlter) {
- SetRef(didAlter);
- }
- newNode = editableVNode(node, ownerID);
- if (value === undefined && idx === newNode.array.length - 1) {
- newNode.array.pop();
- } else {
- newNode.array[idx] = value;
- }
- return newNode;
- }
- function editableVNode(node, ownerID) {
- if (ownerID && node && ownerID === node.ownerID) {
- return node;
- }
- return new VNode(node ? node.array.slice() : [], ownerID);
- }
- function listNodeFor(list, rawIndex) {
- if (rawIndex >= getTailOffset(list._capacity)) {
- return list._tail;
- }
- if (rawIndex < 1 << (list._level + SHIFT)) {
- var node = list._root;
- var level = list._level;
- while (node && level > 0) {
- node = node.array[(rawIndex >>> level) & MASK];
- level -= SHIFT;
- }
- return node;
- }
- }
- function setListBounds(list, begin, end) {
- // Sanitize begin & end using this shorthand for ToInt32(argument)
- // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
- if (begin !== undefined) {
- begin |= 0;
- }
- if (end !== undefined) {
- end |= 0;
- }
- var owner = list.__ownerID || new OwnerID();
- var oldOrigin = list._origin;
- var oldCapacity = list._capacity;
- var newOrigin = oldOrigin + begin;
- var newCapacity =
- end === undefined
- ? oldCapacity
- : end < 0
- ? oldCapacity + end
- : oldOrigin + end;
- if (newOrigin === oldOrigin && newCapacity === oldCapacity) {
- return list;
- }
- // If it's going to end after it starts, it's empty.
- if (newOrigin >= newCapacity) {
- return list.clear();
- }
- var newLevel = list._level;
- var newRoot = list._root;
- // New origin might need creating a higher root.
- var offsetShift = 0;
- while (newOrigin + offsetShift < 0) {
- newRoot = new VNode(
- newRoot && newRoot.array.length ? [undefined, newRoot] : [],
- owner
- );
- newLevel += SHIFT;
- offsetShift += 1 << newLevel;
- }
- if (offsetShift) {
- newOrigin += offsetShift;
- oldOrigin += offsetShift;
- newCapacity += offsetShift;
- oldCapacity += offsetShift;
- }
- var oldTailOffset = getTailOffset(oldCapacity);
- var newTailOffset = getTailOffset(newCapacity);
- // New size might need creating a higher root.
- while (newTailOffset >= 1 << (newLevel + SHIFT)) {
- newRoot = new VNode(
- newRoot && newRoot.array.length ? [newRoot] : [],
- owner
- );
- newLevel += SHIFT;
- }
- // Locate or create the new tail.
- var oldTail = list._tail;
- var newTail =
- newTailOffset < oldTailOffset
- ? listNodeFor(list, newCapacity - 1)
- : newTailOffset > oldTailOffset
- ? new VNode([], owner)
- : oldTail;
- // Merge Tail into tree.
- if (
- oldTail &&
- newTailOffset > oldTailOffset &&
- newOrigin < oldCapacity &&
- oldTail.array.length
- ) {
- newRoot = editableVNode(newRoot, owner);
- var node = newRoot;
- for (var level = newLevel; level > SHIFT; level -= SHIFT) {
- var idx = (oldTailOffset >>> level) & MASK;
- node = node.array[idx] = editableVNode(node.array[idx], owner);
- }
- node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;
- }
- // If the size has been reduced, there's a chance the tail needs to be trimmed.
- if (newCapacity < oldCapacity) {
- newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);
- }
- // If the new origin is within the tail, then we do not need a root.
- if (newOrigin >= newTailOffset) {
- newOrigin -= newTailOffset;
- newCapacity -= newTailOffset;
- newLevel = SHIFT;
- newRoot = null;
- newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);
- // Otherwise, if the root has been trimmed, garbage collect.
- } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {
- offsetShift = 0;
- // Identify the new top root node of the subtree of the old root.
- while (newRoot) {
- var beginIndex = (newOrigin >>> newLevel) & MASK;
- if ((beginIndex !== newTailOffset >>> newLevel) & MASK) {
- break;
- }
- if (beginIndex) {
- offsetShift += (1 << newLevel) * beginIndex;
- }
- newLevel -= SHIFT;
- newRoot = newRoot.array[beginIndex];
- }
- // Trim the new sides of the new root.
- if (newRoot && newOrigin > oldOrigin) {
- newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);
- }
- if (newRoot && newTailOffset < oldTailOffset) {
- newRoot = newRoot.removeAfter(
- owner,
- newLevel,
- newTailOffset - offsetShift
- );
- }
- if (offsetShift) {
- newOrigin -= offsetShift;
- newCapacity -= offsetShift;
- }
- }
- if (list.__ownerID) {
- list.size = newCapacity - newOrigin;
- list._origin = newOrigin;
- list._capacity = newCapacity;
- list._level = newLevel;
- list._root = newRoot;
- list._tail = newTail;
- list.__hash = undefined;
- list.__altered = true;
- return list;
- }
- return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);
- }
- function getTailOffset(size) {
- return size < SIZE ? 0 : ((size - 1) >>> SHIFT) << SHIFT;
- }
- var OrderedMap = /*@__PURE__*/(function (Map) {
- function OrderedMap(value) {
- return value === null || value === undefined
- ? emptyOrderedMap()
- : isOrderedMap(value)
- ? value
- : emptyOrderedMap().withMutations(function (map) {
- var iter = KeyedCollection(value);
- assertNotInfinite(iter.size);
- iter.forEach(function (v, k) { return map.set(k, v); });
- });
- }
- if ( Map ) OrderedMap.__proto__ = Map;
- OrderedMap.prototype = Object.create( Map && Map.prototype );
- OrderedMap.prototype.constructor = OrderedMap;
- OrderedMap.of = function of (/*...values*/) {
- return this(arguments);
- };
- OrderedMap.prototype.toString = function toString () {
- return this.__toString('OrderedMap {', '}');
- };
- // @pragma Access
- OrderedMap.prototype.get = function get (k, notSetValue) {
- var index = this._map.get(k);
- return index !== undefined ? this._list.get(index)[1] : notSetValue;
- };
- // @pragma Modification
- OrderedMap.prototype.clear = function clear () {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = 0;
- this._map.clear();
- this._list.clear();
- this.__altered = true;
- return this;
- }
- return emptyOrderedMap();
- };
- OrderedMap.prototype.set = function set (k, v) {
- return updateOrderedMap(this, k, v);
- };
- OrderedMap.prototype.remove = function remove (k) {
- return updateOrderedMap(this, k, NOT_SET);
- };
- OrderedMap.prototype.__iterate = function __iterate (fn, reverse) {
- var this$1$1 = this;
- return this._list.__iterate(
- function (entry) { return entry && fn(entry[1], entry[0], this$1$1); },
- reverse
- );
- };
- OrderedMap.prototype.__iterator = function __iterator (type, reverse) {
- return this._list.fromEntrySeq().__iterator(type, reverse);
- };
- OrderedMap.prototype.__ensureOwner = function __ensureOwner (ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- var newMap = this._map.__ensureOwner(ownerID);
- var newList = this._list.__ensureOwner(ownerID);
- if (!ownerID) {
- if (this.size === 0) {
- return emptyOrderedMap();
- }
- this.__ownerID = ownerID;
- this.__altered = false;
- this._map = newMap;
- this._list = newList;
- return this;
- }
- return makeOrderedMap(newMap, newList, ownerID, this.__hash);
- };
- return OrderedMap;
- }(Map));
- OrderedMap.isOrderedMap = isOrderedMap;
- OrderedMap.prototype[IS_ORDERED_SYMBOL] = true;
- OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;
- function makeOrderedMap(map, list, ownerID, hash) {
- var omap = Object.create(OrderedMap.prototype);
- omap.size = map ? map.size : 0;
- omap._map = map;
- omap._list = list;
- omap.__ownerID = ownerID;
- omap.__hash = hash;
- omap.__altered = false;
- return omap;
- }
- var EMPTY_ORDERED_MAP;
- function emptyOrderedMap() {
- return (
- EMPTY_ORDERED_MAP ||
- (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()))
- );
- }
- function updateOrderedMap(omap, k, v) {
- var map = omap._map;
- var list = omap._list;
- var i = map.get(k);
- var has = i !== undefined;
- var newMap;
- var newList;
- if (v === NOT_SET) {
- // removed
- if (!has) {
- return omap;
- }
- if (list.size >= SIZE && list.size >= map.size * 2) {
- newList = list.filter(function (entry, idx) { return entry !== undefined && i !== idx; });
- newMap = newList
- .toKeyedSeq()
- .map(function (entry) { return entry[0]; })
- .flip()
- .toMap();
- if (omap.__ownerID) {
- newMap.__ownerID = newList.__ownerID = omap.__ownerID;
- }
- } else {
- newMap = map.remove(k);
- newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);
- }
- } else if (has) {
- if (v === list.get(i)[1]) {
- return omap;
- }
- newMap = map;
- newList = list.set(i, [k, v]);
- } else {
- newMap = map.set(k, list.size);
- newList = list.set(list.size, [k, v]);
- }
- if (omap.__ownerID) {
- omap.size = newMap.size;
- omap._map = newMap;
- omap._list = newList;
- omap.__hash = undefined;
- omap.__altered = true;
- return omap;
- }
- return makeOrderedMap(newMap, newList);
- }
- var IS_STACK_SYMBOL = '@@__IMMUTABLE_STACK__@@';
- function isStack(maybeStack) {
- return Boolean(maybeStack && maybeStack[IS_STACK_SYMBOL]);
- }
- var Stack = /*@__PURE__*/(function (IndexedCollection) {
- function Stack(value) {
- return value === null || value === undefined
- ? emptyStack()
- : isStack(value)
- ? value
- : emptyStack().pushAll(value);
- }
- if ( IndexedCollection ) Stack.__proto__ = IndexedCollection;
- Stack.prototype = Object.create( IndexedCollection && IndexedCollection.prototype );
- Stack.prototype.constructor = Stack;
- Stack.of = function of (/*...values*/) {
- return this(arguments);
- };
- Stack.prototype.toString = function toString () {
- return this.__toString('Stack [', ']');
- };
- // @pragma Access
- Stack.prototype.get = function get (index, notSetValue) {
- var head = this._head;
- index = wrapIndex(this, index);
- while (head && index--) {
- head = head.next;
- }
- return head ? head.value : notSetValue;
- };
- Stack.prototype.peek = function peek () {
- return this._head && this._head.value;
- };
- // @pragma Modification
- Stack.prototype.push = function push (/*...values*/) {
- var arguments$1 = arguments;
- if (arguments.length === 0) {
- return this;
- }
- var newSize = this.size + arguments.length;
- var head = this._head;
- for (var ii = arguments.length - 1; ii >= 0; ii--) {
- head = {
- value: arguments$1[ii],
- next: head,
- };
- }
- if (this.__ownerID) {
- this.size = newSize;
- this._head = head;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return makeStack(newSize, head);
- };
- Stack.prototype.pushAll = function pushAll (iter) {
- iter = IndexedCollection(iter);
- if (iter.size === 0) {
- return this;
- }
- if (this.size === 0 && isStack(iter)) {
- return iter;
- }
- assertNotInfinite(iter.size);
- var newSize = this.size;
- var head = this._head;
- iter.__iterate(function (value) {
- newSize++;
- head = {
- value: value,
- next: head,
- };
- }, /* reverse */ true);
- if (this.__ownerID) {
- this.size = newSize;
- this._head = head;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return makeStack(newSize, head);
- };
- Stack.prototype.pop = function pop () {
- return this.slice(1);
- };
- Stack.prototype.clear = function clear () {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = 0;
- this._head = undefined;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return emptyStack();
- };
- Stack.prototype.slice = function slice (begin, end) {
- if (wholeSlice(begin, end, this.size)) {
- return this;
- }
- var resolvedBegin = resolveBegin(begin, this.size);
- var resolvedEnd = resolveEnd(end, this.size);
- if (resolvedEnd !== this.size) {
- // super.slice(begin, end);
- return IndexedCollection.prototype.slice.call(this, begin, end);
- }
- var newSize = this.size - resolvedBegin;
- var head = this._head;
- while (resolvedBegin--) {
- head = head.next;
- }
- if (this.__ownerID) {
- this.size = newSize;
- this._head = head;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return makeStack(newSize, head);
- };
- // @pragma Mutability
- Stack.prototype.__ensureOwner = function __ensureOwner (ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- if (!ownerID) {
- if (this.size === 0) {
- return emptyStack();
- }
- this.__ownerID = ownerID;
- this.__altered = false;
- return this;
- }
- return makeStack(this.size, this._head, ownerID, this.__hash);
- };
- // @pragma Iteration
- Stack.prototype.__iterate = function __iterate (fn, reverse) {
- var this$1$1 = this;
- if (reverse) {
- return new ArraySeq(this.toArray()).__iterate(
- function (v, k) { return fn(v, k, this$1$1); },
- reverse
- );
- }
- var iterations = 0;
- var node = this._head;
- while (node) {
- if (fn(node.value, iterations++, this) === false) {
- break;
- }
- node = node.next;
- }
- return iterations;
- };
- Stack.prototype.__iterator = function __iterator (type, reverse) {
- if (reverse) {
- return new ArraySeq(this.toArray()).__iterator(type, reverse);
- }
- var iterations = 0;
- var node = this._head;
- return new Iterator(function () {
- if (node) {
- var value = node.value;
- node = node.next;
- return iteratorValue(type, iterations++, value);
- }
- return iteratorDone();
- });
- };
- return Stack;
- }(IndexedCollection));
- Stack.isStack = isStack;
- var StackPrototype = Stack.prototype;
- StackPrototype[IS_STACK_SYMBOL] = true;
- StackPrototype.shift = StackPrototype.pop;
- StackPrototype.unshift = StackPrototype.push;
- StackPrototype.unshiftAll = StackPrototype.pushAll;
- StackPrototype.withMutations = withMutations;
- StackPrototype.wasAltered = wasAltered;
- StackPrototype.asImmutable = asImmutable;
- StackPrototype['@@transducer/init'] = StackPrototype.asMutable = asMutable;
- StackPrototype['@@transducer/step'] = function (result, arr) {
- return result.unshift(arr);
- };
- StackPrototype['@@transducer/result'] = function (obj) {
- return obj.asImmutable();
- };
- function makeStack(size, head, ownerID, hash) {
- var map = Object.create(StackPrototype);
- map.size = size;
- map._head = head;
- map.__ownerID = ownerID;
- map.__hash = hash;
- map.__altered = false;
- return map;
- }
- var EMPTY_STACK;
- function emptyStack() {
- return EMPTY_STACK || (EMPTY_STACK = makeStack(0));
- }
- var IS_SET_SYMBOL = '@@__IMMUTABLE_SET__@@';
- function isSet(maybeSet) {
- return Boolean(maybeSet && maybeSet[IS_SET_SYMBOL]);
- }
- function isOrderedSet(maybeOrderedSet) {
- return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);
- }
- function deepEqual(a, b) {
- if (a === b) {
- return true;
- }
- if (
- !isCollection(b) ||
- (a.size !== undefined && b.size !== undefined && a.size !== b.size) ||
- (a.__hash !== undefined &&
- b.__hash !== undefined &&
- a.__hash !== b.__hash) ||
- isKeyed(a) !== isKeyed(b) ||
- isIndexed(a) !== isIndexed(b) ||
- isOrdered(a) !== isOrdered(b)
- ) {
- return false;
- }
- if (a.size === 0 && b.size === 0) {
- return true;
- }
- var notAssociative = !isAssociative(a);
- if (isOrdered(a)) {
- var entries = a.entries();
- return (
- b.every(function (v, k) {
- var entry = entries.next().value;
- return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));
- }) && entries.next().done
- );
- }
- var flipped = false;
- if (a.size === undefined) {
- if (b.size === undefined) {
- if (typeof a.cacheResult === 'function') {
- a.cacheResult();
- }
- } else {
- flipped = true;
- var _ = a;
- a = b;
- b = _;
- }
- }
- var allEqual = true;
- var bSize = b.__iterate(function (v, k) {
- if (
- notAssociative
- ? !a.has(v)
- : flipped
- ? !is(v, a.get(k, NOT_SET))
- : !is(a.get(k, NOT_SET), v)
- ) {
- allEqual = false;
- return false;
- }
- });
- return allEqual && a.size === bSize;
- }
- function mixin(ctor, methods) {
- var keyCopier = function (key) {
- ctor.prototype[key] = methods[key];
- };
- Object.keys(methods).forEach(keyCopier);
- Object.getOwnPropertySymbols &&
- Object.getOwnPropertySymbols(methods).forEach(keyCopier);
- return ctor;
- }
- function toJS(value) {
- if (!value || typeof value !== 'object') {
- return value;
- }
- if (!isCollection(value)) {
- if (!isDataStructure(value)) {
- return value;
- }
- value = Seq(value);
- }
- if (isKeyed(value)) {
- var result$1 = {};
- value.__iterate(function (v, k) {
- result$1[k] = toJS(v);
- });
- return result$1;
- }
- var result = [];
- value.__iterate(function (v) {
- result.push(toJS(v));
- });
- return result;
- }
- var Set = /*@__PURE__*/(function (SetCollection) {
- function Set(value) {
- return value === null || value === undefined
- ? emptySet()
- : isSet(value) && !isOrdered(value)
- ? value
- : emptySet().withMutations(function (set) {
- var iter = SetCollection(value);
- assertNotInfinite(iter.size);
- iter.forEach(function (v) { return set.add(v); });
- });
- }
- if ( SetCollection ) Set.__proto__ = SetCollection;
- Set.prototype = Object.create( SetCollection && SetCollection.prototype );
- Set.prototype.constructor = Set;
- Set.of = function of (/*...values*/) {
- return this(arguments);
- };
- Set.fromKeys = function fromKeys (value) {
- return this(KeyedCollection(value).keySeq());
- };
- Set.intersect = function intersect (sets) {
- sets = Collection(sets).toArray();
- return sets.length
- ? SetPrototype.intersect.apply(Set(sets.pop()), sets)
- : emptySet();
- };
- Set.union = function union (sets) {
- sets = Collection(sets).toArray();
- return sets.length
- ? SetPrototype.union.apply(Set(sets.pop()), sets)
- : emptySet();
- };
- Set.prototype.toString = function toString () {
- return this.__toString('Set {', '}');
- };
- // @pragma Access
- Set.prototype.has = function has (value) {
- return this._map.has(value);
- };
- // @pragma Modification
- Set.prototype.add = function add (value) {
- return updateSet(this, this._map.set(value, value));
- };
- Set.prototype.remove = function remove (value) {
- return updateSet(this, this._map.remove(value));
- };
- Set.prototype.clear = function clear () {
- return updateSet(this, this._map.clear());
- };
- // @pragma Composition
- Set.prototype.map = function map (mapper, context) {
- var this$1$1 = this;
- // keep track if the set is altered by the map function
- var didChanges = false;
- var newMap = updateSet(
- this,
- this._map.mapEntries(function (ref) {
- var v = ref[1];
- var mapped = mapper.call(context, v, v, this$1$1);
- if (mapped !== v) {
- didChanges = true;
- }
- return [mapped, mapped];
- }, context)
- );
- return didChanges ? newMap : this;
- };
- Set.prototype.union = function union () {
- var iters = [], len = arguments.length;
- while ( len-- ) iters[ len ] = arguments[ len ];
- iters = iters.filter(function (x) { return x.size !== 0; });
- if (iters.length === 0) {
- return this;
- }
- if (this.size === 0 && !this.__ownerID && iters.length === 1) {
- return this.constructor(iters[0]);
- }
- return this.withMutations(function (set) {
- for (var ii = 0; ii < iters.length; ii++) {
- SetCollection(iters[ii]).forEach(function (value) { return set.add(value); });
- }
- });
- };
- Set.prototype.intersect = function intersect () {
- var iters = [], len = arguments.length;
- while ( len-- ) iters[ len ] = arguments[ len ];
- if (iters.length === 0) {
- return this;
- }
- iters = iters.map(function (iter) { return SetCollection(iter); });
- var toRemove = [];
- this.forEach(function (value) {
- if (!iters.every(function (iter) { return iter.includes(value); })) {
- toRemove.push(value);
- }
- });
- return this.withMutations(function (set) {
- toRemove.forEach(function (value) {
- set.remove(value);
- });
- });
- };
- Set.prototype.subtract = function subtract () {
- var iters = [], len = arguments.length;
- while ( len-- ) iters[ len ] = arguments[ len ];
- if (iters.length === 0) {
- return this;
- }
- iters = iters.map(function (iter) { return SetCollection(iter); });
- var toRemove = [];
- this.forEach(function (value) {
- if (iters.some(function (iter) { return iter.includes(value); })) {
- toRemove.push(value);
- }
- });
- return this.withMutations(function (set) {
- toRemove.forEach(function (value) {
- set.remove(value);
- });
- });
- };
- Set.prototype.sort = function sort (comparator) {
- // Late binding
- return OrderedSet(sortFactory(this, comparator));
- };
- Set.prototype.sortBy = function sortBy (mapper, comparator) {
- // Late binding
- return OrderedSet(sortFactory(this, comparator, mapper));
- };
- Set.prototype.wasAltered = function wasAltered () {
- return this._map.wasAltered();
- };
- Set.prototype.__iterate = function __iterate (fn, reverse) {
- var this$1$1 = this;
- return this._map.__iterate(function (k) { return fn(k, k, this$1$1); }, reverse);
- };
- Set.prototype.__iterator = function __iterator (type, reverse) {
- return this._map.__iterator(type, reverse);
- };
- Set.prototype.__ensureOwner = function __ensureOwner (ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- var newMap = this._map.__ensureOwner(ownerID);
- if (!ownerID) {
- if (this.size === 0) {
- return this.__empty();
- }
- this.__ownerID = ownerID;
- this._map = newMap;
- return this;
- }
- return this.__make(newMap, ownerID);
- };
- return Set;
- }(SetCollection));
- Set.isSet = isSet;
- var SetPrototype = Set.prototype;
- SetPrototype[IS_SET_SYMBOL] = true;
- SetPrototype[DELETE] = SetPrototype.remove;
- SetPrototype.merge = SetPrototype.concat = SetPrototype.union;
- SetPrototype.withMutations = withMutations;
- SetPrototype.asImmutable = asImmutable;
- SetPrototype['@@transducer/init'] = SetPrototype.asMutable = asMutable;
- SetPrototype['@@transducer/step'] = function (result, arr) {
- return result.add(arr);
- };
- SetPrototype['@@transducer/result'] = function (obj) {
- return obj.asImmutable();
- };
- SetPrototype.__empty = emptySet;
- SetPrototype.__make = makeSet;
- function updateSet(set, newMap) {
- if (set.__ownerID) {
- set.size = newMap.size;
- set._map = newMap;
- return set;
- }
- return newMap === set._map
- ? set
- : newMap.size === 0
- ? set.__empty()
- : set.__make(newMap);
- }
- function makeSet(map, ownerID) {
- var set = Object.create(SetPrototype);
- set.size = map ? map.size : 0;
- set._map = map;
- set.__ownerID = ownerID;
- return set;
- }
- var EMPTY_SET;
- function emptySet() {
- return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));
- }
- /**
- * Returns a lazy seq of nums from start (inclusive) to end
- * (exclusive), by step, where start defaults to 0, step to 1, and end to
- * infinity. When start is equal to end, returns empty list.
- */
- var Range = /*@__PURE__*/(function (IndexedSeq) {
- function Range(start, end, step) {
- if (!(this instanceof Range)) {
- return new Range(start, end, step);
- }
- invariant(step !== 0, 'Cannot step a Range by 0');
- start = start || 0;
- if (end === undefined) {
- end = Infinity;
- }
- step = step === undefined ? 1 : Math.abs(step);
- if (end < start) {
- step = -step;
- }
- this._start = start;
- this._end = end;
- this._step = step;
- this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);
- if (this.size === 0) {
- if (EMPTY_RANGE) {
- return EMPTY_RANGE;
- }
- EMPTY_RANGE = this;
- }
- }
- if ( IndexedSeq ) Range.__proto__ = IndexedSeq;
- Range.prototype = Object.create( IndexedSeq && IndexedSeq.prototype );
- Range.prototype.constructor = Range;
- Range.prototype.toString = function toString () {
- if (this.size === 0) {
- return 'Range []';
- }
- return (
- 'Range [ ' +
- this._start +
- '...' +
- this._end +
- (this._step !== 1 ? ' by ' + this._step : '') +
- ' ]'
- );
- };
- Range.prototype.get = function get (index, notSetValue) {
- return this.has(index)
- ? this._start + wrapIndex(this, index) * this._step
- : notSetValue;
- };
- Range.prototype.includes = function includes (searchValue) {
- var possibleIndex = (searchValue - this._start) / this._step;
- return (
- possibleIndex >= 0 &&
- possibleIndex < this.size &&
- possibleIndex === Math.floor(possibleIndex)
- );
- };
- Range.prototype.slice = function slice (begin, end) {
- if (wholeSlice(begin, end, this.size)) {
- return this;
- }
- begin = resolveBegin(begin, this.size);
- end = resolveEnd(end, this.size);
- if (end <= begin) {
- return new Range(0, 0);
- }
- return new Range(
- this.get(begin, this._end),
- this.get(end, this._end),
- this._step
- );
- };
- Range.prototype.indexOf = function indexOf (searchValue) {
- var offsetValue = searchValue - this._start;
- if (offsetValue % this._step === 0) {
- var index = offsetValue / this._step;
- if (index >= 0 && index < this.size) {
- return index;
- }
- }
- return -1;
- };
- Range.prototype.lastIndexOf = function lastIndexOf (searchValue) {
- return this.indexOf(searchValue);
- };
- Range.prototype.__iterate = function __iterate (fn, reverse) {
- var size = this.size;
- var step = this._step;
- var value = reverse ? this._start + (size - 1) * step : this._start;
- var i = 0;
- while (i !== size) {
- if (fn(value, reverse ? size - ++i : i++, this) === false) {
- break;
- }
- value += reverse ? -step : step;
- }
- return i;
- };
- Range.prototype.__iterator = function __iterator (type, reverse) {
- var size = this.size;
- var step = this._step;
- var value = reverse ? this._start + (size - 1) * step : this._start;
- var i = 0;
- return new Iterator(function () {
- if (i === size) {
- return iteratorDone();
- }
- var v = value;
- value += reverse ? -step : step;
- return iteratorValue(type, reverse ? size - ++i : i++, v);
- });
- };
- Range.prototype.equals = function equals (other) {
- return other instanceof Range
- ? this._start === other._start &&
- this._end === other._end &&
- this._step === other._step
- : deepEqual(this, other);
- };
- return Range;
- }(IndexedSeq));
- var EMPTY_RANGE;
- function getIn$1(collection, searchKeyPath, notSetValue) {
- var keyPath = coerceKeyPath(searchKeyPath);
- var i = 0;
- while (i !== keyPath.length) {
- collection = get(collection, keyPath[i++], NOT_SET);
- if (collection === NOT_SET) {
- return notSetValue;
- }
- }
- return collection;
- }
- function getIn(searchKeyPath, notSetValue) {
- return getIn$1(this, searchKeyPath, notSetValue);
- }
- function hasIn$1(collection, keyPath) {
- return getIn$1(collection, keyPath, NOT_SET) !== NOT_SET;
- }
- function hasIn(searchKeyPath) {
- return hasIn$1(this, searchKeyPath);
- }
- function toObject() {
- assertNotInfinite(this.size);
- var object = {};
- this.__iterate(function (v, k) {
- object[k] = v;
- });
- return object;
- }
- // Note: all of these methods are deprecated.
- Collection.isIterable = isCollection;
- Collection.isKeyed = isKeyed;
- Collection.isIndexed = isIndexed;
- Collection.isAssociative = isAssociative;
- Collection.isOrdered = isOrdered;
- Collection.Iterator = Iterator;
- mixin(Collection, {
- // ### Conversion to other types
- toArray: function toArray() {
- assertNotInfinite(this.size);
- var array = new Array(this.size || 0);
- var useTuples = isKeyed(this);
- var i = 0;
- this.__iterate(function (v, k) {
- // Keyed collections produce an array of tuples.
- array[i++] = useTuples ? [k, v] : v;
- });
- return array;
- },
- toIndexedSeq: function toIndexedSeq() {
- return new ToIndexedSequence(this);
- },
- toJS: function toJS$1() {
- return toJS(this);
- },
- toKeyedSeq: function toKeyedSeq() {
- return new ToKeyedSequence(this, true);
- },
- toMap: function toMap() {
- // Use Late Binding here to solve the circular dependency.
- return Map(this.toKeyedSeq());
- },
- toObject: toObject,
- toOrderedMap: function toOrderedMap() {
- // Use Late Binding here to solve the circular dependency.
- return OrderedMap(this.toKeyedSeq());
- },
- toOrderedSet: function toOrderedSet() {
- // Use Late Binding here to solve the circular dependency.
- return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
- },
- toSet: function toSet() {
- // Use Late Binding here to solve the circular dependency.
- return Set(isKeyed(this) ? this.valueSeq() : this);
- },
- toSetSeq: function toSetSeq() {
- return new ToSetSequence(this);
- },
- toSeq: function toSeq() {
- return isIndexed(this)
- ? this.toIndexedSeq()
- : isKeyed(this)
- ? this.toKeyedSeq()
- : this.toSetSeq();
- },
- toStack: function toStack() {
- // Use Late Binding here to solve the circular dependency.
- return Stack(isKeyed(this) ? this.valueSeq() : this);
- },
- toList: function toList() {
- // Use Late Binding here to solve the circular dependency.
- return List(isKeyed(this) ? this.valueSeq() : this);
- },
- // ### Common JavaScript methods and properties
- toString: function toString() {
- return '[Collection]';
- },
- __toString: function __toString(head, tail) {
- if (this.size === 0) {
- return head + tail;
- }
- return (
- head +
- ' ' +
- this.toSeq().map(this.__toStringMapper).join(', ') +
- ' ' +
- tail
- );
- },
- // ### ES6 Collection methods (ES6 Array and Map)
- concat: function concat() {
- var values = [], len = arguments.length;
- while ( len-- ) values[ len ] = arguments[ len ];
- return reify(this, concatFactory(this, values));
- },
- includes: function includes(searchValue) {
- return this.some(function (value) { return is(value, searchValue); });
- },
- entries: function entries() {
- return this.__iterator(ITERATE_ENTRIES);
- },
- every: function every(predicate, context) {
- assertNotInfinite(this.size);
- var returnValue = true;
- this.__iterate(function (v, k, c) {
- if (!predicate.call(context, v, k, c)) {
- returnValue = false;
- return false;
- }
- });
- return returnValue;
- },
- filter: function filter(predicate, context) {
- return reify(this, filterFactory(this, predicate, context, true));
- },
- find: function find(predicate, context, notSetValue) {
- var entry = this.findEntry(predicate, context);
- return entry ? entry[1] : notSetValue;
- },
- forEach: function forEach(sideEffect, context) {
- assertNotInfinite(this.size);
- return this.__iterate(context ? sideEffect.bind(context) : sideEffect);
- },
- join: function join(separator) {
- assertNotInfinite(this.size);
- separator = separator !== undefined ? '' + separator : ',';
- var joined = '';
- var isFirst = true;
- this.__iterate(function (v) {
- isFirst ? (isFirst = false) : (joined += separator);
- joined += v !== null && v !== undefined ? v.toString() : '';
- });
- return joined;
- },
- keys: function keys() {
- return this.__iterator(ITERATE_KEYS);
- },
- map: function map(mapper, context) {
- return reify(this, mapFactory(this, mapper, context));
- },
- reduce: function reduce$1(reducer, initialReduction, context) {
- return reduce(
- this,
- reducer,
- initialReduction,
- context,
- arguments.length < 2,
- false
- );
- },
- reduceRight: function reduceRight(reducer, initialReduction, context) {
- return reduce(
- this,
- reducer,
- initialReduction,
- context,
- arguments.length < 2,
- true
- );
- },
- reverse: function reverse() {
- return reify(this, reverseFactory(this, true));
- },
- slice: function slice(begin, end) {
- return reify(this, sliceFactory(this, begin, end, true));
- },
- some: function some(predicate, context) {
- return !this.every(not(predicate), context);
- },
- sort: function sort(comparator) {
- return reify(this, sortFactory(this, comparator));
- },
- values: function values() {
- return this.__iterator(ITERATE_VALUES);
- },
- // ### More sequential methods
- butLast: function butLast() {
- return this.slice(0, -1);
- },
- isEmpty: function isEmpty() {
- return this.size !== undefined ? this.size === 0 : !this.some(function () { return true; });
- },
- count: function count(predicate, context) {
- return ensureSize(
- predicate ? this.toSeq().filter(predicate, context) : this
- );
- },
- countBy: function countBy(grouper, context) {
- return countByFactory(this, grouper, context);
- },
- equals: function equals(other) {
- return deepEqual(this, other);
- },
- entrySeq: function entrySeq() {
- var collection = this;
- if (collection._cache) {
- // We cache as an entries array, so we can just return the cache!
- return new ArraySeq(collection._cache);
- }
- var entriesSequence = collection.toSeq().map(entryMapper).toIndexedSeq();
- entriesSequence.fromEntrySeq = function () { return collection.toSeq(); };
- return entriesSequence;
- },
- filterNot: function filterNot(predicate, context) {
- return this.filter(not(predicate), context);
- },
- findEntry: function findEntry(predicate, context, notSetValue) {
- var found = notSetValue;
- this.__iterate(function (v, k, c) {
- if (predicate.call(context, v, k, c)) {
- found = [k, v];
- return false;
- }
- });
- return found;
- },
- findKey: function findKey(predicate, context) {
- var entry = this.findEntry(predicate, context);
- return entry && entry[0];
- },
- findLast: function findLast(predicate, context, notSetValue) {
- return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
- },
- findLastEntry: function findLastEntry(predicate, context, notSetValue) {
- return this.toKeyedSeq()
- .reverse()
- .findEntry(predicate, context, notSetValue);
- },
- findLastKey: function findLastKey(predicate, context) {
- return this.toKeyedSeq().reverse().findKey(predicate, context);
- },
- first: function first(notSetValue) {
- return this.find(returnTrue, null, notSetValue);
- },
- flatMap: function flatMap(mapper, context) {
- return reify(this, flatMapFactory(this, mapper, context));
- },
- flatten: function flatten(depth) {
- return reify(this, flattenFactory(this, depth, true));
- },
- fromEntrySeq: function fromEntrySeq() {
- return new FromEntriesSequence(this);
- },
- get: function get(searchKey, notSetValue) {
- return this.find(function (_, key) { return is(key, searchKey); }, undefined, notSetValue);
- },
- getIn: getIn,
- groupBy: function groupBy(grouper, context) {
- return groupByFactory(this, grouper, context);
- },
- has: function has(searchKey) {
- return this.get(searchKey, NOT_SET) !== NOT_SET;
- },
- hasIn: hasIn,
- isSubset: function isSubset(iter) {
- iter = typeof iter.includes === 'function' ? iter : Collection(iter);
- return this.every(function (value) { return iter.includes(value); });
- },
- isSuperset: function isSuperset(iter) {
- iter = typeof iter.isSubset === 'function' ? iter : Collection(iter);
- return iter.isSubset(this);
- },
- keyOf: function keyOf(searchValue) {
- return this.findKey(function (value) { return is(value, searchValue); });
- },
- keySeq: function keySeq() {
- return this.toSeq().map(keyMapper).toIndexedSeq();
- },
- last: function last(notSetValue) {
- return this.toSeq().reverse().first(notSetValue);
- },
- lastKeyOf: function lastKeyOf(searchValue) {
- return this.toKeyedSeq().reverse().keyOf(searchValue);
- },
- max: function max(comparator) {
- return maxFactory(this, comparator);
- },
- maxBy: function maxBy(mapper, comparator) {
- return maxFactory(this, comparator, mapper);
- },
- min: function min(comparator) {
- return maxFactory(
- this,
- comparator ? neg(comparator) : defaultNegComparator
- );
- },
- minBy: function minBy(mapper, comparator) {
- return maxFactory(
- this,
- comparator ? neg(comparator) : defaultNegComparator,
- mapper
- );
- },
- rest: function rest() {
- return this.slice(1);
- },
- skip: function skip(amount) {
- return amount === 0 ? this : this.slice(Math.max(0, amount));
- },
- skipLast: function skipLast(amount) {
- return amount === 0 ? this : this.slice(0, -Math.max(0, amount));
- },
- skipWhile: function skipWhile(predicate, context) {
- return reify(this, skipWhileFactory(this, predicate, context, true));
- },
- skipUntil: function skipUntil(predicate, context) {
- return this.skipWhile(not(predicate), context);
- },
- sortBy: function sortBy(mapper, comparator) {
- return reify(this, sortFactory(this, comparator, mapper));
- },
- take: function take(amount) {
- return this.slice(0, Math.max(0, amount));
- },
- takeLast: function takeLast(amount) {
- return this.slice(-Math.max(0, amount));
- },
- takeWhile: function takeWhile(predicate, context) {
- return reify(this, takeWhileFactory(this, predicate, context));
- },
- takeUntil: function takeUntil(predicate, context) {
- return this.takeWhile(not(predicate), context);
- },
- update: function update(fn) {
- return fn(this);
- },
- valueSeq: function valueSeq() {
- return this.toIndexedSeq();
- },
- // ### Hashable Object
- hashCode: function hashCode() {
- return this.__hash || (this.__hash = hashCollection(this));
- },
- // ### Internal
- // abstract __iterate(fn, reverse)
- // abstract __iterator(type, reverse)
- });
- var CollectionPrototype = Collection.prototype;
- CollectionPrototype[IS_COLLECTION_SYMBOL] = true;
- CollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.values;
- CollectionPrototype.toJSON = CollectionPrototype.toArray;
- CollectionPrototype.__toStringMapper = quoteString;
- CollectionPrototype.inspect = CollectionPrototype.toSource = function () {
- return this.toString();
- };
- CollectionPrototype.chain = CollectionPrototype.flatMap;
- CollectionPrototype.contains = CollectionPrototype.includes;
- mixin(KeyedCollection, {
- // ### More sequential methods
- flip: function flip() {
- return reify(this, flipFactory(this));
- },
- mapEntries: function mapEntries(mapper, context) {
- var this$1$1 = this;
- var iterations = 0;
- return reify(
- this,
- this.toSeq()
- .map(function (v, k) { return mapper.call(context, [k, v], iterations++, this$1$1); })
- .fromEntrySeq()
- );
- },
- mapKeys: function mapKeys(mapper, context) {
- var this$1$1 = this;
- return reify(
- this,
- this.toSeq()
- .flip()
- .map(function (k, v) { return mapper.call(context, k, v, this$1$1); })
- .flip()
- );
- },
- });
- var KeyedCollectionPrototype = KeyedCollection.prototype;
- KeyedCollectionPrototype[IS_KEYED_SYMBOL] = true;
- KeyedCollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.entries;
- KeyedCollectionPrototype.toJSON = toObject;
- KeyedCollectionPrototype.__toStringMapper = function (v, k) { return quoteString(k) + ': ' + quoteString(v); };
- mixin(IndexedCollection, {
- // ### Conversion to other types
- toKeyedSeq: function toKeyedSeq() {
- return new ToKeyedSequence(this, false);
- },
- // ### ES6 Collection methods (ES6 Array and Map)
- filter: function filter(predicate, context) {
- return reify(this, filterFactory(this, predicate, context, false));
- },
- findIndex: function findIndex(predicate, context) {
- var entry = this.findEntry(predicate, context);
- return entry ? entry[0] : -1;
- },
- indexOf: function indexOf(searchValue) {
- var key = this.keyOf(searchValue);
- return key === undefined ? -1 : key;
- },
- lastIndexOf: function lastIndexOf(searchValue) {
- var key = this.lastKeyOf(searchValue);
- return key === undefined ? -1 : key;
- },
- reverse: function reverse() {
- return reify(this, reverseFactory(this, false));
- },
- slice: function slice(begin, end) {
- return reify(this, sliceFactory(this, begin, end, false));
- },
- splice: function splice(index, removeNum /*, ...values*/) {
- var numArgs = arguments.length;
- removeNum = Math.max(removeNum || 0, 0);
- if (numArgs === 0 || (numArgs === 2 && !removeNum)) {
- return this;
- }
- // If index is negative, it should resolve relative to the size of the
- // collection. However size may be expensive to compute if not cached, so
- // only call count() if the number is in fact negative.
- index = resolveBegin(index, index < 0 ? this.count() : this.size);
- var spliced = this.slice(0, index);
- return reify(
- this,
- numArgs === 1
- ? spliced
- : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))
- );
- },
- // ### More collection methods
- findLastIndex: function findLastIndex(predicate, context) {
- var entry = this.findLastEntry(predicate, context);
- return entry ? entry[0] : -1;
- },
- first: function first(notSetValue) {
- return this.get(0, notSetValue);
- },
- flatten: function flatten(depth) {
- return reify(this, flattenFactory(this, depth, false));
- },
- get: function get(index, notSetValue) {
- index = wrapIndex(this, index);
- return index < 0 ||
- this.size === Infinity ||
- (this.size !== undefined && index > this.size)
- ? notSetValue
- : this.find(function (_, key) { return key === index; }, undefined, notSetValue);
- },
- has: function has(index) {
- index = wrapIndex(this, index);
- return (
- index >= 0 &&
- (this.size !== undefined
- ? this.size === Infinity || index < this.size
- : this.indexOf(index) !== -1)
- );
- },
- interpose: function interpose(separator) {
- return reify(this, interposeFactory(this, separator));
- },
- interleave: function interleave(/*...collections*/) {
- var collections = [this].concat(arrCopy(arguments));
- var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, collections);
- var interleaved = zipped.flatten(true);
- if (zipped.size) {
- interleaved.size = zipped.size * collections.length;
- }
- return reify(this, interleaved);
- },
- keySeq: function keySeq() {
- return Range(0, this.size);
- },
- last: function last(notSetValue) {
- return this.get(-1, notSetValue);
- },
- skipWhile: function skipWhile(predicate, context) {
- return reify(this, skipWhileFactory(this, predicate, context, false));
- },
- zip: function zip(/*, ...collections */) {
- var collections = [this].concat(arrCopy(arguments));
- return reify(this, zipWithFactory(this, defaultZipper, collections));
- },
- zipAll: function zipAll(/*, ...collections */) {
- var collections = [this].concat(arrCopy(arguments));
- return reify(this, zipWithFactory(this, defaultZipper, collections, true));
- },
- zipWith: function zipWith(zipper /*, ...collections */) {
- var collections = arrCopy(arguments);
- collections[0] = this;
- return reify(this, zipWithFactory(this, zipper, collections));
- },
- });
- var IndexedCollectionPrototype = IndexedCollection.prototype;
- IndexedCollectionPrototype[IS_INDEXED_SYMBOL] = true;
- IndexedCollectionPrototype[IS_ORDERED_SYMBOL] = true;
- mixin(SetCollection, {
- // ### ES6 Collection methods (ES6 Array and Map)
- get: function get(value, notSetValue) {
- return this.has(value) ? value : notSetValue;
- },
- includes: function includes(value) {
- return this.has(value);
- },
- // ### More sequential methods
- keySeq: function keySeq() {
- return this.valueSeq();
- },
- });
- var SetCollectionPrototype = SetCollection.prototype;
- SetCollectionPrototype.has = CollectionPrototype.includes;
- SetCollectionPrototype.contains = SetCollectionPrototype.includes;
- SetCollectionPrototype.keys = SetCollectionPrototype.values;
- // Mixin subclasses
- mixin(KeyedSeq, KeyedCollectionPrototype);
- mixin(IndexedSeq, IndexedCollectionPrototype);
- mixin(SetSeq, SetCollectionPrototype);
- // #pragma Helper functions
- function reduce(collection, reducer, reduction, context, useFirst, reverse) {
- assertNotInfinite(collection.size);
- collection.__iterate(function (v, k, c) {
- if (useFirst) {
- useFirst = false;
- reduction = v;
- } else {
- reduction = reducer.call(context, reduction, v, k, c);
- }
- }, reverse);
- return reduction;
- }
- function keyMapper(v, k) {
- return k;
- }
- function entryMapper(v, k) {
- return [k, v];
- }
- function not(predicate) {
- return function () {
- return !predicate.apply(this, arguments);
- };
- }
- function neg(predicate) {
- return function () {
- return -predicate.apply(this, arguments);
- };
- }
- function defaultZipper() {
- return arrCopy(arguments);
- }
- function defaultNegComparator(a, b) {
- return a < b ? 1 : a > b ? -1 : 0;
- }
- function hashCollection(collection) {
- if (collection.size === Infinity) {
- return 0;
- }
- var ordered = isOrdered(collection);
- var keyed = isKeyed(collection);
- var h = ordered ? 1 : 0;
- var size = collection.__iterate(
- keyed
- ? ordered
- ? function (v, k) {
- h = (31 * h + hashMerge(hash(v), hash(k))) | 0;
- }
- : function (v, k) {
- h = (h + hashMerge(hash(v), hash(k))) | 0;
- }
- : ordered
- ? function (v) {
- h = (31 * h + hash(v)) | 0;
- }
- : function (v) {
- h = (h + hash(v)) | 0;
- }
- );
- return murmurHashOfSize(size, h);
- }
- function murmurHashOfSize(size, h) {
- h = imul(h, 0xcc9e2d51);
- h = imul((h << 15) | (h >>> -15), 0x1b873593);
- h = imul((h << 13) | (h >>> -13), 5);
- h = ((h + 0xe6546b64) | 0) ^ size;
- h = imul(h ^ (h >>> 16), 0x85ebca6b);
- h = imul(h ^ (h >>> 13), 0xc2b2ae35);
- h = smi(h ^ (h >>> 16));
- return h;
- }
- function hashMerge(a, b) {
- return (a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2))) | 0; // int
- }
- var OrderedSet = /*@__PURE__*/(function (Set) {
- function OrderedSet(value) {
- return value === null || value === undefined
- ? emptyOrderedSet()
- : isOrderedSet(value)
- ? value
- : emptyOrderedSet().withMutations(function (set) {
- var iter = SetCollection(value);
- assertNotInfinite(iter.size);
- iter.forEach(function (v) { return set.add(v); });
- });
- }
- if ( Set ) OrderedSet.__proto__ = Set;
- OrderedSet.prototype = Object.create( Set && Set.prototype );
- OrderedSet.prototype.constructor = OrderedSet;
- OrderedSet.of = function of (/*...values*/) {
- return this(arguments);
- };
- OrderedSet.fromKeys = function fromKeys (value) {
- return this(KeyedCollection(value).keySeq());
- };
- OrderedSet.prototype.toString = function toString () {
- return this.__toString('OrderedSet {', '}');
- };
- return OrderedSet;
- }(Set));
- OrderedSet.isOrderedSet = isOrderedSet;
- var OrderedSetPrototype = OrderedSet.prototype;
- OrderedSetPrototype[IS_ORDERED_SYMBOL] = true;
- OrderedSetPrototype.zip = IndexedCollectionPrototype.zip;
- OrderedSetPrototype.zipWith = IndexedCollectionPrototype.zipWith;
- OrderedSetPrototype.zipAll = IndexedCollectionPrototype.zipAll;
- OrderedSetPrototype.__empty = emptyOrderedSet;
- OrderedSetPrototype.__make = makeOrderedSet;
- function makeOrderedSet(map, ownerID) {
- var set = Object.create(OrderedSetPrototype);
- set.size = map ? map.size : 0;
- set._map = map;
- set.__ownerID = ownerID;
- return set;
- }
- var EMPTY_ORDERED_SET;
- function emptyOrderedSet() {
- return (
- EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()))
- );
- }
- function throwOnInvalidDefaultValues(defaultValues) {
- if (isRecord(defaultValues)) {
- throw new Error(
- 'Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.'
- );
- }
- if (isImmutable(defaultValues)) {
- throw new Error(
- 'Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.'
- );
- }
- if (defaultValues === null || typeof defaultValues !== 'object') {
- throw new Error(
- 'Can not call `Record` with a non-object as default values. Use a plain javascript object instead.'
- );
- }
- }
- var Record = function Record(defaultValues, name) {
- var hasInitialized;
- throwOnInvalidDefaultValues(defaultValues);
- var RecordType = function Record(values) {
- var this$1$1 = this;
- if (values instanceof RecordType) {
- return values;
- }
- if (!(this instanceof RecordType)) {
- return new RecordType(values);
- }
- if (!hasInitialized) {
- hasInitialized = true;
- var keys = Object.keys(defaultValues);
- var indices = (RecordTypePrototype._indices = {});
- // Deprecated: left to attempt not to break any external code which
- // relies on a ._name property existing on record instances.
- // Use Record.getDescriptiveName() instead
- RecordTypePrototype._name = name;
- RecordTypePrototype._keys = keys;
- RecordTypePrototype._defaultValues = defaultValues;
- for (var i = 0; i < keys.length; i++) {
- var propName = keys[i];
- indices[propName] = i;
- if (RecordTypePrototype[propName]) {
- /* eslint-disable no-console */
- typeof console === 'object' &&
- console.warn &&
- console.warn(
- 'Cannot define ' +
- recordName(this) +
- ' with property "' +
- propName +
- '" since that property name is part of the Record API.'
- );
- /* eslint-enable no-console */
- } else {
- setProp(RecordTypePrototype, propName);
- }
- }
- }
- this.__ownerID = undefined;
- this._values = List().withMutations(function (l) {
- l.setSize(this$1$1._keys.length);
- KeyedCollection(values).forEach(function (v, k) {
- l.set(this$1$1._indices[k], v === this$1$1._defaultValues[k] ? undefined : v);
- });
- });
- return this;
- };
- var RecordTypePrototype = (RecordType.prototype =
- Object.create(RecordPrototype));
- RecordTypePrototype.constructor = RecordType;
- if (name) {
- RecordType.displayName = name;
- }
- return RecordType;
- };
- Record.prototype.toString = function toString () {
- var str = recordName(this) + ' { ';
- var keys = this._keys;
- var k;
- for (var i = 0, l = keys.length; i !== l; i++) {
- k = keys[i];
- str += (i ? ', ' : '') + k + ': ' + quoteString(this.get(k));
- }
- return str + ' }';
- };
- Record.prototype.equals = function equals (other) {
- return (
- this === other || (other && recordSeq(this).equals(recordSeq(other)))
- );
- };
- Record.prototype.hashCode = function hashCode () {
- return recordSeq(this).hashCode();
- };
- // @pragma Access
- Record.prototype.has = function has (k) {
- return this._indices.hasOwnProperty(k);
- };
- Record.prototype.get = function get (k, notSetValue) {
- if (!this.has(k)) {
- return notSetValue;
- }
- var index = this._indices[k];
- var value = this._values.get(index);
- return value === undefined ? this._defaultValues[k] : value;
- };
- // @pragma Modification
- Record.prototype.set = function set (k, v) {
- if (this.has(k)) {
- var newValues = this._values.set(
- this._indices[k],
- v === this._defaultValues[k] ? undefined : v
- );
- if (newValues !== this._values && !this.__ownerID) {
- return makeRecord(this, newValues);
- }
- }
- return this;
- };
- Record.prototype.remove = function remove (k) {
- return this.set(k);
- };
- Record.prototype.clear = function clear () {
- var newValues = this._values.clear().setSize(this._keys.length);
- return this.__ownerID ? this : makeRecord(this, newValues);
- };
- Record.prototype.wasAltered = function wasAltered () {
- return this._values.wasAltered();
- };
- Record.prototype.toSeq = function toSeq () {
- return recordSeq(this);
- };
- Record.prototype.toJS = function toJS$1 () {
- return toJS(this);
- };
- Record.prototype.entries = function entries () {
- return this.__iterator(ITERATE_ENTRIES);
- };
- Record.prototype.__iterator = function __iterator (type, reverse) {
- return recordSeq(this).__iterator(type, reverse);
- };
- Record.prototype.__iterate = function __iterate (fn, reverse) {
- return recordSeq(this).__iterate(fn, reverse);
- };
- Record.prototype.__ensureOwner = function __ensureOwner (ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- var newValues = this._values.__ensureOwner(ownerID);
- if (!ownerID) {
- this.__ownerID = ownerID;
- this._values = newValues;
- return this;
- }
- return makeRecord(this, newValues, ownerID);
- };
- Record.isRecord = isRecord;
- Record.getDescriptiveName = recordName;
- var RecordPrototype = Record.prototype;
- RecordPrototype[IS_RECORD_SYMBOL] = true;
- RecordPrototype[DELETE] = RecordPrototype.remove;
- RecordPrototype.deleteIn = RecordPrototype.removeIn = deleteIn;
- RecordPrototype.getIn = getIn;
- RecordPrototype.hasIn = CollectionPrototype.hasIn;
- RecordPrototype.merge = merge$1;
- RecordPrototype.mergeWith = mergeWith$1;
- RecordPrototype.mergeIn = mergeIn;
- RecordPrototype.mergeDeep = mergeDeep;
- RecordPrototype.mergeDeepWith = mergeDeepWith;
- RecordPrototype.mergeDeepIn = mergeDeepIn;
- RecordPrototype.setIn = setIn;
- RecordPrototype.update = update;
- RecordPrototype.updateIn = updateIn;
- RecordPrototype.withMutations = withMutations;
- RecordPrototype.asMutable = asMutable;
- RecordPrototype.asImmutable = asImmutable;
- RecordPrototype[ITERATOR_SYMBOL] = RecordPrototype.entries;
- RecordPrototype.toJSON = RecordPrototype.toObject =
- CollectionPrototype.toObject;
- RecordPrototype.inspect = RecordPrototype.toSource = function () {
- return this.toString();
- };
- function makeRecord(likeRecord, values, ownerID) {
- var record = Object.create(Object.getPrototypeOf(likeRecord));
- record._values = values;
- record.__ownerID = ownerID;
- return record;
- }
- function recordName(record) {
- return record.constructor.displayName || record.constructor.name || 'Record';
- }
- function recordSeq(record) {
- return keyedSeqFromValue(record._keys.map(function (k) { return [k, record.get(k)]; }));
- }
- function setProp(prototype, name) {
- try {
- Object.defineProperty(prototype, name, {
- get: function () {
- return this.get(name);
- },
- set: function (value) {
- invariant(this.__ownerID, 'Cannot set on an immutable record.');
- this.set(name, value);
- },
- });
- } catch (error) {
- // Object.defineProperty failed. Probably IE8.
- }
- }
- /**
- * Returns a lazy Seq of `value` repeated `times` times. When `times` is
- * undefined, returns an infinite sequence of `value`.
- */
- var Repeat = /*@__PURE__*/(function (IndexedSeq) {
- function Repeat(value, times) {
- if (!(this instanceof Repeat)) {
- return new Repeat(value, times);
- }
- this._value = value;
- this.size = times === undefined ? Infinity : Math.max(0, times);
- if (this.size === 0) {
- if (EMPTY_REPEAT) {
- return EMPTY_REPEAT;
- }
- EMPTY_REPEAT = this;
- }
- }
- if ( IndexedSeq ) Repeat.__proto__ = IndexedSeq;
- Repeat.prototype = Object.create( IndexedSeq && IndexedSeq.prototype );
- Repeat.prototype.constructor = Repeat;
- Repeat.prototype.toString = function toString () {
- if (this.size === 0) {
- return 'Repeat []';
- }
- return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';
- };
- Repeat.prototype.get = function get (index, notSetValue) {
- return this.has(index) ? this._value : notSetValue;
- };
- Repeat.prototype.includes = function includes (searchValue) {
- return is(this._value, searchValue);
- };
- Repeat.prototype.slice = function slice (begin, end) {
- var size = this.size;
- return wholeSlice(begin, end, size)
- ? this
- : new Repeat(
- this._value,
- resolveEnd(end, size) - resolveBegin(begin, size)
- );
- };
- Repeat.prototype.reverse = function reverse () {
- return this;
- };
- Repeat.prototype.indexOf = function indexOf (searchValue) {
- if (is(this._value, searchValue)) {
- return 0;
- }
- return -1;
- };
- Repeat.prototype.lastIndexOf = function lastIndexOf (searchValue) {
- if (is(this._value, searchValue)) {
- return this.size;
- }
- return -1;
- };
- Repeat.prototype.__iterate = function __iterate (fn, reverse) {
- var size = this.size;
- var i = 0;
- while (i !== size) {
- if (fn(this._value, reverse ? size - ++i : i++, this) === false) {
- break;
- }
- }
- return i;
- };
- Repeat.prototype.__iterator = function __iterator (type, reverse) {
- var this$1$1 = this;
- var size = this.size;
- var i = 0;
- return new Iterator(function () { return i === size
- ? iteratorDone()
- : iteratorValue(type, reverse ? size - ++i : i++, this$1$1._value); }
- );
- };
- Repeat.prototype.equals = function equals (other) {
- return other instanceof Repeat
- ? is(this._value, other._value)
- : deepEqual(other);
- };
- return Repeat;
- }(IndexedSeq));
- var EMPTY_REPEAT;
- function fromJS(value, converter) {
- return fromJSWith(
- [],
- converter || defaultConverter,
- value,
- '',
- converter && converter.length > 2 ? [] : undefined,
- { '': value }
- );
- }
- function fromJSWith(stack, converter, value, key, keyPath, parentValue) {
- if (
- typeof value !== 'string' &&
- !isImmutable(value) &&
- (isArrayLike(value) || hasIterator(value) || isPlainObject(value))
- ) {
- if (~stack.indexOf(value)) {
- throw new TypeError('Cannot convert circular structure to Immutable');
- }
- stack.push(value);
- keyPath && key !== '' && keyPath.push(key);
- var converted = converter.call(
- parentValue,
- key,
- Seq(value).map(function (v, k) { return fromJSWith(stack, converter, v, k, keyPath, value); }
- ),
- keyPath && keyPath.slice()
- );
- stack.pop();
- keyPath && keyPath.pop();
- return converted;
- }
- return value;
- }
- function defaultConverter(k, v) {
- // Effectively the opposite of "Collection.toSeq()"
- return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
- }
- var version = "4.0.0";
- var Immutable = {
- version: version,
- Collection: Collection,
- // Note: Iterable is deprecated
- Iterable: Collection,
- Seq: Seq,
- Map: Map,
- OrderedMap: OrderedMap,
- List: List,
- Stack: Stack,
- Set: Set,
- OrderedSet: OrderedSet,
- Record: Record,
- Range: Range,
- Repeat: Repeat,
- is: is,
- fromJS: fromJS,
- hash: hash,
- isImmutable: isImmutable,
- isCollection: isCollection,
- isKeyed: isKeyed,
- isIndexed: isIndexed,
- isAssociative: isAssociative,
- isOrdered: isOrdered,
- isValueObject: isValueObject,
- isPlainObject: isPlainObject,
- isSeq: isSeq,
- isList: isList,
- isMap: isMap,
- isOrderedMap: isOrderedMap,
- isStack: isStack,
- isSet: isSet,
- isOrderedSet: isOrderedSet,
- isRecord: isRecord,
- get: get,
- getIn: getIn$1,
- has: has,
- hasIn: hasIn$1,
- merge: merge,
- mergeDeep: mergeDeep$1,
- mergeWith: mergeWith,
- mergeDeepWith: mergeDeepWith$1,
- remove: remove,
- removeIn: removeIn,
- set: set,
- setIn: setIn$1,
- update: update$1,
- updateIn: updateIn$1,
- };
- // Note: Iterable is deprecated
- var Iterable = (/* unused pure expression or super */ null && (Collection));
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Immutable);
- /***/ }),
- /***/ 23634:
- /***/ (function(module) {
- /**
- * Copyright (c) 2014-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
- (function (global, factory) {
- true ? module.exports = factory() :
- 0;
- }(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice;
- function createClass(ctor, superClass) {
- if (superClass) {
- ctor.prototype = Object.create(superClass.prototype);
- }
- ctor.prototype.constructor = ctor;
- }
- function Iterable(value) {
- return isIterable(value) ? value : Seq(value);
- }
- createClass(KeyedIterable, Iterable);
- function KeyedIterable(value) {
- return isKeyed(value) ? value : KeyedSeq(value);
- }
- createClass(IndexedIterable, Iterable);
- function IndexedIterable(value) {
- return isIndexed(value) ? value : IndexedSeq(value);
- }
- createClass(SetIterable, Iterable);
- function SetIterable(value) {
- return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);
- }
- function isIterable(maybeIterable) {
- return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);
- }
- function isKeyed(maybeKeyed) {
- return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);
- }
- function isIndexed(maybeIndexed) {
- return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);
- }
- function isAssociative(maybeAssociative) {
- return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);
- }
- function isOrdered(maybeOrdered) {
- return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);
- }
- Iterable.isIterable = isIterable;
- Iterable.isKeyed = isKeyed;
- Iterable.isIndexed = isIndexed;
- Iterable.isAssociative = isAssociative;
- Iterable.isOrdered = isOrdered;
- Iterable.Keyed = KeyedIterable;
- Iterable.Indexed = IndexedIterable;
- Iterable.Set = SetIterable;
- var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
- var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
- var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
- var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
- // Used for setting prototype methods that IE8 chokes on.
- var DELETE = 'delete';
- // Constants describing the size of trie nodes.
- var SHIFT = 5; // Resulted in best performance after ______?
- var SIZE = 1 << SHIFT;
- var MASK = SIZE - 1;
- // A consistent shared value representing "not set" which equals nothing other
- // than itself, and nothing that could be provided externally.
- var NOT_SET = {};
- // Boolean references, Rough equivalent of `bool &`.
- var CHANGE_LENGTH = { value: false };
- var DID_ALTER = { value: false };
- function MakeRef(ref) {
- ref.value = false;
- return ref;
- }
- function SetRef(ref) {
- ref && (ref.value = true);
- }
- // A function which returns a value representing an "owner" for transient writes
- // to tries. The return value will only ever equal itself, and will not equal
- // the return of any subsequent call of this function.
- function OwnerID() {}
- // http://jsperf.com/copy-array-inline
- function arrCopy(arr, offset) {
- offset = offset || 0;
- var len = Math.max(0, arr.length - offset);
- var newArr = new Array(len);
- for (var ii = 0; ii < len; ii++) {
- newArr[ii] = arr[ii + offset];
- }
- return newArr;
- }
- function ensureSize(iter) {
- if (iter.size === undefined) {
- iter.size = iter.__iterate(returnTrue);
- }
- return iter.size;
- }
- function wrapIndex(iter, index) {
- // This implements "is array index" which the ECMAString spec defines as:
- //
- // A String property name P is an array index if and only if
- // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal
- // to 2^32−1.
- //
- // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects
- if (typeof index !== 'number') {
- var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32
- if ('' + uint32Index !== index || uint32Index === 4294967295) {
- return NaN;
- }
- index = uint32Index;
- }
- return index < 0 ? ensureSize(iter) + index : index;
- }
- function returnTrue() {
- return true;
- }
- function wholeSlice(begin, end, size) {
- return (begin === 0 || (size !== undefined && begin <= -size)) &&
- (end === undefined || (size !== undefined && end >= size));
- }
- function resolveBegin(begin, size) {
- return resolveIndex(begin, size, 0);
- }
- function resolveEnd(end, size) {
- return resolveIndex(end, size, size);
- }
- function resolveIndex(index, size, defaultIndex) {
- return index === undefined ?
- defaultIndex :
- index < 0 ?
- Math.max(0, size + index) :
- size === undefined ?
- index :
- Math.min(size, index);
- }
- /* global Symbol */
- var ITERATE_KEYS = 0;
- var ITERATE_VALUES = 1;
- var ITERATE_ENTRIES = 2;
- var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
- var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;
- function Iterator(next) {
- this.next = next;
- }
- Iterator.prototype.toString = function() {
- return '[Iterator]';
- };
- Iterator.KEYS = ITERATE_KEYS;
- Iterator.VALUES = ITERATE_VALUES;
- Iterator.ENTRIES = ITERATE_ENTRIES;
- Iterator.prototype.inspect =
- Iterator.prototype.toSource = function () { return this.toString(); }
- Iterator.prototype[ITERATOR_SYMBOL] = function () {
- return this;
- };
- function iteratorValue(type, k, v, iteratorResult) {
- var value = type === 0 ? k : type === 1 ? v : [k, v];
- iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {
- value: value, done: false
- });
- return iteratorResult;
- }
- function iteratorDone() {
- return { value: undefined, done: true };
- }
- function hasIterator(maybeIterable) {
- return !!getIteratorFn(maybeIterable);
- }
- function isIterator(maybeIterator) {
- return maybeIterator && typeof maybeIterator.next === 'function';
- }
- function getIterator(iterable) {
- var iteratorFn = getIteratorFn(iterable);
- return iteratorFn && iteratorFn.call(iterable);
- }
- function getIteratorFn(iterable) {
- var iteratorFn = iterable && (
- (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) ||
- iterable[FAUX_ITERATOR_SYMBOL]
- );
- if (typeof iteratorFn === 'function') {
- return iteratorFn;
- }
- }
- function isArrayLike(value) {
- return value && typeof value.length === 'number';
- }
- createClass(Seq, Iterable);
- function Seq(value) {
- return value === null || value === undefined ? emptySequence() :
- isIterable(value) ? value.toSeq() : seqFromValue(value);
- }
- Seq.of = function(/*...values*/) {
- return Seq(arguments);
- };
- Seq.prototype.toSeq = function() {
- return this;
- };
- Seq.prototype.toString = function() {
- return this.__toString('Seq {', '}');
- };
- Seq.prototype.cacheResult = function() {
- if (!this._cache && this.__iterateUncached) {
- this._cache = this.entrySeq().toArray();
- this.size = this._cache.length;
- }
- return this;
- };
- // abstract __iterateUncached(fn, reverse)
- Seq.prototype.__iterate = function(fn, reverse) {
- return seqIterate(this, fn, reverse, true);
- };
- // abstract __iteratorUncached(type, reverse)
- Seq.prototype.__iterator = function(type, reverse) {
- return seqIterator(this, type, reverse, true);
- };
- createClass(KeyedSeq, Seq);
- function KeyedSeq(value) {
- return value === null || value === undefined ?
- emptySequence().toKeyedSeq() :
- isIterable(value) ?
- (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) :
- keyedSeqFromValue(value);
- }
- KeyedSeq.prototype.toKeyedSeq = function() {
- return this;
- };
- createClass(IndexedSeq, Seq);
- function IndexedSeq(value) {
- return value === null || value === undefined ? emptySequence() :
- !isIterable(value) ? indexedSeqFromValue(value) :
- isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();
- }
- IndexedSeq.of = function(/*...values*/) {
- return IndexedSeq(arguments);
- };
- IndexedSeq.prototype.toIndexedSeq = function() {
- return this;
- };
- IndexedSeq.prototype.toString = function() {
- return this.__toString('Seq [', ']');
- };
- IndexedSeq.prototype.__iterate = function(fn, reverse) {
- return seqIterate(this, fn, reverse, false);
- };
- IndexedSeq.prototype.__iterator = function(type, reverse) {
- return seqIterator(this, type, reverse, false);
- };
- createClass(SetSeq, Seq);
- function SetSeq(value) {
- return (
- value === null || value === undefined ? emptySequence() :
- !isIterable(value) ? indexedSeqFromValue(value) :
- isKeyed(value) ? value.entrySeq() : value
- ).toSetSeq();
- }
- SetSeq.of = function(/*...values*/) {
- return SetSeq(arguments);
- };
- SetSeq.prototype.toSetSeq = function() {
- return this;
- };
- Seq.isSeq = isSeq;
- Seq.Keyed = KeyedSeq;
- Seq.Set = SetSeq;
- Seq.Indexed = IndexedSeq;
- var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';
- Seq.prototype[IS_SEQ_SENTINEL] = true;
- createClass(ArraySeq, IndexedSeq);
- function ArraySeq(array) {
- this._array = array;
- this.size = array.length;
- }
- ArraySeq.prototype.get = function(index, notSetValue) {
- return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;
- };
- ArraySeq.prototype.__iterate = function(fn, reverse) {
- var array = this._array;
- var maxIndex = array.length - 1;
- for (var ii = 0; ii <= maxIndex; ii++) {
- if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {
- return ii + 1;
- }
- }
- return ii;
- };
- ArraySeq.prototype.__iterator = function(type, reverse) {
- var array = this._array;
- var maxIndex = array.length - 1;
- var ii = 0;
- return new Iterator(function()
- {return ii > maxIndex ?
- iteratorDone() :
- iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])}
- );
- };
- createClass(ObjectSeq, KeyedSeq);
- function ObjectSeq(object) {
- var keys = Object.keys(object);
- this._object = object;
- this._keys = keys;
- this.size = keys.length;
- }
- ObjectSeq.prototype.get = function(key, notSetValue) {
- if (notSetValue !== undefined && !this.has(key)) {
- return notSetValue;
- }
- return this._object[key];
- };
- ObjectSeq.prototype.has = function(key) {
- return this._object.hasOwnProperty(key);
- };
- ObjectSeq.prototype.__iterate = function(fn, reverse) {
- var object = this._object;
- var keys = this._keys;
- var maxIndex = keys.length - 1;
- for (var ii = 0; ii <= maxIndex; ii++) {
- var key = keys[reverse ? maxIndex - ii : ii];
- if (fn(object[key], key, this) === false) {
- return ii + 1;
- }
- }
- return ii;
- };
- ObjectSeq.prototype.__iterator = function(type, reverse) {
- var object = this._object;
- var keys = this._keys;
- var maxIndex = keys.length - 1;
- var ii = 0;
- return new Iterator(function() {
- var key = keys[reverse ? maxIndex - ii : ii];
- return ii++ > maxIndex ?
- iteratorDone() :
- iteratorValue(type, key, object[key]);
- });
- };
- ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;
- createClass(IterableSeq, IndexedSeq);
- function IterableSeq(iterable) {
- this._iterable = iterable;
- this.size = iterable.length || iterable.size;
- }
- IterableSeq.prototype.__iterateUncached = function(fn, reverse) {
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var iterable = this._iterable;
- var iterator = getIterator(iterable);
- var iterations = 0;
- if (isIterator(iterator)) {
- var step;
- while (!(step = iterator.next()).done) {
- if (fn(step.value, iterations++, this) === false) {
- break;
- }
- }
- }
- return iterations;
- };
- IterableSeq.prototype.__iteratorUncached = function(type, reverse) {
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterable = this._iterable;
- var iterator = getIterator(iterable);
- if (!isIterator(iterator)) {
- return new Iterator(iteratorDone);
- }
- var iterations = 0;
- return new Iterator(function() {
- var step = iterator.next();
- return step.done ? step : iteratorValue(type, iterations++, step.value);
- });
- };
- createClass(IteratorSeq, IndexedSeq);
- function IteratorSeq(iterator) {
- this._iterator = iterator;
- this._iteratorCache = [];
- }
- IteratorSeq.prototype.__iterateUncached = function(fn, reverse) {
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var iterator = this._iterator;
- var cache = this._iteratorCache;
- var iterations = 0;
- while (iterations < cache.length) {
- if (fn(cache[iterations], iterations++, this) === false) {
- return iterations;
- }
- }
- var step;
- while (!(step = iterator.next()).done) {
- var val = step.value;
- cache[iterations] = val;
- if (fn(val, iterations++, this) === false) {
- break;
- }
- }
- return iterations;
- };
- IteratorSeq.prototype.__iteratorUncached = function(type, reverse) {
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterator = this._iterator;
- var cache = this._iteratorCache;
- var iterations = 0;
- return new Iterator(function() {
- if (iterations >= cache.length) {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- cache[iterations] = step.value;
- }
- return iteratorValue(type, iterations, cache[iterations++]);
- });
- };
- // # pragma Helper functions
- function isSeq(maybeSeq) {
- return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);
- }
- var EMPTY_SEQ;
- function emptySequence() {
- return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));
- }
- function keyedSeqFromValue(value) {
- var seq =
- Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() :
- isIterator(value) ? new IteratorSeq(value).fromEntrySeq() :
- hasIterator(value) ? new IterableSeq(value).fromEntrySeq() :
- typeof value === 'object' ? new ObjectSeq(value) :
- undefined;
- if (!seq) {
- throw new TypeError(
- 'Expected Array or iterable object of [k, v] entries, '+
- 'or keyed object: ' + value
- );
- }
- return seq;
- }
- function indexedSeqFromValue(value) {
- var seq = maybeIndexedSeqFromValue(value);
- if (!seq) {
- throw new TypeError(
- 'Expected Array or iterable object of values: ' + value
- );
- }
- return seq;
- }
- function seqFromValue(value) {
- var seq = maybeIndexedSeqFromValue(value) ||
- (typeof value === 'object' && new ObjectSeq(value));
- if (!seq) {
- throw new TypeError(
- 'Expected Array or iterable object of values, or keyed object: ' + value
- );
- }
- return seq;
- }
- function maybeIndexedSeqFromValue(value) {
- return (
- isArrayLike(value) ? new ArraySeq(value) :
- isIterator(value) ? new IteratorSeq(value) :
- hasIterator(value) ? new IterableSeq(value) :
- undefined
- );
- }
- function seqIterate(seq, fn, reverse, useKeys) {
- var cache = seq._cache;
- if (cache) {
- var maxIndex = cache.length - 1;
- for (var ii = 0; ii <= maxIndex; ii++) {
- var entry = cache[reverse ? maxIndex - ii : ii];
- if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {
- return ii + 1;
- }
- }
- return ii;
- }
- return seq.__iterateUncached(fn, reverse);
- }
- function seqIterator(seq, type, reverse, useKeys) {
- var cache = seq._cache;
- if (cache) {
- var maxIndex = cache.length - 1;
- var ii = 0;
- return new Iterator(function() {
- var entry = cache[reverse ? maxIndex - ii : ii];
- return ii++ > maxIndex ?
- iteratorDone() :
- iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);
- });
- }
- return seq.__iteratorUncached(type, reverse);
- }
- function fromJS(json, converter) {
- return converter ?
- fromJSWith(converter, json, '', {'': json}) :
- fromJSDefault(json);
- }
- function fromJSWith(converter, json, key, parentJSON) {
- if (Array.isArray(json)) {
- return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)}));
- }
- if (isPlainObj(json)) {
- return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)}));
- }
- return json;
- }
- function fromJSDefault(json) {
- if (Array.isArray(json)) {
- return IndexedSeq(json).map(fromJSDefault).toList();
- }
- if (isPlainObj(json)) {
- return KeyedSeq(json).map(fromJSDefault).toMap();
- }
- return json;
- }
- function isPlainObj(value) {
- return value && (value.constructor === Object || value.constructor === undefined);
- }
- /**
- * An extension of the "same-value" algorithm as [described for use by ES6 Map
- * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)
- *
- * NaN is considered the same as NaN, however -0 and 0 are considered the same
- * value, which is different from the algorithm described by
- * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
- *
- * This is extended further to allow Objects to describe the values they
- * represent, by way of `valueOf` or `equals` (and `hashCode`).
- *
- * Note: because of this extension, the key equality of Immutable.Map and the
- * value equality of Immutable.Set will differ from ES6 Map and Set.
- *
- * ### Defining custom values
- *
- * The easiest way to describe the value an object represents is by implementing
- * `valueOf`. For example, `Date` represents a value by returning a unix
- * timestamp for `valueOf`:
- *
- * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...
- * var date2 = new Date(1234567890000);
- * date1.valueOf(); // 1234567890000
- * assert( date1 !== date2 );
- * assert( Immutable.is( date1, date2 ) );
- *
- * Note: overriding `valueOf` may have other implications if you use this object
- * where JavaScript expects a primitive, such as implicit string coercion.
- *
- * For more complex types, especially collections, implementing `valueOf` may
- * not be performant. An alternative is to implement `equals` and `hashCode`.
- *
- * `equals` takes another object, presumably of similar type, and returns true
- * if the it is equal. Equality is symmetrical, so the same result should be
- * returned if this and the argument are flipped.
- *
- * assert( a.equals(b) === b.equals(a) );
- *
- * `hashCode` returns a 32bit integer number representing the object which will
- * be used to determine how to store the value object in a Map or Set. You must
- * provide both or neither methods, one must not exist without the other.
- *
- * Also, an important relationship between these methods must be upheld: if two
- * values are equal, they *must* return the same hashCode. If the values are not
- * equal, they might have the same hashCode; this is called a hash collision,
- * and while undesirable for performance reasons, it is acceptable.
- *
- * if (a.equals(b)) {
- * assert( a.hashCode() === b.hashCode() );
- * }
- *
- * All Immutable collections implement `equals` and `hashCode`.
- *
- */
- function is(valueA, valueB) {
- if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
- return true;
- }
- if (!valueA || !valueB) {
- return false;
- }
- if (typeof valueA.valueOf === 'function' &&
- typeof valueB.valueOf === 'function') {
- valueA = valueA.valueOf();
- valueB = valueB.valueOf();
- if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
- return true;
- }
- if (!valueA || !valueB) {
- return false;
- }
- }
- if (typeof valueA.equals === 'function' &&
- typeof valueB.equals === 'function' &&
- valueA.equals(valueB)) {
- return true;
- }
- return false;
- }
- function deepEqual(a, b) {
- if (a === b) {
- return true;
- }
- if (
- !isIterable(b) ||
- a.size !== undefined && b.size !== undefined && a.size !== b.size ||
- a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash ||
- isKeyed(a) !== isKeyed(b) ||
- isIndexed(a) !== isIndexed(b) ||
- isOrdered(a) !== isOrdered(b)
- ) {
- return false;
- }
- if (a.size === 0 && b.size === 0) {
- return true;
- }
- var notAssociative = !isAssociative(a);
- if (isOrdered(a)) {
- var entries = a.entries();
- return b.every(function(v, k) {
- var entry = entries.next().value;
- return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));
- }) && entries.next().done;
- }
- var flipped = false;
- if (a.size === undefined) {
- if (b.size === undefined) {
- if (typeof a.cacheResult === 'function') {
- a.cacheResult();
- }
- } else {
- flipped = true;
- var _ = a;
- a = b;
- b = _;
- }
- }
- var allEqual = true;
- var bSize = b.__iterate(function(v, k) {
- if (notAssociative ? !a.has(v) :
- flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {
- allEqual = false;
- return false;
- }
- });
- return allEqual && a.size === bSize;
- }
- createClass(Repeat, IndexedSeq);
- function Repeat(value, times) {
- if (!(this instanceof Repeat)) {
- return new Repeat(value, times);
- }
- this._value = value;
- this.size = times === undefined ? Infinity : Math.max(0, times);
- if (this.size === 0) {
- if (EMPTY_REPEAT) {
- return EMPTY_REPEAT;
- }
- EMPTY_REPEAT = this;
- }
- }
- Repeat.prototype.toString = function() {
- if (this.size === 0) {
- return 'Repeat []';
- }
- return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';
- };
- Repeat.prototype.get = function(index, notSetValue) {
- return this.has(index) ? this._value : notSetValue;
- };
- Repeat.prototype.includes = function(searchValue) {
- return is(this._value, searchValue);
- };
- Repeat.prototype.slice = function(begin, end) {
- var size = this.size;
- return wholeSlice(begin, end, size) ? this :
- new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));
- };
- Repeat.prototype.reverse = function() {
- return this;
- };
- Repeat.prototype.indexOf = function(searchValue) {
- if (is(this._value, searchValue)) {
- return 0;
- }
- return -1;
- };
- Repeat.prototype.lastIndexOf = function(searchValue) {
- if (is(this._value, searchValue)) {
- return this.size;
- }
- return -1;
- };
- Repeat.prototype.__iterate = function(fn, reverse) {
- for (var ii = 0; ii < this.size; ii++) {
- if (fn(this._value, ii, this) === false) {
- return ii + 1;
- }
- }
- return ii;
- };
- Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this;
- var ii = 0;
- return new Iterator(function()
- {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()}
- );
- };
- Repeat.prototype.equals = function(other) {
- return other instanceof Repeat ?
- is(this._value, other._value) :
- deepEqual(other);
- };
- var EMPTY_REPEAT;
- function invariant(condition, error) {
- if (!condition) throw new Error(error);
- }
- createClass(Range, IndexedSeq);
- function Range(start, end, step) {
- if (!(this instanceof Range)) {
- return new Range(start, end, step);
- }
- invariant(step !== 0, 'Cannot step a Range by 0');
- start = start || 0;
- if (end === undefined) {
- end = Infinity;
- }
- step = step === undefined ? 1 : Math.abs(step);
- if (end < start) {
- step = -step;
- }
- this._start = start;
- this._end = end;
- this._step = step;
- this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);
- if (this.size === 0) {
- if (EMPTY_RANGE) {
- return EMPTY_RANGE;
- }
- EMPTY_RANGE = this;
- }
- }
- Range.prototype.toString = function() {
- if (this.size === 0) {
- return 'Range []';
- }
- return 'Range [ ' +
- this._start + '...' + this._end +
- (this._step !== 1 ? ' by ' + this._step : '') +
- ' ]';
- };
- Range.prototype.get = function(index, notSetValue) {
- return this.has(index) ?
- this._start + wrapIndex(this, index) * this._step :
- notSetValue;
- };
- Range.prototype.includes = function(searchValue) {
- var possibleIndex = (searchValue - this._start) / this._step;
- return possibleIndex >= 0 &&
- possibleIndex < this.size &&
- possibleIndex === Math.floor(possibleIndex);
- };
- Range.prototype.slice = function(begin, end) {
- if (wholeSlice(begin, end, this.size)) {
- return this;
- }
- begin = resolveBegin(begin, this.size);
- end = resolveEnd(end, this.size);
- if (end <= begin) {
- return new Range(0, 0);
- }
- return new Range(this.get(begin, this._end), this.get(end, this._end), this._step);
- };
- Range.prototype.indexOf = function(searchValue) {
- var offsetValue = searchValue - this._start;
- if (offsetValue % this._step === 0) {
- var index = offsetValue / this._step;
- if (index >= 0 && index < this.size) {
- return index
- }
- }
- return -1;
- };
- Range.prototype.lastIndexOf = function(searchValue) {
- return this.indexOf(searchValue);
- };
- Range.prototype.__iterate = function(fn, reverse) {
- var maxIndex = this.size - 1;
- var step = this._step;
- var value = reverse ? this._start + maxIndex * step : this._start;
- for (var ii = 0; ii <= maxIndex; ii++) {
- if (fn(value, ii, this) === false) {
- return ii + 1;
- }
- value += reverse ? -step : step;
- }
- return ii;
- };
- Range.prototype.__iterator = function(type, reverse) {
- var maxIndex = this.size - 1;
- var step = this._step;
- var value = reverse ? this._start + maxIndex * step : this._start;
- var ii = 0;
- return new Iterator(function() {
- var v = value;
- value += reverse ? -step : step;
- return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);
- });
- };
- Range.prototype.equals = function(other) {
- return other instanceof Range ?
- this._start === other._start &&
- this._end === other._end &&
- this._step === other._step :
- deepEqual(this, other);
- };
- var EMPTY_RANGE;
- createClass(Collection, Iterable);
- function Collection() {
- throw TypeError('Abstract');
- }
- createClass(KeyedCollection, Collection);function KeyedCollection() {}
- createClass(IndexedCollection, Collection);function IndexedCollection() {}
- createClass(SetCollection, Collection);function SetCollection() {}
- Collection.Keyed = KeyedCollection;
- Collection.Indexed = IndexedCollection;
- Collection.Set = SetCollection;
- var imul =
- typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ?
- Math.imul :
- function imul(a, b) {
- a = a | 0; // int
- b = b | 0; // int
- var c = a & 0xffff;
- var d = b & 0xffff;
- // Shift by 0 fixes the sign on the high part.
- return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int
- };
- // v8 has an optimization for storing 31-bit signed numbers.
- // Values which have either 00 or 11 as the high order bits qualify.
- // This function drops the highest order bit in a signed number, maintaining
- // the sign bit.
- function smi(i32) {
- return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);
- }
- function hash(o) {
- if (o === false || o === null || o === undefined) {
- return 0;
- }
- if (typeof o.valueOf === 'function') {
- o = o.valueOf();
- if (o === false || o === null || o === undefined) {
- return 0;
- }
- }
- if (o === true) {
- return 1;
- }
- var type = typeof o;
- if (type === 'number') {
- if (o !== o || o === Infinity) {
- return 0;
- }
- var h = o | 0;
- if (h !== o) {
- h ^= o * 0xFFFFFFFF;
- }
- while (o > 0xFFFFFFFF) {
- o /= 0xFFFFFFFF;
- h ^= o;
- }
- return smi(h);
- }
- if (type === 'string') {
- return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);
- }
- if (typeof o.hashCode === 'function') {
- return o.hashCode();
- }
- if (type === 'object') {
- return hashJSObj(o);
- }
- if (typeof o.toString === 'function') {
- return hashString(o.toString());
- }
- throw new Error('Value type ' + type + ' cannot be hashed.');
- }
- function cachedHashString(string) {
- var hash = stringHashCache[string];
- if (hash === undefined) {
- hash = hashString(string);
- if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {
- STRING_HASH_CACHE_SIZE = 0;
- stringHashCache = {};
- }
- STRING_HASH_CACHE_SIZE++;
- stringHashCache[string] = hash;
- }
- return hash;
- }
- // http://jsperf.com/hashing-strings
- function hashString(string) {
- // This is the hash from JVM
- // The hash code for a string is computed as
- // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],
- // where s[i] is the ith character of the string and n is the length of
- // the string. We "mod" the result to make it between 0 (inclusive) and 2^31
- // (exclusive) by dropping high bits.
- var hash = 0;
- for (var ii = 0; ii < string.length; ii++) {
- hash = 31 * hash + string.charCodeAt(ii) | 0;
- }
- return smi(hash);
- }
- function hashJSObj(obj) {
- var hash;
- if (usingWeakMap) {
- hash = weakMap.get(obj);
- if (hash !== undefined) {
- return hash;
- }
- }
- hash = obj[UID_HASH_KEY];
- if (hash !== undefined) {
- return hash;
- }
- if (!canDefineProperty) {
- hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];
- if (hash !== undefined) {
- return hash;
- }
- hash = getIENodeHash(obj);
- if (hash !== undefined) {
- return hash;
- }
- }
- hash = ++objHashUID;
- if (objHashUID & 0x40000000) {
- objHashUID = 0;
- }
- if (usingWeakMap) {
- weakMap.set(obj, hash);
- } else if (isExtensible !== undefined && isExtensible(obj) === false) {
- throw new Error('Non-extensible objects are not allowed as keys.');
- } else if (canDefineProperty) {
- Object.defineProperty(obj, UID_HASH_KEY, {
- 'enumerable': false,
- 'configurable': false,
- 'writable': false,
- 'value': hash
- });
- } else if (obj.propertyIsEnumerable !== undefined &&
- obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {
- // Since we can't define a non-enumerable property on the object
- // we'll hijack one of the less-used non-enumerable properties to
- // save our hash on it. Since this is a function it will not show up in
- // `JSON.stringify` which is what we want.
- obj.propertyIsEnumerable = function() {
- return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);
- };
- obj.propertyIsEnumerable[UID_HASH_KEY] = hash;
- } else if (obj.nodeType !== undefined) {
- // At this point we couldn't get the IE `uniqueID` to use as a hash
- // and we couldn't use a non-enumerable property to exploit the
- // dontEnum bug so we simply add the `UID_HASH_KEY` on the node
- // itself.
- obj[UID_HASH_KEY] = hash;
- } else {
- throw new Error('Unable to set a non-enumerable property on object.');
- }
- return hash;
- }
- // Get references to ES5 object methods.
- var isExtensible = Object.isExtensible;
- // True if Object.defineProperty works as expected. IE8 fails this test.
- var canDefineProperty = (function() {
- try {
- Object.defineProperty({}, '@', {});
- return true;
- } catch (e) {
- return false;
- }
- }());
- // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it
- // and avoid memory leaks from the IE cloneNode bug.
- function getIENodeHash(node) {
- if (node && node.nodeType > 0) {
- switch (node.nodeType) {
- case 1: // Element
- return node.uniqueID;
- case 9: // Document
- return node.documentElement && node.documentElement.uniqueID;
- }
- }
- }
- // If possible, use a WeakMap.
- var usingWeakMap = typeof WeakMap === 'function';
- var weakMap;
- if (usingWeakMap) {
- weakMap = new WeakMap();
- }
- var objHashUID = 0;
- var UID_HASH_KEY = '__immutablehash__';
- if (typeof Symbol === 'function') {
- UID_HASH_KEY = Symbol(UID_HASH_KEY);
- }
- var STRING_HASH_CACHE_MIN_STRLEN = 16;
- var STRING_HASH_CACHE_MAX_SIZE = 255;
- var STRING_HASH_CACHE_SIZE = 0;
- var stringHashCache = {};
- function assertNotInfinite(size) {
- invariant(
- size !== Infinity,
- 'Cannot perform this action with an infinite size.'
- );
- }
- createClass(Map, KeyedCollection);
- // @pragma Construction
- function Map(value) {
- return value === null || value === undefined ? emptyMap() :
- isMap(value) && !isOrdered(value) ? value :
- emptyMap().withMutations(function(map ) {
- var iter = KeyedIterable(value);
- assertNotInfinite(iter.size);
- iter.forEach(function(v, k) {return map.set(k, v)});
- });
- }
- Map.of = function() {var keyValues = SLICE$0.call(arguments, 0);
- return emptyMap().withMutations(function(map ) {
- for (var i = 0; i < keyValues.length; i += 2) {
- if (i + 1 >= keyValues.length) {
- throw new Error('Missing value for key: ' + keyValues[i]);
- }
- map.set(keyValues[i], keyValues[i + 1]);
- }
- });
- };
- Map.prototype.toString = function() {
- return this.__toString('Map {', '}');
- };
- // @pragma Access
- Map.prototype.get = function(k, notSetValue) {
- return this._root ?
- this._root.get(0, undefined, k, notSetValue) :
- notSetValue;
- };
- // @pragma Modification
- Map.prototype.set = function(k, v) {
- return updateMap(this, k, v);
- };
- Map.prototype.setIn = function(keyPath, v) {
- return this.updateIn(keyPath, NOT_SET, function() {return v});
- };
- Map.prototype.remove = function(k) {
- return updateMap(this, k, NOT_SET);
- };
- Map.prototype.deleteIn = function(keyPath) {
- return this.updateIn(keyPath, function() {return NOT_SET});
- };
- Map.prototype.update = function(k, notSetValue, updater) {
- return arguments.length === 1 ?
- k(this) :
- this.updateIn([k], notSetValue, updater);
- };
- Map.prototype.updateIn = function(keyPath, notSetValue, updater) {
- if (!updater) {
- updater = notSetValue;
- notSetValue = undefined;
- }
- var updatedValue = updateInDeepMap(
- this,
- forceIterator(keyPath),
- notSetValue,
- updater
- );
- return updatedValue === NOT_SET ? undefined : updatedValue;
- };
- Map.prototype.clear = function() {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = 0;
- this._root = null;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return emptyMap();
- };
- // @pragma Composition
- Map.prototype.merge = function(/*...iters*/) {
- return mergeIntoMapWith(this, undefined, arguments);
- };
- Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
- return mergeIntoMapWith(this, merger, iters);
- };
- Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);
- return this.updateIn(
- keyPath,
- emptyMap(),
- function(m ) {return typeof m.merge === 'function' ?
- m.merge.apply(m, iters) :
- iters[iters.length - 1]}
- );
- };
- Map.prototype.mergeDeep = function(/*...iters*/) {
- return mergeIntoMapWith(this, deepMerger, arguments);
- };
- Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
- return mergeIntoMapWith(this, deepMergerWith(merger), iters);
- };
- Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);
- return this.updateIn(
- keyPath,
- emptyMap(),
- function(m ) {return typeof m.mergeDeep === 'function' ?
- m.mergeDeep.apply(m, iters) :
- iters[iters.length - 1]}
- );
- };
- Map.prototype.sort = function(comparator) {
- // Late binding
- return OrderedMap(sortFactory(this, comparator));
- };
- Map.prototype.sortBy = function(mapper, comparator) {
- // Late binding
- return OrderedMap(sortFactory(this, comparator, mapper));
- };
- // @pragma Mutability
- Map.prototype.withMutations = function(fn) {
- var mutable = this.asMutable();
- fn(mutable);
- return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;
- };
- Map.prototype.asMutable = function() {
- return this.__ownerID ? this : this.__ensureOwner(new OwnerID());
- };
- Map.prototype.asImmutable = function() {
- return this.__ensureOwner();
- };
- Map.prototype.wasAltered = function() {
- return this.__altered;
- };
- Map.prototype.__iterator = function(type, reverse) {
- return new MapIterator(this, type, reverse);
- };
- Map.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- var iterations = 0;
- this._root && this._root.iterate(function(entry ) {
- iterations++;
- return fn(entry[1], entry[0], this$0);
- }, reverse);
- return iterations;
- };
- Map.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- if (!ownerID) {
- this.__ownerID = ownerID;
- this.__altered = false;
- return this;
- }
- return makeMap(this.size, this._root, ownerID, this.__hash);
- };
- function isMap(maybeMap) {
- return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);
- }
- Map.isMap = isMap;
- var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';
- var MapPrototype = Map.prototype;
- MapPrototype[IS_MAP_SENTINEL] = true;
- MapPrototype[DELETE] = MapPrototype.remove;
- MapPrototype.removeIn = MapPrototype.deleteIn;
- // #pragma Trie Nodes
- function ArrayMapNode(ownerID, entries) {
- this.ownerID = ownerID;
- this.entries = entries;
- }
- ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
- var entries = this.entries;
- for (var ii = 0, len = entries.length; ii < len; ii++) {
- if (is(key, entries[ii][0])) {
- return entries[ii][1];
- }
- }
- return notSetValue;
- };
- ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- var removed = value === NOT_SET;
- var entries = this.entries;
- var idx = 0;
- for (var len = entries.length; idx < len; idx++) {
- if (is(key, entries[idx][0])) {
- break;
- }
- }
- var exists = idx < len;
- if (exists ? entries[idx][1] === value : removed) {
- return this;
- }
- SetRef(didAlter);
- (removed || !exists) && SetRef(didChangeSize);
- if (removed && entries.length === 1) {
- return; // undefined
- }
- if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {
- return createNodes(ownerID, entries, key, value);
- }
- var isEditable = ownerID && ownerID === this.ownerID;
- var newEntries = isEditable ? entries : arrCopy(entries);
- if (exists) {
- if (removed) {
- idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());
- } else {
- newEntries[idx] = [key, value];
- }
- } else {
- newEntries.push([key, value]);
- }
- if (isEditable) {
- this.entries = newEntries;
- return this;
- }
- return new ArrayMapNode(ownerID, newEntries);
- };
- function BitmapIndexedNode(ownerID, bitmap, nodes) {
- this.ownerID = ownerID;
- this.bitmap = bitmap;
- this.nodes = nodes;
- }
- BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK));
- var bitmap = this.bitmap;
- return (bitmap & bit) === 0 ? notSetValue :
- this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue);
- };
- BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var bit = 1 << keyHashFrag;
- var bitmap = this.bitmap;
- var exists = (bitmap & bit) !== 0;
- if (!exists && value === NOT_SET) {
- return this;
- }
- var idx = popCount(bitmap & (bit - 1));
- var nodes = this.nodes;
- var node = exists ? nodes[idx] : undefined;
- var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
- if (newNode === node) {
- return this;
- }
- if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {
- return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);
- }
- if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {
- return nodes[idx ^ 1];
- }
- if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {
- return newNode;
- }
- var isEditable = ownerID && ownerID === this.ownerID;
- var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;
- var newNodes = exists ? newNode ?
- setIn(nodes, idx, newNode, isEditable) :
- spliceOut(nodes, idx, isEditable) :
- spliceIn(nodes, idx, newNode, isEditable);
- if (isEditable) {
- this.bitmap = newBitmap;
- this.nodes = newNodes;
- return this;
- }
- return new BitmapIndexedNode(ownerID, newBitmap, newNodes);
- };
- function HashArrayMapNode(ownerID, count, nodes) {
- this.ownerID = ownerID;
- this.count = count;
- this.nodes = nodes;
- }
- HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var node = this.nodes[idx];
- return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;
- };
- HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var removed = value === NOT_SET;
- var nodes = this.nodes;
- var node = nodes[idx];
- if (removed && !node) {
- return this;
- }
- var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
- if (newNode === node) {
- return this;
- }
- var newCount = this.count;
- if (!node) {
- newCount++;
- } else if (!newNode) {
- newCount--;
- if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {
- return packNodes(ownerID, nodes, newCount, idx);
- }
- }
- var isEditable = ownerID && ownerID === this.ownerID;
- var newNodes = setIn(nodes, idx, newNode, isEditable);
- if (isEditable) {
- this.count = newCount;
- this.nodes = newNodes;
- return this;
- }
- return new HashArrayMapNode(ownerID, newCount, newNodes);
- };
- function HashCollisionNode(ownerID, keyHash, entries) {
- this.ownerID = ownerID;
- this.keyHash = keyHash;
- this.entries = entries;
- }
- HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) {
- var entries = this.entries;
- for (var ii = 0, len = entries.length; ii < len; ii++) {
- if (is(key, entries[ii][0])) {
- return entries[ii][1];
- }
- }
- return notSetValue;
- };
- HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (keyHash === undefined) {
- keyHash = hash(key);
- }
- var removed = value === NOT_SET;
- if (keyHash !== this.keyHash) {
- if (removed) {
- return this;
- }
- SetRef(didAlter);
- SetRef(didChangeSize);
- return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);
- }
- var entries = this.entries;
- var idx = 0;
- for (var len = entries.length; idx < len; idx++) {
- if (is(key, entries[idx][0])) {
- break;
- }
- }
- var exists = idx < len;
- if (exists ? entries[idx][1] === value : removed) {
- return this;
- }
- SetRef(didAlter);
- (removed || !exists) && SetRef(didChangeSize);
- if (removed && len === 2) {
- return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);
- }
- var isEditable = ownerID && ownerID === this.ownerID;
- var newEntries = isEditable ? entries : arrCopy(entries);
- if (exists) {
- if (removed) {
- idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());
- } else {
- newEntries[idx] = [key, value];
- }
- } else {
- newEntries.push([key, value]);
- }
- if (isEditable) {
- this.entries = newEntries;
- return this;
- }
- return new HashCollisionNode(ownerID, this.keyHash, newEntries);
- };
- function ValueNode(ownerID, keyHash, entry) {
- this.ownerID = ownerID;
- this.keyHash = keyHash;
- this.entry = entry;
- }
- ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) {
- return is(key, this.entry[0]) ? this.entry[1] : notSetValue;
- };
- ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- var removed = value === NOT_SET;
- var keyMatch = is(key, this.entry[0]);
- if (keyMatch ? value === this.entry[1] : removed) {
- return this;
- }
- SetRef(didAlter);
- if (removed) {
- SetRef(didChangeSize);
- return; // undefined
- }
- if (keyMatch) {
- if (ownerID && ownerID === this.ownerID) {
- this.entry[1] = value;
- return this;
- }
- return new ValueNode(ownerID, this.keyHash, [key, value]);
- }
- SetRef(didChangeSize);
- return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);
- };
- // #pragma Iterators
- ArrayMapNode.prototype.iterate =
- HashCollisionNode.prototype.iterate = function (fn, reverse) {
- var entries = this.entries;
- for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {
- if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {
- return false;
- }
- }
- }
- BitmapIndexedNode.prototype.iterate =
- HashArrayMapNode.prototype.iterate = function (fn, reverse) {
- var nodes = this.nodes;
- for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
- var node = nodes[reverse ? maxIndex - ii : ii];
- if (node && node.iterate(fn, reverse) === false) {
- return false;
- }
- }
- }
- ValueNode.prototype.iterate = function (fn, reverse) {
- return fn(this.entry);
- }
- createClass(MapIterator, Iterator);
- function MapIterator(map, type, reverse) {
- this._type = type;
- this._reverse = reverse;
- this._stack = map._root && mapIteratorFrame(map._root);
- }
- MapIterator.prototype.next = function() {
- var type = this._type;
- var stack = this._stack;
- while (stack) {
- var node = stack.node;
- var index = stack.index++;
- var maxIndex;
- if (node.entry) {
- if (index === 0) {
- return mapIteratorValue(type, node.entry);
- }
- } else if (node.entries) {
- maxIndex = node.entries.length - 1;
- if (index <= maxIndex) {
- return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);
- }
- } else {
- maxIndex = node.nodes.length - 1;
- if (index <= maxIndex) {
- var subNode = node.nodes[this._reverse ? maxIndex - index : index];
- if (subNode) {
- if (subNode.entry) {
- return mapIteratorValue(type, subNode.entry);
- }
- stack = this._stack = mapIteratorFrame(subNode, stack);
- }
- continue;
- }
- }
- stack = this._stack = this._stack.__prev;
- }
- return iteratorDone();
- };
- function mapIteratorValue(type, entry) {
- return iteratorValue(type, entry[0], entry[1]);
- }
- function mapIteratorFrame(node, prev) {
- return {
- node: node,
- index: 0,
- __prev: prev
- };
- }
- function makeMap(size, root, ownerID, hash) {
- var map = Object.create(MapPrototype);
- map.size = size;
- map._root = root;
- map.__ownerID = ownerID;
- map.__hash = hash;
- map.__altered = false;
- return map;
- }
- var EMPTY_MAP;
- function emptyMap() {
- return EMPTY_MAP || (EMPTY_MAP = makeMap(0));
- }
- function updateMap(map, k, v) {
- var newRoot;
- var newSize;
- if (!map._root) {
- if (v === NOT_SET) {
- return map;
- }
- newSize = 1;
- newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);
- } else {
- var didChangeSize = MakeRef(CHANGE_LENGTH);
- var didAlter = MakeRef(DID_ALTER);
- newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);
- if (!didAlter.value) {
- return map;
- }
- newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);
- }
- if (map.__ownerID) {
- map.size = newSize;
- map._root = newRoot;
- map.__hash = undefined;
- map.__altered = true;
- return map;
- }
- return newRoot ? makeMap(newSize, newRoot) : emptyMap();
- }
- function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
- if (!node) {
- if (value === NOT_SET) {
- return node;
- }
- SetRef(didAlter);
- SetRef(didChangeSize);
- return new ValueNode(ownerID, keyHash, [key, value]);
- }
- return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);
- }
- function isLeafNode(node) {
- return node.constructor === ValueNode || node.constructor === HashCollisionNode;
- }
- function mergeIntoNode(node, ownerID, shift, keyHash, entry) {
- if (node.keyHash === keyHash) {
- return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);
- }
- var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;
- var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
- var newNode;
- var nodes = idx1 === idx2 ?
- [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] :
- ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);
- return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);
- }
- function createNodes(ownerID, entries, key, value) {
- if (!ownerID) {
- ownerID = new OwnerID();
- }
- var node = new ValueNode(ownerID, hash(key), [key, value]);
- for (var ii = 0; ii < entries.length; ii++) {
- var entry = entries[ii];
- node = node.update(ownerID, 0, undefined, entry[0], entry[1]);
- }
- return node;
- }
- function packNodes(ownerID, nodes, count, excluding) {
- var bitmap = 0;
- var packedII = 0;
- var packedNodes = new Array(count);
- for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {
- var node = nodes[ii];
- if (node !== undefined && ii !== excluding) {
- bitmap |= bit;
- packedNodes[packedII++] = node;
- }
- }
- return new BitmapIndexedNode(ownerID, bitmap, packedNodes);
- }
- function expandNodes(ownerID, nodes, bitmap, including, node) {
- var count = 0;
- var expandedNodes = new Array(SIZE);
- for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {
- expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;
- }
- expandedNodes[including] = node;
- return new HashArrayMapNode(ownerID, count + 1, expandedNodes);
- }
- function mergeIntoMapWith(map, merger, iterables) {
- var iters = [];
- for (var ii = 0; ii < iterables.length; ii++) {
- var value = iterables[ii];
- var iter = KeyedIterable(value);
- if (!isIterable(value)) {
- iter = iter.map(function(v ) {return fromJS(v)});
- }
- iters.push(iter);
- }
- return mergeIntoCollectionWith(map, merger, iters);
- }
- function deepMerger(existing, value, key) {
- return existing && existing.mergeDeep && isIterable(value) ?
- existing.mergeDeep(value) :
- is(existing, value) ? existing : value;
- }
- function deepMergerWith(merger) {
- return function(existing, value, key) {
- if (existing && existing.mergeDeepWith && isIterable(value)) {
- return existing.mergeDeepWith(merger, value);
- }
- var nextValue = merger(existing, value, key);
- return is(existing, nextValue) ? existing : nextValue;
- };
- }
- function mergeIntoCollectionWith(collection, merger, iters) {
- iters = iters.filter(function(x ) {return x.size !== 0});
- if (iters.length === 0) {
- return collection;
- }
- if (collection.size === 0 && !collection.__ownerID && iters.length === 1) {
- return collection.constructor(iters[0]);
- }
- return collection.withMutations(function(collection ) {
- var mergeIntoMap = merger ?
- function(value, key) {
- collection.update(key, NOT_SET, function(existing )
- {return existing === NOT_SET ? value : merger(existing, value, key)}
- );
- } :
- function(value, key) {
- collection.set(key, value);
- }
- for (var ii = 0; ii < iters.length; ii++) {
- iters[ii].forEach(mergeIntoMap);
- }
- });
- }
- function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {
- var isNotSet = existing === NOT_SET;
- var step = keyPathIter.next();
- if (step.done) {
- var existingValue = isNotSet ? notSetValue : existing;
- var newValue = updater(existingValue);
- return newValue === existingValue ? existing : newValue;
- }
- invariant(
- isNotSet || (existing && existing.set),
- 'invalid keyPath'
- );
- var key = step.value;
- var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);
- var nextUpdated = updateInDeepMap(
- nextExisting,
- keyPathIter,
- notSetValue,
- updater
- );
- return nextUpdated === nextExisting ? existing :
- nextUpdated === NOT_SET ? existing.remove(key) :
- (isNotSet ? emptyMap() : existing).set(key, nextUpdated);
- }
- function popCount(x) {
- x = x - ((x >> 1) & 0x55555555);
- x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
- x = (x + (x >> 4)) & 0x0f0f0f0f;
- x = x + (x >> 8);
- x = x + (x >> 16);
- return x & 0x7f;
- }
- function setIn(array, idx, val, canEdit) {
- var newArray = canEdit ? array : arrCopy(array);
- newArray[idx] = val;
- return newArray;
- }
- function spliceIn(array, idx, val, canEdit) {
- var newLen = array.length + 1;
- if (canEdit && idx + 1 === newLen) {
- array[idx] = val;
- return array;
- }
- var newArray = new Array(newLen);
- var after = 0;
- for (var ii = 0; ii < newLen; ii++) {
- if (ii === idx) {
- newArray[ii] = val;
- after = -1;
- } else {
- newArray[ii] = array[ii + after];
- }
- }
- return newArray;
- }
- function spliceOut(array, idx, canEdit) {
- var newLen = array.length - 1;
- if (canEdit && idx === newLen) {
- array.pop();
- return array;
- }
- var newArray = new Array(newLen);
- var after = 0;
- for (var ii = 0; ii < newLen; ii++) {
- if (ii === idx) {
- after = 1;
- }
- newArray[ii] = array[ii + after];
- }
- return newArray;
- }
- var MAX_ARRAY_MAP_SIZE = SIZE / 4;
- var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;
- var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;
- createClass(List, IndexedCollection);
- // @pragma Construction
- function List(value) {
- var empty = emptyList();
- if (value === null || value === undefined) {
- return empty;
- }
- if (isList(value)) {
- return value;
- }
- var iter = IndexedIterable(value);
- var size = iter.size;
- if (size === 0) {
- return empty;
- }
- assertNotInfinite(size);
- if (size > 0 && size < SIZE) {
- return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
- }
- return empty.withMutations(function(list ) {
- list.setSize(size);
- iter.forEach(function(v, i) {return list.set(i, v)});
- });
- }
- List.of = function(/*...values*/) {
- return this(arguments);
- };
- List.prototype.toString = function() {
- return this.__toString('List [', ']');
- };
- // @pragma Access
- List.prototype.get = function(index, notSetValue) {
- index = wrapIndex(this, index);
- if (index >= 0 && index < this.size) {
- index += this._origin;
- var node = listNodeFor(this, index);
- return node && node.array[index & MASK];
- }
- return notSetValue;
- };
- // @pragma Modification
- List.prototype.set = function(index, value) {
- return updateList(this, index, value);
- };
- List.prototype.remove = function(index) {
- return !this.has(index) ? this :
- index === 0 ? this.shift() :
- index === this.size - 1 ? this.pop() :
- this.splice(index, 1);
- };
- List.prototype.insert = function(index, value) {
- return this.splice(index, 0, value);
- };
- List.prototype.clear = function() {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = this._origin = this._capacity = 0;
- this._level = SHIFT;
- this._root = this._tail = null;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return emptyList();
- };
- List.prototype.push = function(/*...values*/) {
- var values = arguments;
- var oldSize = this.size;
- return this.withMutations(function(list ) {
- setListBounds(list, 0, oldSize + values.length);
- for (var ii = 0; ii < values.length; ii++) {
- list.set(oldSize + ii, values[ii]);
- }
- });
- };
- List.prototype.pop = function() {
- return setListBounds(this, 0, -1);
- };
- List.prototype.unshift = function(/*...values*/) {
- var values = arguments;
- return this.withMutations(function(list ) {
- setListBounds(list, -values.length);
- for (var ii = 0; ii < values.length; ii++) {
- list.set(ii, values[ii]);
- }
- });
- };
- List.prototype.shift = function() {
- return setListBounds(this, 1);
- };
- // @pragma Composition
- List.prototype.merge = function(/*...iters*/) {
- return mergeIntoListWith(this, undefined, arguments);
- };
- List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
- return mergeIntoListWith(this, merger, iters);
- };
- List.prototype.mergeDeep = function(/*...iters*/) {
- return mergeIntoListWith(this, deepMerger, arguments);
- };
- List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
- return mergeIntoListWith(this, deepMergerWith(merger), iters);
- };
- List.prototype.setSize = function(size) {
- return setListBounds(this, 0, size);
- };
- // @pragma Iteration
- List.prototype.slice = function(begin, end) {
- var size = this.size;
- if (wholeSlice(begin, end, size)) {
- return this;
- }
- return setListBounds(
- this,
- resolveBegin(begin, size),
- resolveEnd(end, size)
- );
- };
- List.prototype.__iterator = function(type, reverse) {
- var index = 0;
- var values = iterateList(this, reverse);
- return new Iterator(function() {
- var value = values();
- return value === DONE ?
- iteratorDone() :
- iteratorValue(type, index++, value);
- });
- };
- List.prototype.__iterate = function(fn, reverse) {
- var index = 0;
- var values = iterateList(this, reverse);
- var value;
- while ((value = values()) !== DONE) {
- if (fn(value, index++, this) === false) {
- break;
- }
- }
- return index;
- };
- List.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- if (!ownerID) {
- this.__ownerID = ownerID;
- return this;
- }
- return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);
- };
- function isList(maybeList) {
- return !!(maybeList && maybeList[IS_LIST_SENTINEL]);
- }
- List.isList = isList;
- var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
- var ListPrototype = List.prototype;
- ListPrototype[IS_LIST_SENTINEL] = true;
- ListPrototype[DELETE] = ListPrototype.remove;
- ListPrototype.setIn = MapPrototype.setIn;
- ListPrototype.deleteIn =
- ListPrototype.removeIn = MapPrototype.removeIn;
- ListPrototype.update = MapPrototype.update;
- ListPrototype.updateIn = MapPrototype.updateIn;
- ListPrototype.mergeIn = MapPrototype.mergeIn;
- ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
- ListPrototype.withMutations = MapPrototype.withMutations;
- ListPrototype.asMutable = MapPrototype.asMutable;
- ListPrototype.asImmutable = MapPrototype.asImmutable;
- ListPrototype.wasAltered = MapPrototype.wasAltered;
- function VNode(array, ownerID) {
- this.array = array;
- this.ownerID = ownerID;
- }
- // TODO: seems like these methods are very similar
- VNode.prototype.removeBefore = function(ownerID, level, index) {
- if (index === level ? 1 << level : false || this.array.length === 0) {
- return this;
- }
- var originIndex = (index >>> level) & MASK;
- if (originIndex >= this.array.length) {
- return new VNode([], ownerID);
- }
- var removingFirst = originIndex === 0;
- var newChild;
- if (level > 0) {
- var oldChild = this.array[originIndex];
- newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);
- if (newChild === oldChild && removingFirst) {
- return this;
- }
- }
- if (removingFirst && !newChild) {
- return this;
- }
- var editable = editableVNode(this, ownerID);
- if (!removingFirst) {
- for (var ii = 0; ii < originIndex; ii++) {
- editable.array[ii] = undefined;
- }
- }
- if (newChild) {
- editable.array[originIndex] = newChild;
- }
- return editable;
- };
- VNode.prototype.removeAfter = function(ownerID, level, index) {
- if (index === (level ? 1 << level : 0) || this.array.length === 0) {
- return this;
- }
- var sizeIndex = ((index - 1) >>> level) & MASK;
- if (sizeIndex >= this.array.length) {
- return this;
- }
- var newChild;
- if (level > 0) {
- var oldChild = this.array[sizeIndex];
- newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);
- if (newChild === oldChild && sizeIndex === this.array.length - 1) {
- return this;
- }
- }
- var editable = editableVNode(this, ownerID);
- editable.array.splice(sizeIndex + 1);
- if (newChild) {
- editable.array[sizeIndex] = newChild;
- }
- return editable;
- };
- var DONE = {};
- function iterateList(list, reverse) {
- var left = list._origin;
- var right = list._capacity;
- var tailPos = getTailOffset(right);
- var tail = list._tail;
- return iterateNodeOrLeaf(list._root, list._level, 0);
- function iterateNodeOrLeaf(node, level, offset) {
- return level === 0 ?
- iterateLeaf(node, offset) :
- iterateNode(node, level, offset);
- }
- function iterateLeaf(node, offset) {
- var array = offset === tailPos ? tail && tail.array : node && node.array;
- var from = offset > left ? 0 : left - offset;
- var to = right - offset;
- if (to > SIZE) {
- to = SIZE;
- }
- return function() {
- if (from === to) {
- return DONE;
- }
- var idx = reverse ? --to : from++;
- return array && array[idx];
- };
- }
- function iterateNode(node, level, offset) {
- var values;
- var array = node && node.array;
- var from = offset > left ? 0 : (left - offset) >> level;
- var to = ((right - offset) >> level) + 1;
- if (to > SIZE) {
- to = SIZE;
- }
- return function() {
- do {
- if (values) {
- var value = values();
- if (value !== DONE) {
- return value;
- }
- values = null;
- }
- if (from === to) {
- return DONE;
- }
- var idx = reverse ? --to : from++;
- values = iterateNodeOrLeaf(
- array && array[idx], level - SHIFT, offset + (idx << level)
- );
- } while (true);
- };
- }
- }
- function makeList(origin, capacity, level, root, tail, ownerID, hash) {
- var list = Object.create(ListPrototype);
- list.size = capacity - origin;
- list._origin = origin;
- list._capacity = capacity;
- list._level = level;
- list._root = root;
- list._tail = tail;
- list.__ownerID = ownerID;
- list.__hash = hash;
- list.__altered = false;
- return list;
- }
- var EMPTY_LIST;
- function emptyList() {
- return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
- }
- function updateList(list, index, value) {
- index = wrapIndex(list, index);
- if (index !== index) {
- return list;
- }
- if (index >= list.size || index < 0) {
- return list.withMutations(function(list ) {
- index < 0 ?
- setListBounds(list, index).set(0, value) :
- setListBounds(list, 0, index + 1).set(index, value)
- });
- }
- index += list._origin;
- var newTail = list._tail;
- var newRoot = list._root;
- var didAlter = MakeRef(DID_ALTER);
- if (index >= getTailOffset(list._capacity)) {
- newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);
- } else {
- newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);
- }
- if (!didAlter.value) {
- return list;
- }
- if (list.__ownerID) {
- list._root = newRoot;
- list._tail = newTail;
- list.__hash = undefined;
- list.__altered = true;
- return list;
- }
- return makeList(list._origin, list._capacity, list._level, newRoot, newTail);
- }
- function updateVNode(node, ownerID, level, index, value, didAlter) {
- var idx = (index >>> level) & MASK;
- var nodeHas = node && idx < node.array.length;
- if (!nodeHas && value === undefined) {
- return node;
- }
- var newNode;
- if (level > 0) {
- var lowerNode = node && node.array[idx];
- var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);
- if (newLowerNode === lowerNode) {
- return node;
- }
- newNode = editableVNode(node, ownerID);
- newNode.array[idx] = newLowerNode;
- return newNode;
- }
- if (nodeHas && node.array[idx] === value) {
- return node;
- }
- SetRef(didAlter);
- newNode = editableVNode(node, ownerID);
- if (value === undefined && idx === newNode.array.length - 1) {
- newNode.array.pop();
- } else {
- newNode.array[idx] = value;
- }
- return newNode;
- }
- function editableVNode(node, ownerID) {
- if (ownerID && node && ownerID === node.ownerID) {
- return node;
- }
- return new VNode(node ? node.array.slice() : [], ownerID);
- }
- function listNodeFor(list, rawIndex) {
- if (rawIndex >= getTailOffset(list._capacity)) {
- return list._tail;
- }
- if (rawIndex < 1 << (list._level + SHIFT)) {
- var node = list._root;
- var level = list._level;
- while (node && level > 0) {
- node = node.array[(rawIndex >>> level) & MASK];
- level -= SHIFT;
- }
- return node;
- }
- }
- function setListBounds(list, begin, end) {
- // Sanitize begin & end using this shorthand for ToInt32(argument)
- // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
- if (begin !== undefined) {
- begin = begin | 0;
- }
- if (end !== undefined) {
- end = end | 0;
- }
- var owner = list.__ownerID || new OwnerID();
- var oldOrigin = list._origin;
- var oldCapacity = list._capacity;
- var newOrigin = oldOrigin + begin;
- var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;
- if (newOrigin === oldOrigin && newCapacity === oldCapacity) {
- return list;
- }
- // If it's going to end after it starts, it's empty.
- if (newOrigin >= newCapacity) {
- return list.clear();
- }
- var newLevel = list._level;
- var newRoot = list._root;
- // New origin might need creating a higher root.
- var offsetShift = 0;
- while (newOrigin + offsetShift < 0) {
- newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);
- newLevel += SHIFT;
- offsetShift += 1 << newLevel;
- }
- if (offsetShift) {
- newOrigin += offsetShift;
- oldOrigin += offsetShift;
- newCapacity += offsetShift;
- oldCapacity += offsetShift;
- }
- var oldTailOffset = getTailOffset(oldCapacity);
- var newTailOffset = getTailOffset(newCapacity);
- // New size might need creating a higher root.
- while (newTailOffset >= 1 << (newLevel + SHIFT)) {
- newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);
- newLevel += SHIFT;
- }
- // Locate or create the new tail.
- var oldTail = list._tail;
- var newTail = newTailOffset < oldTailOffset ?
- listNodeFor(list, newCapacity - 1) :
- newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;
- // Merge Tail into tree.
- if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {
- newRoot = editableVNode(newRoot, owner);
- var node = newRoot;
- for (var level = newLevel; level > SHIFT; level -= SHIFT) {
- var idx = (oldTailOffset >>> level) & MASK;
- node = node.array[idx] = editableVNode(node.array[idx], owner);
- }
- node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;
- }
- // If the size has been reduced, there's a chance the tail needs to be trimmed.
- if (newCapacity < oldCapacity) {
- newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);
- }
- // If the new origin is within the tail, then we do not need a root.
- if (newOrigin >= newTailOffset) {
- newOrigin -= newTailOffset;
- newCapacity -= newTailOffset;
- newLevel = SHIFT;
- newRoot = null;
- newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);
- // Otherwise, if the root has been trimmed, garbage collect.
- } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {
- offsetShift = 0;
- // Identify the new top root node of the subtree of the old root.
- while (newRoot) {
- var beginIndex = (newOrigin >>> newLevel) & MASK;
- if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {
- break;
- }
- if (beginIndex) {
- offsetShift += (1 << newLevel) * beginIndex;
- }
- newLevel -= SHIFT;
- newRoot = newRoot.array[beginIndex];
- }
- // Trim the new sides of the new root.
- if (newRoot && newOrigin > oldOrigin) {
- newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);
- }
- if (newRoot && newTailOffset < oldTailOffset) {
- newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);
- }
- if (offsetShift) {
- newOrigin -= offsetShift;
- newCapacity -= offsetShift;
- }
- }
- if (list.__ownerID) {
- list.size = newCapacity - newOrigin;
- list._origin = newOrigin;
- list._capacity = newCapacity;
- list._level = newLevel;
- list._root = newRoot;
- list._tail = newTail;
- list.__hash = undefined;
- list.__altered = true;
- return list;
- }
- return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);
- }
- function mergeIntoListWith(list, merger, iterables) {
- var iters = [];
- var maxSize = 0;
- for (var ii = 0; ii < iterables.length; ii++) {
- var value = iterables[ii];
- var iter = IndexedIterable(value);
- if (iter.size > maxSize) {
- maxSize = iter.size;
- }
- if (!isIterable(value)) {
- iter = iter.map(function(v ) {return fromJS(v)});
- }
- iters.push(iter);
- }
- if (maxSize > list.size) {
- list = list.setSize(maxSize);
- }
- return mergeIntoCollectionWith(list, merger, iters);
- }
- function getTailOffset(size) {
- return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);
- }
- createClass(OrderedMap, Map);
- // @pragma Construction
- function OrderedMap(value) {
- return value === null || value === undefined ? emptyOrderedMap() :
- isOrderedMap(value) ? value :
- emptyOrderedMap().withMutations(function(map ) {
- var iter = KeyedIterable(value);
- assertNotInfinite(iter.size);
- iter.forEach(function(v, k) {return map.set(k, v)});
- });
- }
- OrderedMap.of = function(/*...values*/) {
- return this(arguments);
- };
- OrderedMap.prototype.toString = function() {
- return this.__toString('OrderedMap {', '}');
- };
- // @pragma Access
- OrderedMap.prototype.get = function(k, notSetValue) {
- var index = this._map.get(k);
- return index !== undefined ? this._list.get(index)[1] : notSetValue;
- };
- // @pragma Modification
- OrderedMap.prototype.clear = function() {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = 0;
- this._map.clear();
- this._list.clear();
- return this;
- }
- return emptyOrderedMap();
- };
- OrderedMap.prototype.set = function(k, v) {
- return updateOrderedMap(this, k, v);
- };
- OrderedMap.prototype.remove = function(k) {
- return updateOrderedMap(this, k, NOT_SET);
- };
- OrderedMap.prototype.wasAltered = function() {
- return this._map.wasAltered() || this._list.wasAltered();
- };
- OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- return this._list.__iterate(
- function(entry ) {return entry && fn(entry[1], entry[0], this$0)},
- reverse
- );
- };
- OrderedMap.prototype.__iterator = function(type, reverse) {
- return this._list.fromEntrySeq().__iterator(type, reverse);
- };
- OrderedMap.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- var newMap = this._map.__ensureOwner(ownerID);
- var newList = this._list.__ensureOwner(ownerID);
- if (!ownerID) {
- this.__ownerID = ownerID;
- this._map = newMap;
- this._list = newList;
- return this;
- }
- return makeOrderedMap(newMap, newList, ownerID, this.__hash);
- };
- function isOrderedMap(maybeOrderedMap) {
- return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);
- }
- OrderedMap.isOrderedMap = isOrderedMap;
- OrderedMap.prototype[IS_ORDERED_SENTINEL] = true;
- OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;
- function makeOrderedMap(map, list, ownerID, hash) {
- var omap = Object.create(OrderedMap.prototype);
- omap.size = map ? map.size : 0;
- omap._map = map;
- omap._list = list;
- omap.__ownerID = ownerID;
- omap.__hash = hash;
- return omap;
- }
- var EMPTY_ORDERED_MAP;
- function emptyOrderedMap() {
- return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));
- }
- function updateOrderedMap(omap, k, v) {
- var map = omap._map;
- var list = omap._list;
- var i = map.get(k);
- var has = i !== undefined;
- var newMap;
- var newList;
- if (v === NOT_SET) { // removed
- if (!has) {
- return omap;
- }
- if (list.size >= SIZE && list.size >= map.size * 2) {
- newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx});
- newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap();
- if (omap.__ownerID) {
- newMap.__ownerID = newList.__ownerID = omap.__ownerID;
- }
- } else {
- newMap = map.remove(k);
- newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);
- }
- } else {
- if (has) {
- if (v === list.get(i)[1]) {
- return omap;
- }
- newMap = map;
- newList = list.set(i, [k, v]);
- } else {
- newMap = map.set(k, list.size);
- newList = list.set(list.size, [k, v]);
- }
- }
- if (omap.__ownerID) {
- omap.size = newMap.size;
- omap._map = newMap;
- omap._list = newList;
- omap.__hash = undefined;
- return omap;
- }
- return makeOrderedMap(newMap, newList);
- }
- createClass(ToKeyedSequence, KeyedSeq);
- function ToKeyedSequence(indexed, useKeys) {
- this._iter = indexed;
- this._useKeys = useKeys;
- this.size = indexed.size;
- }
- ToKeyedSequence.prototype.get = function(key, notSetValue) {
- return this._iter.get(key, notSetValue);
- };
- ToKeyedSequence.prototype.has = function(key) {
- return this._iter.has(key);
- };
- ToKeyedSequence.prototype.valueSeq = function() {
- return this._iter.valueSeq();
- };
- ToKeyedSequence.prototype.reverse = function() {var this$0 = this;
- var reversedSequence = reverseFactory(this, true);
- if (!this._useKeys) {
- reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()};
- }
- return reversedSequence;
- };
- ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this;
- var mappedSequence = mapFactory(this, mapper, context);
- if (!this._useKeys) {
- mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)};
- }
- return mappedSequence;
- };
- ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- var ii;
- return this._iter.__iterate(
- this._useKeys ?
- function(v, k) {return fn(v, k, this$0)} :
- ((ii = reverse ? resolveSize(this) : 0),
- function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}),
- reverse
- );
- };
- ToKeyedSequence.prototype.__iterator = function(type, reverse) {
- if (this._useKeys) {
- return this._iter.__iterator(type, reverse);
- }
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- var ii = reverse ? resolveSize(this) : 0;
- return new Iterator(function() {
- var step = iterator.next();
- return step.done ? step :
- iteratorValue(type, reverse ? --ii : ii++, step.value, step);
- });
- };
- ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;
- createClass(ToIndexedSequence, IndexedSeq);
- function ToIndexedSequence(iter) {
- this._iter = iter;
- this.size = iter.size;
- }
- ToIndexedSequence.prototype.includes = function(value) {
- return this._iter.includes(value);
- };
- ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- var iterations = 0;
- return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse);
- };
- ToIndexedSequence.prototype.__iterator = function(type, reverse) {
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- var iterations = 0;
- return new Iterator(function() {
- var step = iterator.next();
- return step.done ? step :
- iteratorValue(type, iterations++, step.value, step)
- });
- };
- createClass(ToSetSequence, SetSeq);
- function ToSetSequence(iter) {
- this._iter = iter;
- this.size = iter.size;
- }
- ToSetSequence.prototype.has = function(key) {
- return this._iter.includes(key);
- };
- ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse);
- };
- ToSetSequence.prototype.__iterator = function(type, reverse) {
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- return new Iterator(function() {
- var step = iterator.next();
- return step.done ? step :
- iteratorValue(type, step.value, step.value, step);
- });
- };
- createClass(FromEntriesSequence, KeyedSeq);
- function FromEntriesSequence(entries) {
- this._iter = entries;
- this.size = entries.size;
- }
- FromEntriesSequence.prototype.entrySeq = function() {
- return this._iter.toSeq();
- };
- FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- return this._iter.__iterate(function(entry ) {
- // Check if entry exists first so array access doesn't throw for holes
- // in the parent iteration.
- if (entry) {
- validateEntry(entry);
- var indexedIterable = isIterable(entry);
- return fn(
- indexedIterable ? entry.get(1) : entry[1],
- indexedIterable ? entry.get(0) : entry[0],
- this$0
- );
- }
- }, reverse);
- };
- FromEntriesSequence.prototype.__iterator = function(type, reverse) {
- var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
- return new Iterator(function() {
- while (true) {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- // Check if entry exists first so array access doesn't throw for holes
- // in the parent iteration.
- if (entry) {
- validateEntry(entry);
- var indexedIterable = isIterable(entry);
- return iteratorValue(
- type,
- indexedIterable ? entry.get(0) : entry[0],
- indexedIterable ? entry.get(1) : entry[1],
- step
- );
- }
- }
- });
- };
- ToIndexedSequence.prototype.cacheResult =
- ToKeyedSequence.prototype.cacheResult =
- ToSetSequence.prototype.cacheResult =
- FromEntriesSequence.prototype.cacheResult =
- cacheResultThrough;
- function flipFactory(iterable) {
- var flipSequence = makeSequence(iterable);
- flipSequence._iter = iterable;
- flipSequence.size = iterable.size;
- flipSequence.flip = function() {return iterable};
- flipSequence.reverse = function () {
- var reversedSequence = iterable.reverse.apply(this); // super.reverse()
- reversedSequence.flip = function() {return iterable.reverse()};
- return reversedSequence;
- };
- flipSequence.has = function(key ) {return iterable.includes(key)};
- flipSequence.includes = function(key ) {return iterable.has(key)};
- flipSequence.cacheResult = cacheResultThrough;
- flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
- return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse);
- }
- flipSequence.__iteratorUncached = function(type, reverse) {
- if (type === ITERATE_ENTRIES) {
- var iterator = iterable.__iterator(type, reverse);
- return new Iterator(function() {
- var step = iterator.next();
- if (!step.done) {
- var k = step.value[0];
- step.value[0] = step.value[1];
- step.value[1] = k;
- }
- return step;
- });
- }
- return iterable.__iterator(
- type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES,
- reverse
- );
- }
- return flipSequence;
- }
- function mapFactory(iterable, mapper, context) {
- var mappedSequence = makeSequence(iterable);
- mappedSequence.size = iterable.size;
- mappedSequence.has = function(key ) {return iterable.has(key)};
- mappedSequence.get = function(key, notSetValue) {
- var v = iterable.get(key, NOT_SET);
- return v === NOT_SET ?
- notSetValue :
- mapper.call(context, v, key, iterable);
- };
- mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
- return iterable.__iterate(
- function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false},
- reverse
- );
- }
- mappedSequence.__iteratorUncached = function (type, reverse) {
- var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
- return new Iterator(function() {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- var key = entry[0];
- return iteratorValue(
- type,
- key,
- mapper.call(context, entry[1], key, iterable),
- step
- );
- });
- }
- return mappedSequence;
- }
- function reverseFactory(iterable, useKeys) {
- var reversedSequence = makeSequence(iterable);
- reversedSequence._iter = iterable;
- reversedSequence.size = iterable.size;
- reversedSequence.reverse = function() {return iterable};
- if (iterable.flip) {
- reversedSequence.flip = function () {
- var flipSequence = flipFactory(iterable);
- flipSequence.reverse = function() {return iterable.flip()};
- return flipSequence;
- };
- }
- reversedSequence.get = function(key, notSetValue)
- {return iterable.get(useKeys ? key : -1 - key, notSetValue)};
- reversedSequence.has = function(key )
- {return iterable.has(useKeys ? key : -1 - key)};
- reversedSequence.includes = function(value ) {return iterable.includes(value)};
- reversedSequence.cacheResult = cacheResultThrough;
- reversedSequence.__iterate = function (fn, reverse) {var this$0 = this;
- return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse);
- };
- reversedSequence.__iterator =
- function(type, reverse) {return iterable.__iterator(type, !reverse)};
- return reversedSequence;
- }
- function filterFactory(iterable, predicate, context, useKeys) {
- var filterSequence = makeSequence(iterable);
- if (useKeys) {
- filterSequence.has = function(key ) {
- var v = iterable.get(key, NOT_SET);
- return v !== NOT_SET && !!predicate.call(context, v, key, iterable);
- };
- filterSequence.get = function(key, notSetValue) {
- var v = iterable.get(key, NOT_SET);
- return v !== NOT_SET && predicate.call(context, v, key, iterable) ?
- v : notSetValue;
- };
- }
- filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
- var iterations = 0;
- iterable.__iterate(function(v, k, c) {
- if (predicate.call(context, v, k, c)) {
- iterations++;
- return fn(v, useKeys ? k : iterations - 1, this$0);
- }
- }, reverse);
- return iterations;
- };
- filterSequence.__iteratorUncached = function (type, reverse) {
- var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
- var iterations = 0;
- return new Iterator(function() {
- while (true) {
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- var key = entry[0];
- var value = entry[1];
- if (predicate.call(context, value, key, iterable)) {
- return iteratorValue(type, useKeys ? key : iterations++, value, step);
- }
- }
- });
- }
- return filterSequence;
- }
- function countByFactory(iterable, grouper, context) {
- var groups = Map().asMutable();
- iterable.__iterate(function(v, k) {
- groups.update(
- grouper.call(context, v, k, iterable),
- 0,
- function(a ) {return a + 1}
- );
- });
- return groups.asImmutable();
- }
- function groupByFactory(iterable, grouper, context) {
- var isKeyedIter = isKeyed(iterable);
- var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();
- iterable.__iterate(function(v, k) {
- groups.update(
- grouper.call(context, v, k, iterable),
- function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)}
- );
- });
- var coerce = iterableClass(iterable);
- return groups.map(function(arr ) {return reify(iterable, coerce(arr))});
- }
- function sliceFactory(iterable, begin, end, useKeys) {
- var originalSize = iterable.size;
- // Sanitize begin & end using this shorthand for ToInt32(argument)
- // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
- if (begin !== undefined) {
- begin = begin | 0;
- }
- if (end !== undefined) {
- if (end === Infinity) {
- end = originalSize;
- } else {
- end = end | 0;
- }
- }
- if (wholeSlice(begin, end, originalSize)) {
- return iterable;
- }
- var resolvedBegin = resolveBegin(begin, originalSize);
- var resolvedEnd = resolveEnd(end, originalSize);
- // begin or end will be NaN if they were provided as negative numbers and
- // this iterable's size is unknown. In that case, cache first so there is
- // a known size and these do not resolve to NaN.
- if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {
- return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);
- }
- // Note: resolvedEnd is undefined when the original sequence's length is
- // unknown and this slice did not supply an end and should contain all
- // elements after resolvedBegin.
- // In that case, resolvedSize will be NaN and sliceSize will remain undefined.
- var resolvedSize = resolvedEnd - resolvedBegin;
- var sliceSize;
- if (resolvedSize === resolvedSize) {
- sliceSize = resolvedSize < 0 ? 0 : resolvedSize;
- }
- var sliceSeq = makeSequence(iterable);
- // If iterable.size is undefined, the size of the realized sliceSeq is
- // unknown at this point unless the number of items to slice is 0
- sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined;
- if (!useKeys && isSeq(iterable) && sliceSize >= 0) {
- sliceSeq.get = function (index, notSetValue) {
- index = wrapIndex(this, index);
- return index >= 0 && index < sliceSize ?
- iterable.get(index + resolvedBegin, notSetValue) :
- notSetValue;
- }
- }
- sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this;
- if (sliceSize === 0) {
- return 0;
- }
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var skipped = 0;
- var isSkipping = true;
- var iterations = 0;
- iterable.__iterate(function(v, k) {
- if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {
- iterations++;
- return fn(v, useKeys ? k : iterations - 1, this$0) !== false &&
- iterations !== sliceSize;
- }
- });
- return iterations;
- };
- sliceSeq.__iteratorUncached = function(type, reverse) {
- if (sliceSize !== 0 && reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- // Don't bother instantiating parent iterator if taking 0.
- var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse);
- var skipped = 0;
- var iterations = 0;
- return new Iterator(function() {
- while (skipped++ < resolvedBegin) {
- iterator.next();
- }
- if (++iterations > sliceSize) {
- return iteratorDone();
- }
- var step = iterator.next();
- if (useKeys || type === ITERATE_VALUES) {
- return step;
- } else if (type === ITERATE_KEYS) {
- return iteratorValue(type, iterations - 1, undefined, step);
- } else {
- return iteratorValue(type, iterations - 1, step.value[1], step);
- }
- });
- }
- return sliceSeq;
- }
- function takeWhileFactory(iterable, predicate, context) {
- var takeSequence = makeSequence(iterable);
- takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var iterations = 0;
- iterable.__iterate(function(v, k, c)
- {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)}
- );
- return iterations;
- };
- takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
- var iterating = true;
- return new Iterator(function() {
- if (!iterating) {
- return iteratorDone();
- }
- var step = iterator.next();
- if (step.done) {
- return step;
- }
- var entry = step.value;
- var k = entry[0];
- var v = entry[1];
- if (!predicate.call(context, v, k, this$0)) {
- iterating = false;
- return iteratorDone();
- }
- return type === ITERATE_ENTRIES ? step :
- iteratorValue(type, k, v, step);
- });
- };
- return takeSequence;
- }
- function skipWhileFactory(iterable, predicate, context, useKeys) {
- var skipSequence = makeSequence(iterable);
- skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
- if (reverse) {
- return this.cacheResult().__iterate(fn, reverse);
- }
- var isSkipping = true;
- var iterations = 0;
- iterable.__iterate(function(v, k, c) {
- if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {
- iterations++;
- return fn(v, useKeys ? k : iterations - 1, this$0);
- }
- });
- return iterations;
- };
- skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
- if (reverse) {
- return this.cacheResult().__iterator(type, reverse);
- }
- var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
- var skipping = true;
- var iterations = 0;
- return new Iterator(function() {
- var step, k, v;
- do {
- step = iterator.next();
- if (step.done) {
- if (useKeys || type === ITERATE_VALUES) {
- return step;
- } else if (type === ITERATE_KEYS) {
- return iteratorValue(type, iterations++, undefined, step);
- } else {
- return iteratorValue(type, iterations++, step.value[1], step);
- }
- }
- var entry = step.value;
- k = entry[0];
- v = entry[1];
- skipping && (skipping = predicate.call(context, v, k, this$0));
- } while (skipping);
- return type === ITERATE_ENTRIES ? step :
- iteratorValue(type, k, v, step);
- });
- };
- return skipSequence;
- }
- function concatFactory(iterable, values) {
- var isKeyedIterable = isKeyed(iterable);
- var iters = [iterable].concat(values).map(function(v ) {
- if (!isIterable(v)) {
- v = isKeyedIterable ?
- keyedSeqFromValue(v) :
- indexedSeqFromValue(Array.isArray(v) ? v : [v]);
- } else if (isKeyedIterable) {
- v = KeyedIterable(v);
- }
- return v;
- }).filter(function(v ) {return v.size !== 0});
- if (iters.length === 0) {
- return iterable;
- }
- if (iters.length === 1) {
- var singleton = iters[0];
- if (singleton === iterable ||
- isKeyedIterable && isKeyed(singleton) ||
- isIndexed(iterable) && isIndexed(singleton)) {
- return singleton;
- }
- }
- var concatSeq = new ArraySeq(iters);
- if (isKeyedIterable) {
- concatSeq = concatSeq.toKeyedSeq();
- } else if (!isIndexed(iterable)) {
- concatSeq = concatSeq.toSetSeq();
- }
- concatSeq = concatSeq.flatten(true);
- concatSeq.size = iters.reduce(
- function(sum, seq) {
- if (sum !== undefined) {
- var size = seq.size;
- if (size !== undefined) {
- return sum + size;
- }
- }
- },
- 0
- );
- return concatSeq;
- }
- function flattenFactory(iterable, depth, useKeys) {
- var flatSequence = makeSequence(iterable);
- flatSequence.__iterateUncached = function(fn, reverse) {
- var iterations = 0;
- var stopped = false;
- function flatDeep(iter, currentDepth) {var this$0 = this;
- iter.__iterate(function(v, k) {
- if ((!depth || currentDepth < depth) && isIterable(v)) {
- flatDeep(v, currentDepth + 1);
- } else if (fn(v, useKeys ? k : iterations++, this$0) === false) {
- stopped = true;
- }
- return !stopped;
- }, reverse);
- }
- flatDeep(iterable, 0);
- return iterations;
- }
- flatSequence.__iteratorUncached = function(type, reverse) {
- var iterator = iterable.__iterator(type, reverse);
- var stack = [];
- var iterations = 0;
- return new Iterator(function() {
- while (iterator) {
- var step = iterator.next();
- if (step.done !== false) {
- iterator = stack.pop();
- continue;
- }
- var v = step.value;
- if (type === ITERATE_ENTRIES) {
- v = v[1];
- }
- if ((!depth || stack.length < depth) && isIterable(v)) {
- stack.push(iterator);
- iterator = v.__iterator(type, reverse);
- } else {
- return useKeys ? step : iteratorValue(type, iterations++, v, step);
- }
- }
- return iteratorDone();
- });
- }
- return flatSequence;
- }
- function flatMapFactory(iterable, mapper, context) {
- var coerce = iterableClass(iterable);
- return iterable.toSeq().map(
- function(v, k) {return coerce(mapper.call(context, v, k, iterable))}
- ).flatten(true);
- }
- function interposeFactory(iterable, separator) {
- var interposedSequence = makeSequence(iterable);
- interposedSequence.size = iterable.size && iterable.size * 2 -1;
- interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
- var iterations = 0;
- iterable.__iterate(function(v, k)
- {return (!iterations || fn(separator, iterations++, this$0) !== false) &&
- fn(v, iterations++, this$0) !== false},
- reverse
- );
- return iterations;
- };
- interposedSequence.__iteratorUncached = function(type, reverse) {
- var iterator = iterable.__iterator(ITERATE_VALUES, reverse);
- var iterations = 0;
- var step;
- return new Iterator(function() {
- if (!step || iterations % 2) {
- step = iterator.next();
- if (step.done) {
- return step;
- }
- }
- return iterations % 2 ?
- iteratorValue(type, iterations++, separator) :
- iteratorValue(type, iterations++, step.value, step);
- });
- };
- return interposedSequence;
- }
- function sortFactory(iterable, comparator, mapper) {
- if (!comparator) {
- comparator = defaultComparator;
- }
- var isKeyedIterable = isKeyed(iterable);
- var index = 0;
- var entries = iterable.toSeq().map(
- function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]}
- ).toArray();
- entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach(
- isKeyedIterable ?
- function(v, i) { entries[i].length = 2; } :
- function(v, i) { entries[i] = v[1]; }
- );
- return isKeyedIterable ? KeyedSeq(entries) :
- isIndexed(iterable) ? IndexedSeq(entries) :
- SetSeq(entries);
- }
- function maxFactory(iterable, comparator, mapper) {
- if (!comparator) {
- comparator = defaultComparator;
- }
- if (mapper) {
- var entry = iterable.toSeq()
- .map(function(v, k) {return [v, mapper(v, k, iterable)]})
- .reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a});
- return entry && entry[0];
- } else {
- return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a});
- }
- }
- function maxCompare(comparator, a, b) {
- var comp = comparator(b, a);
- // b is considered the new max if the comparator declares them equal, but
- // they are not equal and b is in fact a nullish value.
- return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0;
- }
- function zipWithFactory(keyIter, zipper, iters) {
- var zipSequence = makeSequence(keyIter);
- zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min();
- // Note: this a generic base implementation of __iterate in terms of
- // __iterator which may be more generically useful in the future.
- zipSequence.__iterate = function(fn, reverse) {
- /* generic:
- var iterator = this.__iterator(ITERATE_ENTRIES, reverse);
- var step;
- var iterations = 0;
- while (!(step = iterator.next()).done) {
- iterations++;
- if (fn(step.value[1], step.value[0], this) === false) {
- break;
- }
- }
- return iterations;
- */
- // indexed:
- var iterator = this.__iterator(ITERATE_VALUES, reverse);
- var step;
- var iterations = 0;
- while (!(step = iterator.next()).done) {
- if (fn(step.value, iterations++, this) === false) {
- break;
- }
- }
- return iterations;
- };
- zipSequence.__iteratorUncached = function(type, reverse) {
- var iterators = iters.map(function(i )
- {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))}
- );
- var iterations = 0;
- var isDone = false;
- return new Iterator(function() {
- var steps;
- if (!isDone) {
- steps = iterators.map(function(i ) {return i.next()});
- isDone = steps.some(function(s ) {return s.done});
- }
- if (isDone) {
- return iteratorDone();
- }
- return iteratorValue(
- type,
- iterations++,
- zipper.apply(null, steps.map(function(s ) {return s.value}))
- );
- });
- };
- return zipSequence
- }
- // #pragma Helper Functions
- function reify(iter, seq) {
- return isSeq(iter) ? seq : iter.constructor(seq);
- }
- function validateEntry(entry) {
- if (entry !== Object(entry)) {
- throw new TypeError('Expected [K, V] tuple: ' + entry);
- }
- }
- function resolveSize(iter) {
- assertNotInfinite(iter.size);
- return ensureSize(iter);
- }
- function iterableClass(iterable) {
- return isKeyed(iterable) ? KeyedIterable :
- isIndexed(iterable) ? IndexedIterable :
- SetIterable;
- }
- function makeSequence(iterable) {
- return Object.create(
- (
- isKeyed(iterable) ? KeyedSeq :
- isIndexed(iterable) ? IndexedSeq :
- SetSeq
- ).prototype
- );
- }
- function cacheResultThrough() {
- if (this._iter.cacheResult) {
- this._iter.cacheResult();
- this.size = this._iter.size;
- return this;
- } else {
- return Seq.prototype.cacheResult.call(this);
- }
- }
- function defaultComparator(a, b) {
- return a > b ? 1 : a < b ? -1 : 0;
- }
- function forceIterator(keyPath) {
- var iter = getIterator(keyPath);
- if (!iter) {
- // Array might not be iterable in this environment, so we need a fallback
- // to our wrapped type.
- if (!isArrayLike(keyPath)) {
- throw new TypeError('Expected iterable or array-like: ' + keyPath);
- }
- iter = getIterator(Iterable(keyPath));
- }
- return iter;
- }
- createClass(Record, KeyedCollection);
- function Record(defaultValues, name) {
- var hasInitialized;
- var RecordType = function Record(values) {
- if (values instanceof RecordType) {
- return values;
- }
- if (!(this instanceof RecordType)) {
- return new RecordType(values);
- }
- if (!hasInitialized) {
- hasInitialized = true;
- var keys = Object.keys(defaultValues);
- setProps(RecordTypePrototype, keys);
- RecordTypePrototype.size = keys.length;
- RecordTypePrototype._name = name;
- RecordTypePrototype._keys = keys;
- RecordTypePrototype._defaultValues = defaultValues;
- }
- this._map = Map(values);
- };
- var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);
- RecordTypePrototype.constructor = RecordType;
- return RecordType;
- }
- Record.prototype.toString = function() {
- return this.__toString(recordName(this) + ' {', '}');
- };
- // @pragma Access
- Record.prototype.has = function(k) {
- return this._defaultValues.hasOwnProperty(k);
- };
- Record.prototype.get = function(k, notSetValue) {
- if (!this.has(k)) {
- return notSetValue;
- }
- var defaultVal = this._defaultValues[k];
- return this._map ? this._map.get(k, defaultVal) : defaultVal;
- };
- // @pragma Modification
- Record.prototype.clear = function() {
- if (this.__ownerID) {
- this._map && this._map.clear();
- return this;
- }
- var RecordType = this.constructor;
- return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));
- };
- Record.prototype.set = function(k, v) {
- if (!this.has(k)) {
- throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this));
- }
- if (this._map && !this._map.has(k)) {
- var defaultVal = this._defaultValues[k];
- if (v === defaultVal) {
- return this;
- }
- }
- var newMap = this._map && this._map.set(k, v);
- if (this.__ownerID || newMap === this._map) {
- return this;
- }
- return makeRecord(this, newMap);
- };
- Record.prototype.remove = function(k) {
- if (!this.has(k)) {
- return this;
- }
- var newMap = this._map && this._map.remove(k);
- if (this.__ownerID || newMap === this._map) {
- return this;
- }
- return makeRecord(this, newMap);
- };
- Record.prototype.wasAltered = function() {
- return this._map.wasAltered();
- };
- Record.prototype.__iterator = function(type, reverse) {var this$0 = this;
- return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse);
- };
- Record.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse);
- };
- Record.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- var newMap = this._map && this._map.__ensureOwner(ownerID);
- if (!ownerID) {
- this.__ownerID = ownerID;
- this._map = newMap;
- return this;
- }
- return makeRecord(this, newMap, ownerID);
- };
- var RecordPrototype = Record.prototype;
- RecordPrototype[DELETE] = RecordPrototype.remove;
- RecordPrototype.deleteIn =
- RecordPrototype.removeIn = MapPrototype.removeIn;
- RecordPrototype.merge = MapPrototype.merge;
- RecordPrototype.mergeWith = MapPrototype.mergeWith;
- RecordPrototype.mergeIn = MapPrototype.mergeIn;
- RecordPrototype.mergeDeep = MapPrototype.mergeDeep;
- RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;
- RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
- RecordPrototype.setIn = MapPrototype.setIn;
- RecordPrototype.update = MapPrototype.update;
- RecordPrototype.updateIn = MapPrototype.updateIn;
- RecordPrototype.withMutations = MapPrototype.withMutations;
- RecordPrototype.asMutable = MapPrototype.asMutable;
- RecordPrototype.asImmutable = MapPrototype.asImmutable;
- function makeRecord(likeRecord, map, ownerID) {
- var record = Object.create(Object.getPrototypeOf(likeRecord));
- record._map = map;
- record.__ownerID = ownerID;
- return record;
- }
- function recordName(record) {
- return record._name || record.constructor.name || 'Record';
- }
- function setProps(prototype, names) {
- try {
- names.forEach(setProp.bind(undefined, prototype));
- } catch (error) {
- // Object.defineProperty failed. Probably IE8.
- }
- }
- function setProp(prototype, name) {
- Object.defineProperty(prototype, name, {
- get: function() {
- return this.get(name);
- },
- set: function(value) {
- invariant(this.__ownerID, 'Cannot set on an immutable record.');
- this.set(name, value);
- }
- });
- }
- createClass(Set, SetCollection);
- // @pragma Construction
- function Set(value) {
- return value === null || value === undefined ? emptySet() :
- isSet(value) && !isOrdered(value) ? value :
- emptySet().withMutations(function(set ) {
- var iter = SetIterable(value);
- assertNotInfinite(iter.size);
- iter.forEach(function(v ) {return set.add(v)});
- });
- }
- Set.of = function(/*...values*/) {
- return this(arguments);
- };
- Set.fromKeys = function(value) {
- return this(KeyedIterable(value).keySeq());
- };
- Set.prototype.toString = function() {
- return this.__toString('Set {', '}');
- };
- // @pragma Access
- Set.prototype.has = function(value) {
- return this._map.has(value);
- };
- // @pragma Modification
- Set.prototype.add = function(value) {
- return updateSet(this, this._map.set(value, true));
- };
- Set.prototype.remove = function(value) {
- return updateSet(this, this._map.remove(value));
- };
- Set.prototype.clear = function() {
- return updateSet(this, this._map.clear());
- };
- // @pragma Composition
- Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0);
- iters = iters.filter(function(x ) {return x.size !== 0});
- if (iters.length === 0) {
- return this;
- }
- if (this.size === 0 && !this.__ownerID && iters.length === 1) {
- return this.constructor(iters[0]);
- }
- return this.withMutations(function(set ) {
- for (var ii = 0; ii < iters.length; ii++) {
- SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)});
- }
- });
- };
- Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0);
- if (iters.length === 0) {
- return this;
- }
- iters = iters.map(function(iter ) {return SetIterable(iter)});
- var originalSet = this;
- return this.withMutations(function(set ) {
- originalSet.forEach(function(value ) {
- if (!iters.every(function(iter ) {return iter.includes(value)})) {
- set.remove(value);
- }
- });
- });
- };
- Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0);
- if (iters.length === 0) {
- return this;
- }
- iters = iters.map(function(iter ) {return SetIterable(iter)});
- var originalSet = this;
- return this.withMutations(function(set ) {
- originalSet.forEach(function(value ) {
- if (iters.some(function(iter ) {return iter.includes(value)})) {
- set.remove(value);
- }
- });
- });
- };
- Set.prototype.merge = function() {
- return this.union.apply(this, arguments);
- };
- Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
- return this.union.apply(this, iters);
- };
- Set.prototype.sort = function(comparator) {
- // Late binding
- return OrderedSet(sortFactory(this, comparator));
- };
- Set.prototype.sortBy = function(mapper, comparator) {
- // Late binding
- return OrderedSet(sortFactory(this, comparator, mapper));
- };
- Set.prototype.wasAltered = function() {
- return this._map.wasAltered();
- };
- Set.prototype.__iterate = function(fn, reverse) {var this$0 = this;
- return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse);
- };
- Set.prototype.__iterator = function(type, reverse) {
- return this._map.map(function(_, k) {return k}).__iterator(type, reverse);
- };
- Set.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- var newMap = this._map.__ensureOwner(ownerID);
- if (!ownerID) {
- this.__ownerID = ownerID;
- this._map = newMap;
- return this;
- }
- return this.__make(newMap, ownerID);
- };
- function isSet(maybeSet) {
- return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);
- }
- Set.isSet = isSet;
- var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
- var SetPrototype = Set.prototype;
- SetPrototype[IS_SET_SENTINEL] = true;
- SetPrototype[DELETE] = SetPrototype.remove;
- SetPrototype.mergeDeep = SetPrototype.merge;
- SetPrototype.mergeDeepWith = SetPrototype.mergeWith;
- SetPrototype.withMutations = MapPrototype.withMutations;
- SetPrototype.asMutable = MapPrototype.asMutable;
- SetPrototype.asImmutable = MapPrototype.asImmutable;
- SetPrototype.__empty = emptySet;
- SetPrototype.__make = makeSet;
- function updateSet(set, newMap) {
- if (set.__ownerID) {
- set.size = newMap.size;
- set._map = newMap;
- return set;
- }
- return newMap === set._map ? set :
- newMap.size === 0 ? set.__empty() :
- set.__make(newMap);
- }
- function makeSet(map, ownerID) {
- var set = Object.create(SetPrototype);
- set.size = map ? map.size : 0;
- set._map = map;
- set.__ownerID = ownerID;
- return set;
- }
- var EMPTY_SET;
- function emptySet() {
- return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));
- }
- createClass(OrderedSet, Set);
- // @pragma Construction
- function OrderedSet(value) {
- return value === null || value === undefined ? emptyOrderedSet() :
- isOrderedSet(value) ? value :
- emptyOrderedSet().withMutations(function(set ) {
- var iter = SetIterable(value);
- assertNotInfinite(iter.size);
- iter.forEach(function(v ) {return set.add(v)});
- });
- }
- OrderedSet.of = function(/*...values*/) {
- return this(arguments);
- };
- OrderedSet.fromKeys = function(value) {
- return this(KeyedIterable(value).keySeq());
- };
- OrderedSet.prototype.toString = function() {
- return this.__toString('OrderedSet {', '}');
- };
- function isOrderedSet(maybeOrderedSet) {
- return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);
- }
- OrderedSet.isOrderedSet = isOrderedSet;
- var OrderedSetPrototype = OrderedSet.prototype;
- OrderedSetPrototype[IS_ORDERED_SENTINEL] = true;
- OrderedSetPrototype.__empty = emptyOrderedSet;
- OrderedSetPrototype.__make = makeOrderedSet;
- function makeOrderedSet(map, ownerID) {
- var set = Object.create(OrderedSetPrototype);
- set.size = map ? map.size : 0;
- set._map = map;
- set.__ownerID = ownerID;
- return set;
- }
- var EMPTY_ORDERED_SET;
- function emptyOrderedSet() {
- return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));
- }
- createClass(Stack, IndexedCollection);
- // @pragma Construction
- function Stack(value) {
- return value === null || value === undefined ? emptyStack() :
- isStack(value) ? value :
- emptyStack().unshiftAll(value);
- }
- Stack.of = function(/*...values*/) {
- return this(arguments);
- };
- Stack.prototype.toString = function() {
- return this.__toString('Stack [', ']');
- };
- // @pragma Access
- Stack.prototype.get = function(index, notSetValue) {
- var head = this._head;
- index = wrapIndex(this, index);
- while (head && index--) {
- head = head.next;
- }
- return head ? head.value : notSetValue;
- };
- Stack.prototype.peek = function() {
- return this._head && this._head.value;
- };
- // @pragma Modification
- Stack.prototype.push = function(/*...values*/) {
- if (arguments.length === 0) {
- return this;
- }
- var newSize = this.size + arguments.length;
- var head = this._head;
- for (var ii = arguments.length - 1; ii >= 0; ii--) {
- head = {
- value: arguments[ii],
- next: head
- };
- }
- if (this.__ownerID) {
- this.size = newSize;
- this._head = head;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return makeStack(newSize, head);
- };
- Stack.prototype.pushAll = function(iter) {
- iter = IndexedIterable(iter);
- if (iter.size === 0) {
- return this;
- }
- assertNotInfinite(iter.size);
- var newSize = this.size;
- var head = this._head;
- iter.reverse().forEach(function(value ) {
- newSize++;
- head = {
- value: value,
- next: head
- };
- });
- if (this.__ownerID) {
- this.size = newSize;
- this._head = head;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return makeStack(newSize, head);
- };
- Stack.prototype.pop = function() {
- return this.slice(1);
- };
- Stack.prototype.unshift = function(/*...values*/) {
- return this.push.apply(this, arguments);
- };
- Stack.prototype.unshiftAll = function(iter) {
- return this.pushAll(iter);
- };
- Stack.prototype.shift = function() {
- return this.pop.apply(this, arguments);
- };
- Stack.prototype.clear = function() {
- if (this.size === 0) {
- return this;
- }
- if (this.__ownerID) {
- this.size = 0;
- this._head = undefined;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return emptyStack();
- };
- Stack.prototype.slice = function(begin, end) {
- if (wholeSlice(begin, end, this.size)) {
- return this;
- }
- var resolvedBegin = resolveBegin(begin, this.size);
- var resolvedEnd = resolveEnd(end, this.size);
- if (resolvedEnd !== this.size) {
- // super.slice(begin, end);
- return IndexedCollection.prototype.slice.call(this, begin, end);
- }
- var newSize = this.size - resolvedBegin;
- var head = this._head;
- while (resolvedBegin--) {
- head = head.next;
- }
- if (this.__ownerID) {
- this.size = newSize;
- this._head = head;
- this.__hash = undefined;
- this.__altered = true;
- return this;
- }
- return makeStack(newSize, head);
- };
- // @pragma Mutability
- Stack.prototype.__ensureOwner = function(ownerID) {
- if (ownerID === this.__ownerID) {
- return this;
- }
- if (!ownerID) {
- this.__ownerID = ownerID;
- this.__altered = false;
- return this;
- }
- return makeStack(this.size, this._head, ownerID, this.__hash);
- };
- // @pragma Iteration
- Stack.prototype.__iterate = function(fn, reverse) {
- if (reverse) {
- return this.reverse().__iterate(fn);
- }
- var iterations = 0;
- var node = this._head;
- while (node) {
- if (fn(node.value, iterations++, this) === false) {
- break;
- }
- node = node.next;
- }
- return iterations;
- };
- Stack.prototype.__iterator = function(type, reverse) {
- if (reverse) {
- return this.reverse().__iterator(type);
- }
- var iterations = 0;
- var node = this._head;
- return new Iterator(function() {
- if (node) {
- var value = node.value;
- node = node.next;
- return iteratorValue(type, iterations++, value);
- }
- return iteratorDone();
- });
- };
- function isStack(maybeStack) {
- return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);
- }
- Stack.isStack = isStack;
- var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
- var StackPrototype = Stack.prototype;
- StackPrototype[IS_STACK_SENTINEL] = true;
- StackPrototype.withMutations = MapPrototype.withMutations;
- StackPrototype.asMutable = MapPrototype.asMutable;
- StackPrototype.asImmutable = MapPrototype.asImmutable;
- StackPrototype.wasAltered = MapPrototype.wasAltered;
- function makeStack(size, head, ownerID, hash) {
- var map = Object.create(StackPrototype);
- map.size = size;
- map._head = head;
- map.__ownerID = ownerID;
- map.__hash = hash;
- map.__altered = false;
- return map;
- }
- var EMPTY_STACK;
- function emptyStack() {
- return EMPTY_STACK || (EMPTY_STACK = makeStack(0));
- }
- /**
- * Contributes additional methods to a constructor
- */
- function mixin(ctor, methods) {
- var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; };
- Object.keys(methods).forEach(keyCopier);
- Object.getOwnPropertySymbols &&
- Object.getOwnPropertySymbols(methods).forEach(keyCopier);
- return ctor;
- }
- Iterable.Iterator = Iterator;
- mixin(Iterable, {
- // ### Conversion to other types
- toArray: function() {
- assertNotInfinite(this.size);
- var array = new Array(this.size || 0);
- this.valueSeq().__iterate(function(v, i) { array[i] = v; });
- return array;
- },
- toIndexedSeq: function() {
- return new ToIndexedSequence(this);
- },
- toJS: function() {
- return this.toSeq().map(
- function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value}
- ).__toJS();
- },
- toJSON: function() {
- return this.toSeq().map(
- function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value}
- ).__toJS();
- },
- toKeyedSeq: function() {
- return new ToKeyedSequence(this, true);
- },
- toMap: function() {
- // Use Late Binding here to solve the circular dependency.
- return Map(this.toKeyedSeq());
- },
- toObject: function() {
- assertNotInfinite(this.size);
- var object = {};
- this.__iterate(function(v, k) { object[k] = v; });
- return object;
- },
- toOrderedMap: function() {
- // Use Late Binding here to solve the circular dependency.
- return OrderedMap(this.toKeyedSeq());
- },
- toOrderedSet: function() {
- // Use Late Binding here to solve the circular dependency.
- return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
- },
- toSet: function() {
- // Use Late Binding here to solve the circular dependency.
- return Set(isKeyed(this) ? this.valueSeq() : this);
- },
- toSetSeq: function() {
- return new ToSetSequence(this);
- },
- toSeq: function() {
- return isIndexed(this) ? this.toIndexedSeq() :
- isKeyed(this) ? this.toKeyedSeq() :
- this.toSetSeq();
- },
- toStack: function() {
- // Use Late Binding here to solve the circular dependency.
- return Stack(isKeyed(this) ? this.valueSeq() : this);
- },
- toList: function() {
- // Use Late Binding here to solve the circular dependency.
- return List(isKeyed(this) ? this.valueSeq() : this);
- },
- // ### Common JavaScript methods and properties
- toString: function() {
- return '[Iterable]';
- },
- __toString: function(head, tail) {
- if (this.size === 0) {
- return head + tail;
- }
- return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;
- },
- // ### ES6 Collection methods (ES6 Array and Map)
- concat: function() {var values = SLICE$0.call(arguments, 0);
- return reify(this, concatFactory(this, values));
- },
- includes: function(searchValue) {
- return this.some(function(value ) {return is(value, searchValue)});
- },
- entries: function() {
- return this.__iterator(ITERATE_ENTRIES);
- },
- every: function(predicate, context) {
- assertNotInfinite(this.size);
- var returnValue = true;
- this.__iterate(function(v, k, c) {
- if (!predicate.call(context, v, k, c)) {
- returnValue = false;
- return false;
- }
- });
- return returnValue;
- },
- filter: function(predicate, context) {
- return reify(this, filterFactory(this, predicate, context, true));
- },
- find: function(predicate, context, notSetValue) {
- var entry = this.findEntry(predicate, context);
- return entry ? entry[1] : notSetValue;
- },
- forEach: function(sideEffect, context) {
- assertNotInfinite(this.size);
- return this.__iterate(context ? sideEffect.bind(context) : sideEffect);
- },
- join: function(separator) {
- assertNotInfinite(this.size);
- separator = separator !== undefined ? '' + separator : ',';
- var joined = '';
- var isFirst = true;
- this.__iterate(function(v ) {
- isFirst ? (isFirst = false) : (joined += separator);
- joined += v !== null && v !== undefined ? v.toString() : '';
- });
- return joined;
- },
- keys: function() {
- return this.__iterator(ITERATE_KEYS);
- },
- map: function(mapper, context) {
- return reify(this, mapFactory(this, mapper, context));
- },
- reduce: function(reducer, initialReduction, context) {
- assertNotInfinite(this.size);
- var reduction;
- var useFirst;
- if (arguments.length < 2) {
- useFirst = true;
- } else {
- reduction = initialReduction;
- }
- this.__iterate(function(v, k, c) {
- if (useFirst) {
- useFirst = false;
- reduction = v;
- } else {
- reduction = reducer.call(context, reduction, v, k, c);
- }
- });
- return reduction;
- },
- reduceRight: function(reducer, initialReduction, context) {
- var reversed = this.toKeyedSeq().reverse();
- return reversed.reduce.apply(reversed, arguments);
- },
- reverse: function() {
- return reify(this, reverseFactory(this, true));
- },
- slice: function(begin, end) {
- return reify(this, sliceFactory(this, begin, end, true));
- },
- some: function(predicate, context) {
- return !this.every(not(predicate), context);
- },
- sort: function(comparator) {
- return reify(this, sortFactory(this, comparator));
- },
- values: function() {
- return this.__iterator(ITERATE_VALUES);
- },
- // ### More sequential methods
- butLast: function() {
- return this.slice(0, -1);
- },
- isEmpty: function() {
- return this.size !== undefined ? this.size === 0 : !this.some(function() {return true});
- },
- count: function(predicate, context) {
- return ensureSize(
- predicate ? this.toSeq().filter(predicate, context) : this
- );
- },
- countBy: function(grouper, context) {
- return countByFactory(this, grouper, context);
- },
- equals: function(other) {
- return deepEqual(this, other);
- },
- entrySeq: function() {
- var iterable = this;
- if (iterable._cache) {
- // We cache as an entries array, so we can just return the cache!
- return new ArraySeq(iterable._cache);
- }
- var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();
- entriesSequence.fromEntrySeq = function() {return iterable.toSeq()};
- return entriesSequence;
- },
- filterNot: function(predicate, context) {
- return this.filter(not(predicate), context);
- },
- findEntry: function(predicate, context, notSetValue) {
- var found = notSetValue;
- this.__iterate(function(v, k, c) {
- if (predicate.call(context, v, k, c)) {
- found = [k, v];
- return false;
- }
- });
- return found;
- },
- findKey: function(predicate, context) {
- var entry = this.findEntry(predicate, context);
- return entry && entry[0];
- },
- findLast: function(predicate, context, notSetValue) {
- return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
- },
- findLastEntry: function(predicate, context, notSetValue) {
- return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue);
- },
- findLastKey: function(predicate, context) {
- return this.toKeyedSeq().reverse().findKey(predicate, context);
- },
- first: function() {
- return this.find(returnTrue);
- },
- flatMap: function(mapper, context) {
- return reify(this, flatMapFactory(this, mapper, context));
- },
- flatten: function(depth) {
- return reify(this, flattenFactory(this, depth, true));
- },
- fromEntrySeq: function() {
- return new FromEntriesSequence(this);
- },
- get: function(searchKey, notSetValue) {
- return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue);
- },
- getIn: function(searchKeyPath, notSetValue) {
- var nested = this;
- // Note: in an ES6 environment, we would prefer:
- // for (var key of searchKeyPath) {
- var iter = forceIterator(searchKeyPath);
- var step;
- while (!(step = iter.next()).done) {
- var key = step.value;
- nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;
- if (nested === NOT_SET) {
- return notSetValue;
- }
- }
- return nested;
- },
- groupBy: function(grouper, context) {
- return groupByFactory(this, grouper, context);
- },
- has: function(searchKey) {
- return this.get(searchKey, NOT_SET) !== NOT_SET;
- },
- hasIn: function(searchKeyPath) {
- return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;
- },
- isSubset: function(iter) {
- iter = typeof iter.includes === 'function' ? iter : Iterable(iter);
- return this.every(function(value ) {return iter.includes(value)});
- },
- isSuperset: function(iter) {
- iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter);
- return iter.isSubset(this);
- },
- keyOf: function(searchValue) {
- return this.findKey(function(value ) {return is(value, searchValue)});
- },
- keySeq: function() {
- return this.toSeq().map(keyMapper).toIndexedSeq();
- },
- last: function() {
- return this.toSeq().reverse().first();
- },
- lastKeyOf: function(searchValue) {
- return this.toKeyedSeq().reverse().keyOf(searchValue);
- },
- max: function(comparator) {
- return maxFactory(this, comparator);
- },
- maxBy: function(mapper, comparator) {
- return maxFactory(this, comparator, mapper);
- },
- min: function(comparator) {
- return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);
- },
- minBy: function(mapper, comparator) {
- return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);
- },
- rest: function() {
- return this.slice(1);
- },
- skip: function(amount) {
- return this.slice(Math.max(0, amount));
- },
- skipLast: function(amount) {
- return reify(this, this.toSeq().reverse().skip(amount).reverse());
- },
- skipWhile: function(predicate, context) {
- return reify(this, skipWhileFactory(this, predicate, context, true));
- },
- skipUntil: function(predicate, context) {
- return this.skipWhile(not(predicate), context);
- },
- sortBy: function(mapper, comparator) {
- return reify(this, sortFactory(this, comparator, mapper));
- },
- take: function(amount) {
- return this.slice(0, Math.max(0, amount));
- },
- takeLast: function(amount) {
- return reify(this, this.toSeq().reverse().take(amount).reverse());
- },
- takeWhile: function(predicate, context) {
- return reify(this, takeWhileFactory(this, predicate, context));
- },
- takeUntil: function(predicate, context) {
- return this.takeWhile(not(predicate), context);
- },
- valueSeq: function() {
- return this.toIndexedSeq();
- },
- // ### Hashable Object
- hashCode: function() {
- return this.__hash || (this.__hash = hashIterable(this));
- }
- // ### Internal
- // abstract __iterate(fn, reverse)
- // abstract __iterator(type, reverse)
- });
- // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
- // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
- // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
- // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
- var IterablePrototype = Iterable.prototype;
- IterablePrototype[IS_ITERABLE_SENTINEL] = true;
- IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;
- IterablePrototype.__toJS = IterablePrototype.toArray;
- IterablePrototype.__toStringMapper = quoteString;
- IterablePrototype.inspect =
- IterablePrototype.toSource = function() { return this.toString(); };
- IterablePrototype.chain = IterablePrototype.flatMap;
- IterablePrototype.contains = IterablePrototype.includes;
- mixin(KeyedIterable, {
- // ### More sequential methods
- flip: function() {
- return reify(this, flipFactory(this));
- },
- mapEntries: function(mapper, context) {var this$0 = this;
- var iterations = 0;
- return reify(this,
- this.toSeq().map(
- function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)}
- ).fromEntrySeq()
- );
- },
- mapKeys: function(mapper, context) {var this$0 = this;
- return reify(this,
- this.toSeq().flip().map(
- function(k, v) {return mapper.call(context, k, v, this$0)}
- ).flip()
- );
- }
- });
- var KeyedIterablePrototype = KeyedIterable.prototype;
- KeyedIterablePrototype[IS_KEYED_SENTINEL] = true;
- KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;
- KeyedIterablePrototype.__toJS = IterablePrototype.toObject;
- KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)};
- mixin(IndexedIterable, {
- // ### Conversion to other types
- toKeyedSeq: function() {
- return new ToKeyedSequence(this, false);
- },
- // ### ES6 Collection methods (ES6 Array and Map)
- filter: function(predicate, context) {
- return reify(this, filterFactory(this, predicate, context, false));
- },
- findIndex: function(predicate, context) {
- var entry = this.findEntry(predicate, context);
- return entry ? entry[0] : -1;
- },
- indexOf: function(searchValue) {
- var key = this.keyOf(searchValue);
- return key === undefined ? -1 : key;
- },
- lastIndexOf: function(searchValue) {
- var key = this.lastKeyOf(searchValue);
- return key === undefined ? -1 : key;
- },
- reverse: function() {
- return reify(this, reverseFactory(this, false));
- },
- slice: function(begin, end) {
- return reify(this, sliceFactory(this, begin, end, false));
- },
- splice: function(index, removeNum /*, ...values*/) {
- var numArgs = arguments.length;
- removeNum = Math.max(removeNum | 0, 0);
- if (numArgs === 0 || (numArgs === 2 && !removeNum)) {
- return this;
- }
- // If index is negative, it should resolve relative to the size of the
- // collection. However size may be expensive to compute if not cached, so
- // only call count() if the number is in fact negative.
- index = resolveBegin(index, index < 0 ? this.count() : this.size);
- var spliced = this.slice(0, index);
- return reify(
- this,
- numArgs === 1 ?
- spliced :
- spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))
- );
- },
- // ### More collection methods
- findLastIndex: function(predicate, context) {
- var entry = this.findLastEntry(predicate, context);
- return entry ? entry[0] : -1;
- },
- first: function() {
- return this.get(0);
- },
- flatten: function(depth) {
- return reify(this, flattenFactory(this, depth, false));
- },
- get: function(index, notSetValue) {
- index = wrapIndex(this, index);
- return (index < 0 || (this.size === Infinity ||
- (this.size !== undefined && index > this.size))) ?
- notSetValue :
- this.find(function(_, key) {return key === index}, undefined, notSetValue);
- },
- has: function(index) {
- index = wrapIndex(this, index);
- return index >= 0 && (this.size !== undefined ?
- this.size === Infinity || index < this.size :
- this.indexOf(index) !== -1
- );
- },
- interpose: function(separator) {
- return reify(this, interposeFactory(this, separator));
- },
- interleave: function(/*...iterables*/) {
- var iterables = [this].concat(arrCopy(arguments));
- var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables);
- var interleaved = zipped.flatten(true);
- if (zipped.size) {
- interleaved.size = zipped.size * iterables.length;
- }
- return reify(this, interleaved);
- },
- keySeq: function() {
- return Range(0, this.size);
- },
- last: function() {
- return this.get(-1);
- },
- skipWhile: function(predicate, context) {
- return reify(this, skipWhileFactory(this, predicate, context, false));
- },
- zip: function(/*, ...iterables */) {
- var iterables = [this].concat(arrCopy(arguments));
- return reify(this, zipWithFactory(this, defaultZipper, iterables));
- },
- zipWith: function(zipper/*, ...iterables */) {
- var iterables = arrCopy(arguments);
- iterables[0] = this;
- return reify(this, zipWithFactory(this, zipper, iterables));
- }
- });
- IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;
- IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;
- mixin(SetIterable, {
- // ### ES6 Collection methods (ES6 Array and Map)
- get: function(value, notSetValue) {
- return this.has(value) ? value : notSetValue;
- },
- includes: function(value) {
- return this.has(value);
- },
- // ### More sequential methods
- keySeq: function() {
- return this.valueSeq();
- }
- });
- SetIterable.prototype.has = IterablePrototype.includes;
- SetIterable.prototype.contains = SetIterable.prototype.includes;
- // Mixin subclasses
- mixin(KeyedSeq, KeyedIterable.prototype);
- mixin(IndexedSeq, IndexedIterable.prototype);
- mixin(SetSeq, SetIterable.prototype);
- mixin(KeyedCollection, KeyedIterable.prototype);
- mixin(IndexedCollection, IndexedIterable.prototype);
- mixin(SetCollection, SetIterable.prototype);
- // #pragma Helper functions
- function keyMapper(v, k) {
- return k;
- }
- function entryMapper(v, k) {
- return [k, v];
- }
- function not(predicate) {
- return function() {
- return !predicate.apply(this, arguments);
- }
- }
- function neg(predicate) {
- return function() {
- return -predicate.apply(this, arguments);
- }
- }
- function quoteString(value) {
- return typeof value === 'string' ? JSON.stringify(value) : String(value);
- }
- function defaultZipper() {
- return arrCopy(arguments);
- }
- function defaultNegComparator(a, b) {
- return a < b ? 1 : a > b ? -1 : 0;
- }
- function hashIterable(iterable) {
- if (iterable.size === Infinity) {
- return 0;
- }
- var ordered = isOrdered(iterable);
- var keyed = isKeyed(iterable);
- var h = ordered ? 1 : 0;
- var size = iterable.__iterate(
- keyed ?
- ordered ?
- function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } :
- function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } :
- ordered ?
- function(v ) { h = 31 * h + hash(v) | 0; } :
- function(v ) { h = h + hash(v) | 0; }
- );
- return murmurHashOfSize(size, h);
- }
- function murmurHashOfSize(size, h) {
- h = imul(h, 0xCC9E2D51);
- h = imul(h << 15 | h >>> -15, 0x1B873593);
- h = imul(h << 13 | h >>> -13, 5);
- h = (h + 0xE6546B64 | 0) ^ size;
- h = imul(h ^ h >>> 16, 0x85EBCA6B);
- h = imul(h ^ h >>> 13, 0xC2B2AE35);
- h = smi(h ^ h >>> 16);
- return h;
- }
- function hashMerge(a, b) {
- return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int
- }
- var Immutable = {
- Iterable: Iterable,
- Seq: Seq,
- Collection: Collection,
- Map: Map,
- OrderedMap: OrderedMap,
- List: List,
- Stack: Stack,
- Set: Set,
- OrderedSet: OrderedSet,
- Record: Record,
- Range: Range,
- Repeat: Repeat,
- is: is,
- fromJS: fromJS
- };
- return Immutable;
- }));
- /***/ }),
- /***/ 64847:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var Immutable = __webpack_require__(23634);
- var utils = __webpack_require__(67129);
- var lcs = __webpack_require__(55153);
- var path = __webpack_require__(42472);
- var concatPath = path.concat,
- escape = path.escape,
- op = utils.op,
- isMap = utils.isMap,
- isIndexed = utils.isIndexed;
- var mapDiff = function(a, b, p){
- var ops = [];
- var path = p || '';
- if(Immutable.is(a, b) || (a == b == null)){ return ops; }
- var areLists = isIndexed(a) && isIndexed(b);
- var lastKey = null;
- var removeKey = null
- if(a.forEach){
- a.forEach(function(aValue, aKey){
- if(b.has(aKey)){
- if(isMap(aValue) && isMap(b.get(aKey))){
- ops = ops.concat(mapDiff(aValue, b.get(aKey), concatPath(path, escape(aKey))));
- }
- else if(isIndexed(b.get(aKey)) && isIndexed(aValue)){
- ops = ops.concat(sequenceDiff(aValue, b.get(aKey), concatPath(path, escape(aKey))));
- }
- else {
- var bValue = b.get ? b.get(aKey) : b;
- var areDifferentValues = (aValue !== bValue);
- if (areDifferentValues) {
- ops.push(op('replace', concatPath(path, escape(aKey)), bValue));
- }
- }
- }
- else {
- if(areLists){
- removeKey = (lastKey != null && (lastKey+1) === aKey) ? removeKey : aKey;
- ops.push( op('remove', concatPath(path, escape(removeKey))) );
- lastKey = aKey;
- }
- else{
- ops.push( op('remove', concatPath(path, escape(aKey))) );
- }
- }
- });
- }
- b.forEach(function(bValue, bKey){
- if(a.has && !a.has(bKey)){
- ops.push( op('add', concatPath(path, escape(bKey)), bValue) );
- }
- });
- return ops;
- };
- var sequenceDiff = function (a, b, p) {
- var ops = [];
- var path = p || '';
- if(Immutable.is(a, b) || (a == b == null)){ return ops; }
- if((a.count() + 1) * (b.count() + 1) >= 10000 ) { return mapDiff(a, b, p); }
- var lcsDiff = lcs.diff(a, b);
- var pathIndex = 0;
- lcsDiff.forEach(function (diff) {
- if(diff.op === '='){ pathIndex++; }
- else if(diff.op === '!='){
- if(isMap(diff.val) && isMap(diff.newVal)){
- var mapDiffs = mapDiff(diff.val, diff.newVal, concatPath(path, pathIndex));
- ops = ops.concat(mapDiffs);
- }
- else{
- ops.push(op('replace', concatPath(path, pathIndex), diff.newVal));
- }
- pathIndex++;
- }
- else if(diff.op === '+'){
- ops.push(op('add', concatPath(path, pathIndex), diff.val));
- pathIndex++;
- }
- else if(diff.op === '-'){ ops.push(op('remove', concatPath(path, pathIndex))); }
- });
- return ops;
- };
- var primitiveTypeDiff = function (a, b, p) {
- var path = p || '';
- if(a === b){ return []; }
- else{
- return [ op('replace', concatPath(path, ''), b) ];
- }
- };
- var diff = function(a, b, p){
- if(Immutable.is(a, b)){ return Immutable.List(); }
- if(a != b && (a == null || b == null)){ return Immutable.fromJS([op('replace', '/', b)]); }
- if(isIndexed(a) && isIndexed(b)){
- return Immutable.fromJS(sequenceDiff(a, b));
- }
- else if(isMap(a) && isMap(b)){
- return Immutable.fromJS(mapDiff(a, b));
- }
- else{
- return Immutable.fromJS(primitiveTypeDiff(a, b, p));
- }
- };
- module.exports = diff;
- /***/ }),
- /***/ 55153:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var Immutable = __webpack_require__(23634);
- /**
- * Returns a two-dimensional array (an array of arrays) with dimensions n by m.
- * All the elements of this new matrix are initially equal to x
- * @param n number of rows
- * @param m number of columns
- * @param x initial element for every item in matrix
- */
- var makeMatrix = function(n, m, x){
- var matrix = [];
- for(var i = 0; i < n; i++) {
- matrix[i] = new Array(m);
- if(x != null){
- for(var j = 0; j < m; j++){
- matrix[i][j] = x;
- }
- }
- }
- return matrix;
- };
- /**
- * Computes Longest Common Subsequence between two Immutable.JS Indexed Iterables
- * Based on Dynamic Programming http://rosettacode.org/wiki/Longest_common_subsequence#Java
- * @param xs ImmutableJS Indexed Sequence 1
- * @param ys ImmutableJS Indexed Sequence 2
- */
- var lcs = function(xs, ys){
- var matrix = computeLcsMatrix(xs, ys);
- return backtrackLcs(xs, ys, matrix);
- };
- var DiffResult = Immutable.Record({op: '=', val: null});
- var ReplaceResult = Immutable.Record({op: '!=', val: null, newVal: null});
- /**
- * Returns the resulting diff operations of LCS between two sequences
- * @param xs Indexed Sequence 1
- * @param ys Indexed Sequence 2
- * @returns Array of DiffResult {op:'=' | '+' | '-', val:any}
- */
- var diff = function(xs, ys){
- var matrix = computeLcsMatrix(xs, ys);
- return printDiff(matrix, xs, ys, xs.size||0, ys.size||0);
- };
- var printDiff = function(matrix, xs, ys, xSize, ySize) {
- var diffArray = [];
- var i = xSize - 1;
- var j = ySize - 1;
- while (i >= 0 || j >= 0) {
- if (i >= 0 && j >= 0 && Immutable.is(xs.get(i), ys.get(j))) {
- diffArray.push(new DiffResult({
- op: '=',
- val: xs.get(i)
- }));
- i -= 1;
- j -= 1;
- }
- else if (i >= 0 && j >= 0 && i === j && !Immutable.is(xs.get(i), ys.get(j))) {
- diffArray.push(new ReplaceResult({
- val: xs.get(i),
- newVal: ys.get(i)
- }));
- i -= 1;
- j -= 1;
- }
- else {
- if (j >= 0 && (i === -1 || matrix[i+1][j] >= matrix[i][j+1])) {
- diffArray.push(new DiffResult({
- op: '+',
- val: ys.get(j)
- }));
- j -= 1;
- }
- else if (i >= 0 && (j === -1 || matrix[i+1][j] < matrix[i][j+1])){
- diffArray.push(new DiffResult({
- op: '-',
- val: xs.get(i)
- }));
- i -= 1;
- }
- }
- }
- return diffArray.reverse();
- };
- /**
- * Computes the Longest Common Subsequence table
- * @param xs Indexed Sequence 1
- * @param ys Indexed Sequence 2
- */
- function computeLcsMatrix(xs, ys) {
- var n = xs.size||0;
- var m = ys.size||0;
- var a = makeMatrix(n + 1, m + 1, 0);
- for (var i = 0; i < n; i++) {
- for (var j = 0; j < m; j++) {
- if (Immutable.is(xs.get(i), ys.get(j))) {
- a[i + 1][j + 1] = a[i][j] + 1;
- }
- else {
- a[i + 1][j + 1] = Math.max(a[i + 1][j], a[i][j + 1]);
- }
- }
- }
- return a;
- }
- /**
- * Extracts a LCS from matrix M
- * @param xs Indexed Sequence 1
- * @param ys Indexed Sequence 2
- * @param matrix LCS Matrix
- * @returns {Array.<T>} Longest Common Subsequence
- */
- var backtrackLcs = function(xs, ys, matrix){
- var lcs = [];
- for(var i = xs.size, j = ys.size; i !== 0 && j !== 0;){
- if (matrix[i][j] === matrix[i-1][j]){ i--; }
- else if (matrix[i][j] === matrix[i][j-1]){ j--; }
- else{
- if(Immutable.is(xs.get(i-1), ys.get(j-1))){
- lcs.push(xs.get(i-1));
- i--;
- j--;
- }
- }
- }
- return lcs.reverse();
- };
- module.exports = {
- lcs: lcs,
- computeLcsMatrix: computeLcsMatrix,
- diff: diff
- };
- /***/ }),
- /***/ 42472:
- /***/ ((module) => {
- "use strict";
- var slashRe = new RegExp('/', 'g');
- var escapedSlashRe = new RegExp('~1', 'g');
- var tildeRe = /~/g;
- var escapedTildeRe = /~0/g;
- var Path = {
- escape: function (str) {
- if(typeof(str) === 'number'){
- return str.toString();
- }
- if(typeof(str) !== 'string'){
- throw 'param str (' + str + ') is not a string';
- }
- return str.replace(tildeRe, '~0').replace(slashRe, '~1');
- },
- unescape: function (str) {
- if(typeof(str) == 'string') {
- return str.replace(escapedSlashRe, '/').replace(escapedTildeRe, '~');
- }
- else {
- return str;
- }
- },
- concat: function(path, key){
- return path + '/' + key;
- }
- };
- module.exports = Path;
- /***/ }),
- /***/ 67129:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- var Immutable = __webpack_require__(23634);
- var isMap = function(obj){ return Immutable.Iterable.isKeyed(obj); };
- var isIndexed = function(obj) { return Immutable.Iterable.isIndexed(obj); };
- var op = function(operation, path, value){
- if(operation === 'remove') { return { op: operation, path: path }; }
- return { op: operation, path: path, value: value };
- };
- module.exports = {
- isMap: isMap,
- isIndexed: isIndexed,
- op: op
- };
- /***/ }),
- /***/ 76252:
- /***/ (function(module, exports, __webpack_require__) {
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
- * microplugin.js
- * Copyright (c) 2013 Brian Reavis & contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
- * file except in compliance with the License. You may obtain a copy of the License at:
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
- * ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- *
- * @author Brian Reavis <brian@thirdroute.com>
- */
- (function(root, factory) {
- if (true) {
- !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
- __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
- }(this, function() {
- var MicroPlugin = {};
- MicroPlugin.mixin = function(Interface) {
- Interface.plugins = {};
- /**
- * Initializes the listed plugins (with options).
- * Acceptable formats:
- *
- * List (without options):
- * ['a', 'b', 'c']
- *
- * List (with options):
- * [{'name': 'a', options: {}}, {'name': 'b', options: {}}]
- *
- * Hash (with options):
- * {'a': { ... }, 'b': { ... }, 'c': { ... }}
- *
- * @param {mixed} plugins
- */
- Interface.prototype.initializePlugins = function(plugins) {
- var i, n, key;
- var self = this;
- var queue = [];
- self.plugins = {
- names : [],
- settings : {},
- requested : {},
- loaded : {}
- };
- if (utils.isArray(plugins)) {
- for (i = 0, n = plugins.length; i < n; i++) {
- if (typeof plugins[i] === 'string') {
- queue.push(plugins[i]);
- } else {
- self.plugins.settings[plugins[i].name] = plugins[i].options;
- queue.push(plugins[i].name);
- }
- }
- } else if (plugins) {
- for (key in plugins) {
- if (plugins.hasOwnProperty(key)) {
- self.plugins.settings[key] = plugins[key];
- queue.push(key);
- }
- }
- }
- while (queue.length) {
- self.require(queue.shift());
- }
- };
- Interface.prototype.loadPlugin = function(name) {
- var self = this;
- var plugins = self.plugins;
- var plugin = Interface.plugins[name];
- if (!Interface.plugins.hasOwnProperty(name)) {
- throw new Error('Unable to find "' + name + '" plugin');
- }
- plugins.requested[name] = true;
- plugins.loaded[name] = plugin.fn.apply(self, [self.plugins.settings[name] || {}]);
- plugins.names.push(name);
- };
- /**
- * Initializes a plugin.
- *
- * @param {string} name
- */
- Interface.prototype.require = function(name) {
- var self = this;
- var plugins = self.plugins;
- if (!self.plugins.loaded.hasOwnProperty(name)) {
- if (plugins.requested[name]) {
- throw new Error('Plugin has circular dependency ("' + name + '")');
- }
- self.loadPlugin(name);
- }
- return plugins.loaded[name];
- };
- /**
- * Registers a plugin.
- *
- * @param {string} name
- * @param {function} fn
- */
- Interface.define = function(name, fn) {
- Interface.plugins[name] = {
- 'name' : name,
- 'fn' : fn
- };
- };
- };
- var utils = {
- isArray: Array.isArray || function(vArg) {
- return Object.prototype.toString.call(vArg) === '[object Array]';
- }
- };
- return MicroPlugin;
- }));
- /***/ }),
- /***/ 42786:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Afrikaans [af]
- //! author : Werner Mollentze : https://github.com/wernerm
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var af = moment.defineLocale('af', {
- months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
- weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split(
- '_'
- ),
- weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
- weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
- meridiemParse: /vm|nm/i,
- isPM: function (input) {
- return /^nm$/i.test(input);
- },
- meridiem: function (hours, minutes, isLower) {
- if (hours < 12) {
- return isLower ? 'vm' : 'VM';
- } else {
- return isLower ? 'nm' : 'NM';
- }
- },
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Vandag om] LT',
- nextDay: '[Môre om] LT',
- nextWeek: 'dddd [om] LT',
- lastDay: '[Gister om] LT',
- lastWeek: '[Laas] dddd [om] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'oor %s',
- past: '%s gelede',
- s: "'n paar sekondes",
- ss: '%d sekondes',
- m: "'n minuut",
- mm: '%d minute',
- h: "'n uur",
- hh: '%d ure',
- d: "'n dag",
- dd: '%d dae',
- M: "'n maand",
- MM: '%d maande',
- y: "'n jaar",
- yy: '%d jaar',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
- ordinal: function (number) {
- return (
- number +
- (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
- ); // Thanks to Joris Röling : https://github.com/jjupiter
- },
- week: {
- dow: 1, // Maandag is die eerste dag van die week.
- doy: 4, // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
- },
- });
- return af;
- })));
- /***/ }),
- /***/ 14130:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Arabic (Algeria) [ar-dz]
- //! author : Amine Roukh: https://github.com/Amine27
- //! author : Abdel Said: https://github.com/abdelsaid
- //! author : Ahmed Elkhatib
- //! author : forabi https://github.com/forabi
- //! author : Noureddine LOUAHEDJ : https://github.com/noureddinem
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var pluralForm = function (n) {
- return n === 0
- ? 0
- : n === 1
- ? 1
- : n === 2
- ? 2
- : n % 100 >= 3 && n % 100 <= 10
- ? 3
- : n % 100 >= 11
- ? 4
- : 5;
- },
- plurals = {
- s: [
- 'أقل من ثانية',
- 'ثانية واحدة',
- ['ثانيتان', 'ثانيتين'],
- '%d ثوان',
- '%d ثانية',
- '%d ثانية',
- ],
- m: [
- 'أقل من دقيقة',
- 'دقيقة واحدة',
- ['دقيقتان', 'دقيقتين'],
- '%d دقائق',
- '%d دقيقة',
- '%d دقيقة',
- ],
- h: [
- 'أقل من ساعة',
- 'ساعة واحدة',
- ['ساعتان', 'ساعتين'],
- '%d ساعات',
- '%d ساعة',
- '%d ساعة',
- ],
- d: [
- 'أقل من يوم',
- 'يوم واحد',
- ['يومان', 'يومين'],
- '%d أيام',
- '%d يومًا',
- '%d يوم',
- ],
- M: [
- 'أقل من شهر',
- 'شهر واحد',
- ['شهران', 'شهرين'],
- '%d أشهر',
- '%d شهرا',
- '%d شهر',
- ],
- y: [
- 'أقل من عام',
- 'عام واحد',
- ['عامان', 'عامين'],
- '%d أعوام',
- '%d عامًا',
- '%d عام',
- ],
- },
- pluralize = function (u) {
- return function (number, withoutSuffix, string, isFuture) {
- var f = pluralForm(number),
- str = plurals[u][pluralForm(number)];
- if (f === 2) {
- str = str[withoutSuffix ? 0 : 1];
- }
- return str.replace(/%d/i, number);
- };
- },
- months = [
- 'جانفي',
- 'فيفري',
- 'مارس',
- 'أفريل',
- 'ماي',
- 'جوان',
- 'جويلية',
- 'أوت',
- 'سبتمبر',
- 'أكتوبر',
- 'نوفمبر',
- 'ديسمبر',
- ];
- var arDz = moment.defineLocale('ar-dz', {
- months: months,
- monthsShort: months,
- weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
- weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
- weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'D/\u200FM/\u200FYYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- meridiemParse: /ص|م/,
- isPM: function (input) {
- return 'م' === input;
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'ص';
- } else {
- return 'م';
- }
- },
- calendar: {
- sameDay: '[اليوم عند الساعة] LT',
- nextDay: '[غدًا عند الساعة] LT',
- nextWeek: 'dddd [عند الساعة] LT',
- lastDay: '[أمس عند الساعة] LT',
- lastWeek: 'dddd [عند الساعة] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'بعد %s',
- past: 'منذ %s',
- s: pluralize('s'),
- ss: pluralize('s'),
- m: pluralize('m'),
- mm: pluralize('m'),
- h: pluralize('h'),
- hh: pluralize('h'),
- d: pluralize('d'),
- dd: pluralize('d'),
- M: pluralize('M'),
- MM: pluralize('M'),
- y: pluralize('y'),
- yy: pluralize('y'),
- },
- postformat: function (string) {
- return string.replace(/,/g, '،');
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return arDz;
- })));
- /***/ }),
- /***/ 96135:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Arabic (Kuwait) [ar-kw]
- //! author : Nusret Parlak: https://github.com/nusretparlak
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var arKw = moment.defineLocale('ar-kw', {
- months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
- '_'
- ),
- monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
- '_'
- ),
- weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
- weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
- weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[اليوم على الساعة] LT',
- nextDay: '[غدا على الساعة] LT',
- nextWeek: 'dddd [على الساعة] LT',
- lastDay: '[أمس على الساعة] LT',
- lastWeek: 'dddd [على الساعة] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'في %s',
- past: 'منذ %s',
- s: 'ثوان',
- ss: '%d ثانية',
- m: 'دقيقة',
- mm: '%d دقائق',
- h: 'ساعة',
- hh: '%d ساعات',
- d: 'يوم',
- dd: '%d أيام',
- M: 'شهر',
- MM: '%d أشهر',
- y: 'سنة',
- yy: '%d سنوات',
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 12, // The week that contains Jan 12th is the first week of the year.
- },
- });
- return arKw;
- })));
- /***/ }),
- /***/ 56440:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Arabic (Lybia) [ar-ly]
- //! author : Ali Hmer: https://github.com/kikoanis
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '1',
- 2: '2',
- 3: '3',
- 4: '4',
- 5: '5',
- 6: '6',
- 7: '7',
- 8: '8',
- 9: '9',
- 0: '0',
- },
- pluralForm = function (n) {
- return n === 0
- ? 0
- : n === 1
- ? 1
- : n === 2
- ? 2
- : n % 100 >= 3 && n % 100 <= 10
- ? 3
- : n % 100 >= 11
- ? 4
- : 5;
- },
- plurals = {
- s: [
- 'أقل من ثانية',
- 'ثانية واحدة',
- ['ثانيتان', 'ثانيتين'],
- '%d ثوان',
- '%d ثانية',
- '%d ثانية',
- ],
- m: [
- 'أقل من دقيقة',
- 'دقيقة واحدة',
- ['دقيقتان', 'دقيقتين'],
- '%d دقائق',
- '%d دقيقة',
- '%d دقيقة',
- ],
- h: [
- 'أقل من ساعة',
- 'ساعة واحدة',
- ['ساعتان', 'ساعتين'],
- '%d ساعات',
- '%d ساعة',
- '%d ساعة',
- ],
- d: [
- 'أقل من يوم',
- 'يوم واحد',
- ['يومان', 'يومين'],
- '%d أيام',
- '%d يومًا',
- '%d يوم',
- ],
- M: [
- 'أقل من شهر',
- 'شهر واحد',
- ['شهران', 'شهرين'],
- '%d أشهر',
- '%d شهرا',
- '%d شهر',
- ],
- y: [
- 'أقل من عام',
- 'عام واحد',
- ['عامان', 'عامين'],
- '%d أعوام',
- '%d عامًا',
- '%d عام',
- ],
- },
- pluralize = function (u) {
- return function (number, withoutSuffix, string, isFuture) {
- var f = pluralForm(number),
- str = plurals[u][pluralForm(number)];
- if (f === 2) {
- str = str[withoutSuffix ? 0 : 1];
- }
- return str.replace(/%d/i, number);
- };
- },
- months = [
- 'يناير',
- 'فبراير',
- 'مارس',
- 'أبريل',
- 'مايو',
- 'يونيو',
- 'يوليو',
- 'أغسطس',
- 'سبتمبر',
- 'أكتوبر',
- 'نوفمبر',
- 'ديسمبر',
- ];
- var arLy = moment.defineLocale('ar-ly', {
- months: months,
- monthsShort: months,
- weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
- weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
- weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'D/\u200FM/\u200FYYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- meridiemParse: /ص|م/,
- isPM: function (input) {
- return 'م' === input;
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'ص';
- } else {
- return 'م';
- }
- },
- calendar: {
- sameDay: '[اليوم عند الساعة] LT',
- nextDay: '[غدًا عند الساعة] LT',
- nextWeek: 'dddd [عند الساعة] LT',
- lastDay: '[أمس عند الساعة] LT',
- lastWeek: 'dddd [عند الساعة] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'بعد %s',
- past: 'منذ %s',
- s: pluralize('s'),
- ss: pluralize('s'),
- m: pluralize('m'),
- mm: pluralize('m'),
- h: pluralize('h'),
- hh: pluralize('h'),
- d: pluralize('d'),
- dd: pluralize('d'),
- M: pluralize('M'),
- MM: pluralize('M'),
- y: pluralize('y'),
- yy: pluralize('y'),
- },
- preparse: function (string) {
- return string.replace(/،/g, ',');
- },
- postformat: function (string) {
- return string
- .replace(/\d/g, function (match) {
- return symbolMap[match];
- })
- .replace(/,/g, '،');
- },
- week: {
- dow: 6, // Saturday is the first day of the week.
- doy: 12, // The week that contains Jan 12th is the first week of the year.
- },
- });
- return arLy;
- })));
- /***/ }),
- /***/ 47702:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Arabic (Morocco) [ar-ma]
- //! author : ElFadili Yassine : https://github.com/ElFadiliY
- //! author : Abdel Said : https://github.com/abdelsaid
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var arMa = moment.defineLocale('ar-ma', {
- months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
- '_'
- ),
- monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
- '_'
- ),
- weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
- weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
- weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[اليوم على الساعة] LT',
- nextDay: '[غدا على الساعة] LT',
- nextWeek: 'dddd [على الساعة] LT',
- lastDay: '[أمس على الساعة] LT',
- lastWeek: 'dddd [على الساعة] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'في %s',
- past: 'منذ %s',
- s: 'ثوان',
- ss: '%d ثانية',
- m: 'دقيقة',
- mm: '%d دقائق',
- h: 'ساعة',
- hh: '%d ساعات',
- d: 'يوم',
- dd: '%d أيام',
- M: 'شهر',
- MM: '%d أشهر',
- y: 'سنة',
- yy: '%d سنوات',
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return arMa;
- })));
- /***/ }),
- /***/ 16040:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Arabic (Saudi Arabia) [ar-sa]
- //! author : Suhail Alkowaileet : https://github.com/xsoh
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '١',
- 2: '٢',
- 3: '٣',
- 4: '٤',
- 5: '٥',
- 6: '٦',
- 7: '٧',
- 8: '٨',
- 9: '٩',
- 0: '٠',
- },
- numberMap = {
- '١': '1',
- '٢': '2',
- '٣': '3',
- '٤': '4',
- '٥': '5',
- '٦': '6',
- '٧': '7',
- '٨': '8',
- '٩': '9',
- '٠': '0',
- };
- var arSa = moment.defineLocale('ar-sa', {
- months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
- '_'
- ),
- monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
- '_'
- ),
- weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
- weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
- weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- meridiemParse: /ص|م/,
- isPM: function (input) {
- return 'م' === input;
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'ص';
- } else {
- return 'م';
- }
- },
- calendar: {
- sameDay: '[اليوم على الساعة] LT',
- nextDay: '[غدا على الساعة] LT',
- nextWeek: 'dddd [على الساعة] LT',
- lastDay: '[أمس على الساعة] LT',
- lastWeek: 'dddd [على الساعة] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'في %s',
- past: 'منذ %s',
- s: 'ثوان',
- ss: '%d ثانية',
- m: 'دقيقة',
- mm: '%d دقائق',
- h: 'ساعة',
- hh: '%d ساعات',
- d: 'يوم',
- dd: '%d أيام',
- M: 'شهر',
- MM: '%d أشهر',
- y: 'سنة',
- yy: '%d سنوات',
- },
- preparse: function (string) {
- return string
- .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
- return numberMap[match];
- })
- .replace(/،/g, ',');
- },
- postformat: function (string) {
- return string
- .replace(/\d/g, function (match) {
- return symbolMap[match];
- })
- .replace(/,/g, '،');
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return arSa;
- })));
- /***/ }),
- /***/ 37100:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Arabic (Tunisia) [ar-tn]
- //! author : Nader Toukabri : https://github.com/naderio
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var arTn = moment.defineLocale('ar-tn', {
- months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
- '_'
- ),
- monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
- '_'
- ),
- weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
- weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
- weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[اليوم على الساعة] LT',
- nextDay: '[غدا على الساعة] LT',
- nextWeek: 'dddd [على الساعة] LT',
- lastDay: '[أمس على الساعة] LT',
- lastWeek: 'dddd [على الساعة] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'في %s',
- past: 'منذ %s',
- s: 'ثوان',
- ss: '%d ثانية',
- m: 'دقيقة',
- mm: '%d دقائق',
- h: 'ساعة',
- hh: '%d ساعات',
- d: 'يوم',
- dd: '%d أيام',
- M: 'شهر',
- MM: '%d أشهر',
- y: 'سنة',
- yy: '%d سنوات',
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return arTn;
- })));
- /***/ }),
- /***/ 30867:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Arabic [ar]
- //! author : Abdel Said: https://github.com/abdelsaid
- //! author : Ahmed Elkhatib
- //! author : forabi https://github.com/forabi
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '١',
- 2: '٢',
- 3: '٣',
- 4: '٤',
- 5: '٥',
- 6: '٦',
- 7: '٧',
- 8: '٨',
- 9: '٩',
- 0: '٠',
- },
- numberMap = {
- '١': '1',
- '٢': '2',
- '٣': '3',
- '٤': '4',
- '٥': '5',
- '٦': '6',
- '٧': '7',
- '٨': '8',
- '٩': '9',
- '٠': '0',
- },
- pluralForm = function (n) {
- return n === 0
- ? 0
- : n === 1
- ? 1
- : n === 2
- ? 2
- : n % 100 >= 3 && n % 100 <= 10
- ? 3
- : n % 100 >= 11
- ? 4
- : 5;
- },
- plurals = {
- s: [
- 'أقل من ثانية',
- 'ثانية واحدة',
- ['ثانيتان', 'ثانيتين'],
- '%d ثوان',
- '%d ثانية',
- '%d ثانية',
- ],
- m: [
- 'أقل من دقيقة',
- 'دقيقة واحدة',
- ['دقيقتان', 'دقيقتين'],
- '%d دقائق',
- '%d دقيقة',
- '%d دقيقة',
- ],
- h: [
- 'أقل من ساعة',
- 'ساعة واحدة',
- ['ساعتان', 'ساعتين'],
- '%d ساعات',
- '%d ساعة',
- '%d ساعة',
- ],
- d: [
- 'أقل من يوم',
- 'يوم واحد',
- ['يومان', 'يومين'],
- '%d أيام',
- '%d يومًا',
- '%d يوم',
- ],
- M: [
- 'أقل من شهر',
- 'شهر واحد',
- ['شهران', 'شهرين'],
- '%d أشهر',
- '%d شهرا',
- '%d شهر',
- ],
- y: [
- 'أقل من عام',
- 'عام واحد',
- ['عامان', 'عامين'],
- '%d أعوام',
- '%d عامًا',
- '%d عام',
- ],
- },
- pluralize = function (u) {
- return function (number, withoutSuffix, string, isFuture) {
- var f = pluralForm(number),
- str = plurals[u][pluralForm(number)];
- if (f === 2) {
- str = str[withoutSuffix ? 0 : 1];
- }
- return str.replace(/%d/i, number);
- };
- },
- months = [
- 'يناير',
- 'فبراير',
- 'مارس',
- 'أبريل',
- 'مايو',
- 'يونيو',
- 'يوليو',
- 'أغسطس',
- 'سبتمبر',
- 'أكتوبر',
- 'نوفمبر',
- 'ديسمبر',
- ];
- var ar = moment.defineLocale('ar', {
- months: months,
- monthsShort: months,
- weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
- weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
- weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'D/\u200FM/\u200FYYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- meridiemParse: /ص|م/,
- isPM: function (input) {
- return 'م' === input;
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'ص';
- } else {
- return 'م';
- }
- },
- calendar: {
- sameDay: '[اليوم عند الساعة] LT',
- nextDay: '[غدًا عند الساعة] LT',
- nextWeek: 'dddd [عند الساعة] LT',
- lastDay: '[أمس عند الساعة] LT',
- lastWeek: 'dddd [عند الساعة] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'بعد %s',
- past: 'منذ %s',
- s: pluralize('s'),
- ss: pluralize('s'),
- m: pluralize('m'),
- mm: pluralize('m'),
- h: pluralize('h'),
- hh: pluralize('h'),
- d: pluralize('d'),
- dd: pluralize('d'),
- M: pluralize('M'),
- MM: pluralize('M'),
- y: pluralize('y'),
- yy: pluralize('y'),
- },
- preparse: function (string) {
- return string
- .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
- return numberMap[match];
- })
- .replace(/،/g, ',');
- },
- postformat: function (string) {
- return string
- .replace(/\d/g, function (match) {
- return symbolMap[match];
- })
- .replace(/,/g, '،');
- },
- week: {
- dow: 6, // Saturday is the first day of the week.
- doy: 12, // The week that contains Jan 12th is the first week of the year.
- },
- });
- return ar;
- })));
- /***/ }),
- /***/ 31083:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Azerbaijani [az]
- //! author : topchiyev : https://github.com/topchiyev
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var suffixes = {
- 1: '-inci',
- 5: '-inci',
- 8: '-inci',
- 70: '-inci',
- 80: '-inci',
- 2: '-nci',
- 7: '-nci',
- 20: '-nci',
- 50: '-nci',
- 3: '-üncü',
- 4: '-üncü',
- 100: '-üncü',
- 6: '-ncı',
- 9: '-uncu',
- 10: '-uncu',
- 30: '-uncu',
- 60: '-ıncı',
- 90: '-ıncı',
- };
- var az = moment.defineLocale('az', {
- months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split(
- '_'
- ),
- monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
- weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split(
- '_'
- ),
- weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
- weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[bugün saat] LT',
- nextDay: '[sabah saat] LT',
- nextWeek: '[gələn həftə] dddd [saat] LT',
- lastDay: '[dünən] LT',
- lastWeek: '[keçən həftə] dddd [saat] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s sonra',
- past: '%s əvvəl',
- s: 'bir neçə saniyə',
- ss: '%d saniyə',
- m: 'bir dəqiqə',
- mm: '%d dəqiqə',
- h: 'bir saat',
- hh: '%d saat',
- d: 'bir gün',
- dd: '%d gün',
- M: 'bir ay',
- MM: '%d ay',
- y: 'bir il',
- yy: '%d il',
- },
- meridiemParse: /gecə|səhər|gündüz|axşam/,
- isPM: function (input) {
- return /^(gündüz|axşam)$/.test(input);
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'gecə';
- } else if (hour < 12) {
- return 'səhər';
- } else if (hour < 17) {
- return 'gündüz';
- } else {
- return 'axşam';
- }
- },
- dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
- ordinal: function (number) {
- if (number === 0) {
- // special case for zero
- return number + '-ıncı';
- }
- var a = number % 10,
- b = (number % 100) - a,
- c = number >= 100 ? 100 : null;
- return number + (suffixes[a] || suffixes[b] || suffixes[c]);
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return az;
- })));
- /***/ }),
- /***/ 9808:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Belarusian [be]
- //! author : Dmitry Demidov : https://github.com/demidov91
- //! author: Praleska: http://praleska.pro/
- //! Author : Menelion Elensúle : https://github.com/Oire
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function plural(word, num) {
- var forms = word.split('_');
- return num % 10 === 1 && num % 100 !== 11
- ? forms[0]
- : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
- ? forms[1]
- : forms[2];
- }
- function relativeTimeWithPlural(number, withoutSuffix, key) {
- var format = {
- ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
- mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
- hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
- dd: 'дзень_дні_дзён',
- MM: 'месяц_месяцы_месяцаў',
- yy: 'год_гады_гадоў',
- };
- if (key === 'm') {
- return withoutSuffix ? 'хвіліна' : 'хвіліну';
- } else if (key === 'h') {
- return withoutSuffix ? 'гадзіна' : 'гадзіну';
- } else {
- return number + ' ' + plural(format[key], +number);
- }
- }
- var be = moment.defineLocale('be', {
- months: {
- format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split(
- '_'
- ),
- standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split(
- '_'
- ),
- },
- monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split(
- '_'
- ),
- weekdays: {
- format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split(
- '_'
- ),
- standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split(
- '_'
- ),
- isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/,
- },
- weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
- weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY г.',
- LLL: 'D MMMM YYYY г., HH:mm',
- LLLL: 'dddd, D MMMM YYYY г., HH:mm',
- },
- calendar: {
- sameDay: '[Сёння ў] LT',
- nextDay: '[Заўтра ў] LT',
- lastDay: '[Учора ў] LT',
- nextWeek: function () {
- return '[У] dddd [ў] LT';
- },
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- case 3:
- case 5:
- case 6:
- return '[У мінулую] dddd [ў] LT';
- case 1:
- case 2:
- case 4:
- return '[У мінулы] dddd [ў] LT';
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'праз %s',
- past: '%s таму',
- s: 'некалькі секунд',
- m: relativeTimeWithPlural,
- mm: relativeTimeWithPlural,
- h: relativeTimeWithPlural,
- hh: relativeTimeWithPlural,
- d: 'дзень',
- dd: relativeTimeWithPlural,
- M: 'месяц',
- MM: relativeTimeWithPlural,
- y: 'год',
- yy: relativeTimeWithPlural,
- },
- meridiemParse: /ночы|раніцы|дня|вечара/,
- isPM: function (input) {
- return /^(дня|вечара)$/.test(input);
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'ночы';
- } else if (hour < 12) {
- return 'раніцы';
- } else if (hour < 17) {
- return 'дня';
- } else {
- return 'вечара';
- }
- },
- dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/,
- ordinal: function (number, period) {
- switch (period) {
- case 'M':
- case 'd':
- case 'DDD':
- case 'w':
- case 'W':
- return (number % 10 === 2 || number % 10 === 3) &&
- number % 100 !== 12 &&
- number % 100 !== 13
- ? number + '-і'
- : number + '-ы';
- case 'D':
- return number + '-га';
- default:
- return number;
- }
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return be;
- })));
- /***/ }),
- /***/ 68338:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Bulgarian [bg]
- //! author : Krasen Borisov : https://github.com/kraz
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var bg = moment.defineLocale('bg', {
- months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split(
- '_'
- ),
- monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
- weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split(
- '_'
- ),
- weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
- weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'D.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY H:mm',
- LLLL: 'dddd, D MMMM YYYY H:mm',
- },
- calendar: {
- sameDay: '[Днес в] LT',
- nextDay: '[Утре в] LT',
- nextWeek: 'dddd [в] LT',
- lastDay: '[Вчера в] LT',
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- case 3:
- case 6:
- return '[Миналата] dddd [в] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[Миналия] dddd [в] LT';
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'след %s',
- past: 'преди %s',
- s: 'няколко секунди',
- ss: '%d секунди',
- m: 'минута',
- mm: '%d минути',
- h: 'час',
- hh: '%d часа',
- d: 'ден',
- dd: '%d дена',
- w: 'седмица',
- ww: '%d седмици',
- M: 'месец',
- MM: '%d месеца',
- y: 'година',
- yy: '%d години',
- },
- dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
- ordinal: function (number) {
- var lastDigit = number % 10,
- last2Digits = number % 100;
- if (number === 0) {
- return number + '-ев';
- } else if (last2Digits === 0) {
- return number + '-ен';
- } else if (last2Digits > 10 && last2Digits < 20) {
- return number + '-ти';
- } else if (lastDigit === 1) {
- return number + '-ви';
- } else if (lastDigit === 2) {
- return number + '-ри';
- } else if (lastDigit === 7 || lastDigit === 8) {
- return number + '-ми';
- } else {
- return number + '-ти';
- }
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return bg;
- })));
- /***/ }),
- /***/ 67438:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Bambara [bm]
- //! author : Estelle Comment : https://github.com/estellecomment
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var bm = moment.defineLocale('bm', {
- months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split(
- '_'
- ),
- monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
- weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
- weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
- weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'MMMM [tile] D [san] YYYY',
- LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
- LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
- },
- calendar: {
- sameDay: '[Bi lɛrɛ] LT',
- nextDay: '[Sini lɛrɛ] LT',
- nextWeek: 'dddd [don lɛrɛ] LT',
- lastDay: '[Kunu lɛrɛ] LT',
- lastWeek: 'dddd [tɛmɛnen lɛrɛ] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s kɔnɔ',
- past: 'a bɛ %s bɔ',
- s: 'sanga dama dama',
- ss: 'sekondi %d',
- m: 'miniti kelen',
- mm: 'miniti %d',
- h: 'lɛrɛ kelen',
- hh: 'lɛrɛ %d',
- d: 'tile kelen',
- dd: 'tile %d',
- M: 'kalo kelen',
- MM: 'kalo %d',
- y: 'san kelen',
- yy: 'san %d',
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return bm;
- })));
- /***/ }),
- /***/ 76225:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Bengali (Bangladesh) [bn-bd]
- //! author : Asraf Hossain Patoary : https://github.com/ashwoolford
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '১',
- 2: '২',
- 3: '৩',
- 4: '৪',
- 5: '৫',
- 6: '৬',
- 7: '৭',
- 8: '৮',
- 9: '৯',
- 0: '০',
- },
- numberMap = {
- '১': '1',
- '২': '2',
- '৩': '3',
- '৪': '4',
- '৫': '5',
- '৬': '6',
- '৭': '7',
- '৮': '8',
- '৯': '9',
- '০': '0',
- };
- var bnBd = moment.defineLocale('bn-bd', {
- months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(
- '_'
- ),
- monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
- '_'
- ),
- weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(
- '_'
- ),
- weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
- weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),
- longDateFormat: {
- LT: 'A h:mm সময়',
- LTS: 'A h:mm:ss সময়',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, A h:mm সময়',
- LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',
- },
- calendar: {
- sameDay: '[আজ] LT',
- nextDay: '[আগামীকাল] LT',
- nextWeek: 'dddd, LT',
- lastDay: '[গতকাল] LT',
- lastWeek: '[গত] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s পরে',
- past: '%s আগে',
- s: 'কয়েক সেকেন্ড',
- ss: '%d সেকেন্ড',
- m: 'এক মিনিট',
- mm: '%d মিনিট',
- h: 'এক ঘন্টা',
- hh: '%d ঘন্টা',
- d: 'এক দিন',
- dd: '%d দিন',
- M: 'এক মাস',
- MM: '%d মাস',
- y: 'এক বছর',
- yy: '%d বছর',
- },
- preparse: function (string) {
- return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- meridiemParse: /রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'রাত') {
- return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'ভোর') {
- return hour;
- } else if (meridiem === 'সকাল') {
- return hour;
- } else if (meridiem === 'দুপুর') {
- return hour >= 3 ? hour : hour + 12;
- } else if (meridiem === 'বিকাল') {
- return hour + 12;
- } else if (meridiem === 'সন্ধ্যা') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'রাত';
- } else if (hour < 6) {
- return 'ভোর';
- } else if (hour < 12) {
- return 'সকাল';
- } else if (hour < 15) {
- return 'দুপুর';
- } else if (hour < 18) {
- return 'বিকাল';
- } else if (hour < 20) {
- return 'সন্ধ্যা';
- } else {
- return 'রাত';
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return bnBd;
- })));
- /***/ }),
- /***/ 8905:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Bengali [bn]
- //! author : Kaushik Gandhi : https://github.com/kaushikgandhi
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '১',
- 2: '২',
- 3: '৩',
- 4: '৪',
- 5: '৫',
- 6: '৬',
- 7: '৭',
- 8: '৮',
- 9: '৯',
- 0: '০',
- },
- numberMap = {
- '১': '1',
- '২': '2',
- '৩': '3',
- '৪': '4',
- '৫': '5',
- '৬': '6',
- '৭': '7',
- '৮': '8',
- '৯': '9',
- '০': '0',
- };
- var bn = moment.defineLocale('bn', {
- months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(
- '_'
- ),
- monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
- '_'
- ),
- weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(
- '_'
- ),
- weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
- weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),
- longDateFormat: {
- LT: 'A h:mm সময়',
- LTS: 'A h:mm:ss সময়',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, A h:mm সময়',
- LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',
- },
- calendar: {
- sameDay: '[আজ] LT',
- nextDay: '[আগামীকাল] LT',
- nextWeek: 'dddd, LT',
- lastDay: '[গতকাল] LT',
- lastWeek: '[গত] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s পরে',
- past: '%s আগে',
- s: 'কয়েক সেকেন্ড',
- ss: '%d সেকেন্ড',
- m: 'এক মিনিট',
- mm: '%d মিনিট',
- h: 'এক ঘন্টা',
- hh: '%d ঘন্টা',
- d: 'এক দিন',
- dd: '%d দিন',
- M: 'এক মাস',
- MM: '%d মাস',
- y: 'এক বছর',
- yy: '%d বছর',
- },
- preparse: function (string) {
- return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (
- (meridiem === 'রাত' && hour >= 4) ||
- (meridiem === 'দুপুর' && hour < 5) ||
- meridiem === 'বিকাল'
- ) {
- return hour + 12;
- } else {
- return hour;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'রাত';
- } else if (hour < 10) {
- return 'সকাল';
- } else if (hour < 17) {
- return 'দুপুর';
- } else if (hour < 20) {
- return 'বিকাল';
- } else {
- return 'রাত';
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return bn;
- })));
- /***/ }),
- /***/ 11560:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Tibetan [bo]
- //! author : Thupten N. Chakrishar : https://github.com/vajradog
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '༡',
- 2: '༢',
- 3: '༣',
- 4: '༤',
- 5: '༥',
- 6: '༦',
- 7: '༧',
- 8: '༨',
- 9: '༩',
- 0: '༠',
- },
- numberMap = {
- '༡': '1',
- '༢': '2',
- '༣': '3',
- '༤': '4',
- '༥': '5',
- '༦': '6',
- '༧': '7',
- '༨': '8',
- '༩': '9',
- '༠': '0',
- };
- var bo = moment.defineLocale('bo', {
- months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split(
- '_'
- ),
- monthsShort: 'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split(
- '_'
- ),
- monthsShortRegex: /^(ཟླ་\d{1,2})/,
- monthsParseExact: true,
- weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split(
- '_'
- ),
- weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split(
- '_'
- ),
- weekdaysMin: 'ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན'.split('_'),
- longDateFormat: {
- LT: 'A h:mm',
- LTS: 'A h:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, A h:mm',
- LLLL: 'dddd, D MMMM YYYY, A h:mm',
- },
- calendar: {
- sameDay: '[དི་རིང] LT',
- nextDay: '[སང་ཉིན] LT',
- nextWeek: '[བདུན་ཕྲག་རྗེས་མ], LT',
- lastDay: '[ཁ་སང] LT',
- lastWeek: '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s ལ་',
- past: '%s སྔན་ལ',
- s: 'ལམ་སང',
- ss: '%d སྐར་ཆ།',
- m: 'སྐར་མ་གཅིག',
- mm: '%d སྐར་མ',
- h: 'ཆུ་ཚོད་གཅིག',
- hh: '%d ཆུ་ཚོད',
- d: 'ཉིན་གཅིག',
- dd: '%d ཉིན་',
- M: 'ཟླ་བ་གཅིག',
- MM: '%d ཟླ་བ',
- y: 'ལོ་གཅིག',
- yy: '%d ལོ',
- },
- preparse: function (string) {
- return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (
- (meridiem === 'མཚན་མོ' && hour >= 4) ||
- (meridiem === 'ཉིན་གུང' && hour < 5) ||
- meridiem === 'དགོང་དག'
- ) {
- return hour + 12;
- } else {
- return hour;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'མཚན་མོ';
- } else if (hour < 10) {
- return 'ཞོགས་ཀས';
- } else if (hour < 17) {
- return 'ཉིན་གུང';
- } else if (hour < 20) {
- return 'དགོང་དག';
- } else {
- return 'མཚན་མོ';
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return bo;
- })));
- /***/ }),
- /***/ 1278:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Breton [br]
- //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function relativeTimeWithMutation(number, withoutSuffix, key) {
- var format = {
- mm: 'munutenn',
- MM: 'miz',
- dd: 'devezh',
- };
- return number + ' ' + mutation(format[key], number);
- }
- function specialMutationForYears(number) {
- switch (lastNumber(number)) {
- case 1:
- case 3:
- case 4:
- case 5:
- case 9:
- return number + ' bloaz';
- default:
- return number + ' vloaz';
- }
- }
- function lastNumber(number) {
- if (number > 9) {
- return lastNumber(number % 10);
- }
- return number;
- }
- function mutation(text, number) {
- if (number === 2) {
- return softMutation(text);
- }
- return text;
- }
- function softMutation(text) {
- var mutationTable = {
- m: 'v',
- b: 'v',
- d: 'z',
- };
- if (mutationTable[text.charAt(0)] === undefined) {
- return text;
- }
- return mutationTable[text.charAt(0)] + text.substring(1);
- }
- var monthsParse = [
- /^gen/i,
- /^c[ʼ\']hwe/i,
- /^meu/i,
- /^ebr/i,
- /^mae/i,
- /^(mez|eve)/i,
- /^gou/i,
- /^eos/i,
- /^gwe/i,
- /^her/i,
- /^du/i,
- /^ker/i,
- ],
- monthsRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
- monthsStrictRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,
- monthsShortStrictRegex = /^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
- fullWeekdaysParse = [
- /^sul/i,
- /^lun/i,
- /^meurzh/i,
- /^merc[ʼ\']her/i,
- /^yaou/i,
- /^gwener/i,
- /^sadorn/i,
- ],
- shortWeekdaysParse = [
- /^Sul/i,
- /^Lun/i,
- /^Meu/i,
- /^Mer/i,
- /^Yao/i,
- /^Gwe/i,
- /^Sad/i,
- ],
- minWeekdaysParse = [
- /^Su/i,
- /^Lu/i,
- /^Me([^r]|$)/i,
- /^Mer/i,
- /^Ya/i,
- /^Gw/i,
- /^Sa/i,
- ];
- var br = moment.defineLocale('br', {
- months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split(
- '_'
- ),
- monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
- weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),
- weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
- weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
- weekdaysParse: minWeekdaysParse,
- fullWeekdaysParse: fullWeekdaysParse,
- shortWeekdaysParse: shortWeekdaysParse,
- minWeekdaysParse: minWeekdaysParse,
- monthsRegex: monthsRegex,
- monthsShortRegex: monthsRegex,
- monthsStrictRegex: monthsStrictRegex,
- monthsShortStrictRegex: monthsShortStrictRegex,
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D [a viz] MMMM YYYY',
- LLL: 'D [a viz] MMMM YYYY HH:mm',
- LLLL: 'dddd, D [a viz] MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Hiziv da] LT',
- nextDay: '[Warcʼhoazh da] LT',
- nextWeek: 'dddd [da] LT',
- lastDay: '[Decʼh da] LT',
- lastWeek: 'dddd [paset da] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'a-benn %s',
- past: '%s ʼzo',
- s: 'un nebeud segondennoù',
- ss: '%d eilenn',
- m: 'ur vunutenn',
- mm: relativeTimeWithMutation,
- h: 'un eur',
- hh: '%d eur',
- d: 'un devezh',
- dd: relativeTimeWithMutation,
- M: 'ur miz',
- MM: relativeTimeWithMutation,
- y: 'ur bloaz',
- yy: specialMutationForYears,
- },
- dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/,
- ordinal: function (number) {
- var output = number === 1 ? 'añ' : 'vet';
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- meridiemParse: /a.m.|g.m./, // goude merenn | a-raok merenn
- isPM: function (token) {
- return token === 'g.m.';
- },
- meridiem: function (hour, minute, isLower) {
- return hour < 12 ? 'a.m.' : 'g.m.';
- },
- });
- return br;
- })));
- /***/ }),
- /***/ 80622:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Bosnian [bs]
- //! author : Nedim Cholich : https://github.com/frontyard
- //! based on (hr) translation by Bojan Marković
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function translate(number, withoutSuffix, key) {
- var result = number + ' ';
- switch (key) {
- case 'ss':
- if (number === 1) {
- result += 'sekunda';
- } else if (number === 2 || number === 3 || number === 4) {
- result += 'sekunde';
- } else {
- result += 'sekundi';
- }
- return result;
- case 'm':
- return withoutSuffix ? 'jedna minuta' : 'jedne minute';
- case 'mm':
- if (number === 1) {
- result += 'minuta';
- } else if (number === 2 || number === 3 || number === 4) {
- result += 'minute';
- } else {
- result += 'minuta';
- }
- return result;
- case 'h':
- return withoutSuffix ? 'jedan sat' : 'jednog sata';
- case 'hh':
- if (number === 1) {
- result += 'sat';
- } else if (number === 2 || number === 3 || number === 4) {
- result += 'sata';
- } else {
- result += 'sati';
- }
- return result;
- case 'dd':
- if (number === 1) {
- result += 'dan';
- } else {
- result += 'dana';
- }
- return result;
- case 'MM':
- if (number === 1) {
- result += 'mjesec';
- } else if (number === 2 || number === 3 || number === 4) {
- result += 'mjeseca';
- } else {
- result += 'mjeseci';
- }
- return result;
- case 'yy':
- if (number === 1) {
- result += 'godina';
- } else if (number === 2 || number === 3 || number === 4) {
- result += 'godine';
- } else {
- result += 'godina';
- }
- return result;
- }
- }
- var bs = moment.defineLocale('bs', {
- months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split(
- '_'
- ),
- monthsShort: 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
- '_'
- ),
- weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
- weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY H:mm',
- LLLL: 'dddd, D. MMMM YYYY H:mm',
- },
- calendar: {
- sameDay: '[danas u] LT',
- nextDay: '[sutra u] LT',
- nextWeek: function () {
- switch (this.day()) {
- case 0:
- return '[u] [nedjelju] [u] LT';
- case 3:
- return '[u] [srijedu] [u] LT';
- case 6:
- return '[u] [subotu] [u] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[u] dddd [u] LT';
- }
- },
- lastDay: '[jučer u] LT',
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- case 3:
- return '[prošlu] dddd [u] LT';
- case 6:
- return '[prošle] [subote] [u] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[prošli] dddd [u] LT';
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'za %s',
- past: 'prije %s',
- s: 'par sekundi',
- ss: translate,
- m: translate,
- mm: translate,
- h: translate,
- hh: translate,
- d: 'dan',
- dd: translate,
- M: 'mjesec',
- MM: translate,
- y: 'godinu',
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return bs;
- })));
- /***/ }),
- /***/ 2468:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Catalan [ca]
- //! author : Juan G. Hurtado : https://github.com/juanghurtado
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var ca = moment.defineLocale('ca', {
- months: {
- standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split(
- '_'
- ),
- format: "de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split(
- '_'
- ),
- isFormat: /D[oD]?(\s)+MMMM/,
- },
- monthsShort: 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split(
- '_'
- ),
- weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
- weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM [de] YYYY',
- ll: 'D MMM YYYY',
- LLL: 'D MMMM [de] YYYY [a les] H:mm',
- lll: 'D MMM YYYY, H:mm',
- LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',
- llll: 'ddd D MMM YYYY, H:mm',
- },
- calendar: {
- sameDay: function () {
- return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
- },
- nextDay: function () {
- return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
- },
- nextWeek: function () {
- return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
- },
- lastDay: function () {
- return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
- },
- lastWeek: function () {
- return (
- '[el] dddd [passat a ' +
- (this.hours() !== 1 ? 'les' : 'la') +
- '] LT'
- );
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: "d'aquí %s",
- past: 'fa %s',
- s: 'uns segons',
- ss: '%d segons',
- m: 'un minut',
- mm: '%d minuts',
- h: 'una hora',
- hh: '%d hores',
- d: 'un dia',
- dd: '%d dies',
- M: 'un mes',
- MM: '%d mesos',
- y: 'un any',
- yy: '%d anys',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
- ordinal: function (number, period) {
- var output =
- number === 1
- ? 'r'
- : number === 2
- ? 'n'
- : number === 3
- ? 'r'
- : number === 4
- ? 't'
- : 'è';
- if (period === 'w' || period === 'W') {
- output = 'a';
- }
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return ca;
- })));
- /***/ }),
- /***/ 5822:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Czech [cs]
- //! author : petrbela : https://github.com/petrbela
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split(
- '_'
- ),
- monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'),
- monthsParse = [
- /^led/i,
- /^úno/i,
- /^bře/i,
- /^dub/i,
- /^kvě/i,
- /^(čvn|červen$|června)/i,
- /^(čvc|červenec|července)/i,
- /^srp/i,
- /^zář/i,
- /^říj/i,
- /^lis/i,
- /^pro/i,
- ],
- // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
- // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
- monthsRegex = /^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;
- function plural(n) {
- return n > 1 && n < 5 && ~~(n / 10) !== 1;
- }
- function translate(number, withoutSuffix, key, isFuture) {
- var result = number + ' ';
- switch (key) {
- case 's': // a few seconds / in a few seconds / a few seconds ago
- return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';
- case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'sekundy' : 'sekund');
- } else {
- return result + 'sekundami';
- }
- case 'm': // a minute / in a minute / a minute ago
- return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou';
- case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'minuty' : 'minut');
- } else {
- return result + 'minutami';
- }
- case 'h': // an hour / in an hour / an hour ago
- return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
- case 'hh': // 9 hours / in 9 hours / 9 hours ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'hodiny' : 'hodin');
- } else {
- return result + 'hodinami';
- }
- case 'd': // a day / in a day / a day ago
- return withoutSuffix || isFuture ? 'den' : 'dnem';
- case 'dd': // 9 days / in 9 days / 9 days ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'dny' : 'dní');
- } else {
- return result + 'dny';
- }
- case 'M': // a month / in a month / a month ago
- return withoutSuffix || isFuture ? 'měsíc' : 'měsícem';
- case 'MM': // 9 months / in 9 months / 9 months ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'měsíce' : 'měsíců');
- } else {
- return result + 'měsíci';
- }
- case 'y': // a year / in a year / a year ago
- return withoutSuffix || isFuture ? 'rok' : 'rokem';
- case 'yy': // 9 years / in 9 years / 9 years ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'roky' : 'let');
- } else {
- return result + 'lety';
- }
- }
- }
- var cs = moment.defineLocale('cs', {
- months: months,
- monthsShort: monthsShort,
- monthsRegex: monthsRegex,
- monthsShortRegex: monthsRegex,
- // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
- // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
- monthsStrictRegex: /^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,
- monthsShortStrictRegex: /^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
- weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),
- weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY H:mm',
- LLLL: 'dddd D. MMMM YYYY H:mm',
- l: 'D. M. YYYY',
- },
- calendar: {
- sameDay: '[dnes v] LT',
- nextDay: '[zítra v] LT',
- nextWeek: function () {
- switch (this.day()) {
- case 0:
- return '[v neděli v] LT';
- case 1:
- case 2:
- return '[v] dddd [v] LT';
- case 3:
- return '[ve středu v] LT';
- case 4:
- return '[ve čtvrtek v] LT';
- case 5:
- return '[v pátek v] LT';
- case 6:
- return '[v sobotu v] LT';
- }
- },
- lastDay: '[včera v] LT',
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- return '[minulou neděli v] LT';
- case 1:
- case 2:
- return '[minulé] dddd [v] LT';
- case 3:
- return '[minulou středu v] LT';
- case 4:
- case 5:
- return '[minulý] dddd [v] LT';
- case 6:
- return '[minulou sobotu v] LT';
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'za %s',
- past: 'před %s',
- s: translate,
- ss: translate,
- m: translate,
- mm: translate,
- h: translate,
- hh: translate,
- d: translate,
- dd: translate,
- M: translate,
- MM: translate,
- y: translate,
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return cs;
- })));
- /***/ }),
- /***/ 50877:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Chuvash [cv]
- //! author : Anatoly Mironov : https://github.com/mirontoli
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var cv = moment.defineLocale('cv', {
- months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split(
- '_'
- ),
- monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
- weekdays: 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split(
- '_'
- ),
- weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
- weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD-MM-YYYY',
- LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
- LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
- LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
- },
- calendar: {
- sameDay: '[Паян] LT [сехетре]',
- nextDay: '[Ыран] LT [сехетре]',
- lastDay: '[Ӗнер] LT [сехетре]',
- nextWeek: '[Ҫитес] dddd LT [сехетре]',
- lastWeek: '[Иртнӗ] dddd LT [сехетре]',
- sameElse: 'L',
- },
- relativeTime: {
- future: function (output) {
- var affix = /сехет$/i.exec(output)
- ? 'рен'
- : /ҫул$/i.exec(output)
- ? 'тан'
- : 'ран';
- return output + affix;
- },
- past: '%s каялла',
- s: 'пӗр-ик ҫеккунт',
- ss: '%d ҫеккунт',
- m: 'пӗр минут',
- mm: '%d минут',
- h: 'пӗр сехет',
- hh: '%d сехет',
- d: 'пӗр кун',
- dd: '%d кун',
- M: 'пӗр уйӑх',
- MM: '%d уйӑх',
- y: 'пӗр ҫул',
- yy: '%d ҫул',
- },
- dayOfMonthOrdinalParse: /\d{1,2}-мӗш/,
- ordinal: '%d-мӗш',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return cv;
- })));
- /***/ }),
- /***/ 47373:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Welsh [cy]
- //! author : Robert Allen : https://github.com/robgallen
- //! author : https://github.com/ryangreaves
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var cy = moment.defineLocale('cy', {
- months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split(
- '_'
- ),
- monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split(
- '_'
- ),
- weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split(
- '_'
- ),
- weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
- weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
- weekdaysParseExact: true,
- // time formats are the same as en-gb
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Heddiw am] LT',
- nextDay: '[Yfory am] LT',
- nextWeek: 'dddd [am] LT',
- lastDay: '[Ddoe am] LT',
- lastWeek: 'dddd [diwethaf am] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'mewn %s',
- past: '%s yn ôl',
- s: 'ychydig eiliadau',
- ss: '%d eiliad',
- m: 'munud',
- mm: '%d munud',
- h: 'awr',
- hh: '%d awr',
- d: 'diwrnod',
- dd: '%d diwrnod',
- M: 'mis',
- MM: '%d mis',
- y: 'blwyddyn',
- yy: '%d flynedd',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
- // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
- ordinal: function (number) {
- var b = number,
- output = '',
- lookup = [
- '',
- 'af',
- 'il',
- 'ydd',
- 'ydd',
- 'ed',
- 'ed',
- 'ed',
- 'fed',
- 'fed',
- 'fed', // 1af to 10fed
- 'eg',
- 'fed',
- 'eg',
- 'eg',
- 'fed',
- 'eg',
- 'eg',
- 'fed',
- 'eg',
- 'fed', // 11eg to 20fed
- ];
- if (b > 20) {
- if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
- output = 'fed'; // not 30ain, 70ain or 90ain
- } else {
- output = 'ain';
- }
- } else if (b > 0) {
- output = lookup[b];
- }
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return cy;
- })));
- /***/ }),
- /***/ 24780:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Danish [da]
- //! author : Ulrik Nielsen : https://github.com/mrbase
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var da = moment.defineLocale('da', {
- months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split(
- '_'
- ),
- monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
- weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
- weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'),
- weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY HH:mm',
- LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm',
- },
- calendar: {
- sameDay: '[i dag kl.] LT',
- nextDay: '[i morgen kl.] LT',
- nextWeek: 'på dddd [kl.] LT',
- lastDay: '[i går kl.] LT',
- lastWeek: '[i] dddd[s kl.] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'om %s',
- past: '%s siden',
- s: 'få sekunder',
- ss: '%d sekunder',
- m: 'et minut',
- mm: '%d minutter',
- h: 'en time',
- hh: '%d timer',
- d: 'en dag',
- dd: '%d dage',
- M: 'en måned',
- MM: '%d måneder',
- y: 'et år',
- yy: '%d år',
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return da;
- })));
- /***/ }),
- /***/ 60217:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : German (Austria) [de-at]
- //! author : lluchs : https://github.com/lluchs
- //! author: Menelion Elensúle: https://github.com/Oire
- //! author : Martin Groller : https://github.com/MadMG
- //! author : Mikolaj Dadela : https://github.com/mik01aj
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function processRelativeTime(number, withoutSuffix, key, isFuture) {
- var format = {
- m: ['eine Minute', 'einer Minute'],
- h: ['eine Stunde', 'einer Stunde'],
- d: ['ein Tag', 'einem Tag'],
- dd: [number + ' Tage', number + ' Tagen'],
- w: ['eine Woche', 'einer Woche'],
- M: ['ein Monat', 'einem Monat'],
- MM: [number + ' Monate', number + ' Monaten'],
- y: ['ein Jahr', 'einem Jahr'],
- yy: [number + ' Jahre', number + ' Jahren'],
- };
- return withoutSuffix ? format[key][0] : format[key][1];
- }
- var deAt = moment.defineLocale('de-at', {
- months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
- '_'
- ),
- monthsShort: 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
- '_'
- ),
- weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
- weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY HH:mm',
- LLLL: 'dddd, D. MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[heute um] LT [Uhr]',
- sameElse: 'L',
- nextDay: '[morgen um] LT [Uhr]',
- nextWeek: 'dddd [um] LT [Uhr]',
- lastDay: '[gestern um] LT [Uhr]',
- lastWeek: '[letzten] dddd [um] LT [Uhr]',
- },
- relativeTime: {
- future: 'in %s',
- past: 'vor %s',
- s: 'ein paar Sekunden',
- ss: '%d Sekunden',
- m: processRelativeTime,
- mm: '%d Minuten',
- h: processRelativeTime,
- hh: '%d Stunden',
- d: processRelativeTime,
- dd: processRelativeTime,
- w: processRelativeTime,
- ww: '%d Wochen',
- M: processRelativeTime,
- MM: processRelativeTime,
- y: processRelativeTime,
- yy: processRelativeTime,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return deAt;
- })));
- /***/ }),
- /***/ 60894:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : German (Switzerland) [de-ch]
- //! author : sschueller : https://github.com/sschueller
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function processRelativeTime(number, withoutSuffix, key, isFuture) {
- var format = {
- m: ['eine Minute', 'einer Minute'],
- h: ['eine Stunde', 'einer Stunde'],
- d: ['ein Tag', 'einem Tag'],
- dd: [number + ' Tage', number + ' Tagen'],
- w: ['eine Woche', 'einer Woche'],
- M: ['ein Monat', 'einem Monat'],
- MM: [number + ' Monate', number + ' Monaten'],
- y: ['ein Jahr', 'einem Jahr'],
- yy: [number + ' Jahre', number + ' Jahren'],
- };
- return withoutSuffix ? format[key][0] : format[key][1];
- }
- var deCh = moment.defineLocale('de-ch', {
- months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
- '_'
- ),
- monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
- '_'
- ),
- weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
- weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY HH:mm',
- LLLL: 'dddd, D. MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[heute um] LT [Uhr]',
- sameElse: 'L',
- nextDay: '[morgen um] LT [Uhr]',
- nextWeek: 'dddd [um] LT [Uhr]',
- lastDay: '[gestern um] LT [Uhr]',
- lastWeek: '[letzten] dddd [um] LT [Uhr]',
- },
- relativeTime: {
- future: 'in %s',
- past: 'vor %s',
- s: 'ein paar Sekunden',
- ss: '%d Sekunden',
- m: processRelativeTime,
- mm: '%d Minuten',
- h: processRelativeTime,
- hh: '%d Stunden',
- d: processRelativeTime,
- dd: processRelativeTime,
- w: processRelativeTime,
- ww: '%d Wochen',
- M: processRelativeTime,
- MM: processRelativeTime,
- y: processRelativeTime,
- yy: processRelativeTime,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return deCh;
- })));
- /***/ }),
- /***/ 59740:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : German [de]
- //! author : lluchs : https://github.com/lluchs
- //! author: Menelion Elensúle: https://github.com/Oire
- //! author : Mikolaj Dadela : https://github.com/mik01aj
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function processRelativeTime(number, withoutSuffix, key, isFuture) {
- var format = {
- m: ['eine Minute', 'einer Minute'],
- h: ['eine Stunde', 'einer Stunde'],
- d: ['ein Tag', 'einem Tag'],
- dd: [number + ' Tage', number + ' Tagen'],
- w: ['eine Woche', 'einer Woche'],
- M: ['ein Monat', 'einem Monat'],
- MM: [number + ' Monate', number + ' Monaten'],
- y: ['ein Jahr', 'einem Jahr'],
- yy: [number + ' Jahre', number + ' Jahren'],
- };
- return withoutSuffix ? format[key][0] : format[key][1];
- }
- var de = moment.defineLocale('de', {
- months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
- '_'
- ),
- monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
- '_'
- ),
- weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
- weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY HH:mm',
- LLLL: 'dddd, D. MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[heute um] LT [Uhr]',
- sameElse: 'L',
- nextDay: '[morgen um] LT [Uhr]',
- nextWeek: 'dddd [um] LT [Uhr]',
- lastDay: '[gestern um] LT [Uhr]',
- lastWeek: '[letzten] dddd [um] LT [Uhr]',
- },
- relativeTime: {
- future: 'in %s',
- past: 'vor %s',
- s: 'ein paar Sekunden',
- ss: '%d Sekunden',
- m: processRelativeTime,
- mm: '%d Minuten',
- h: processRelativeTime,
- hh: '%d Stunden',
- d: processRelativeTime,
- dd: processRelativeTime,
- w: processRelativeTime,
- ww: '%d Wochen',
- M: processRelativeTime,
- MM: processRelativeTime,
- y: processRelativeTime,
- yy: processRelativeTime,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return de;
- })));
- /***/ }),
- /***/ 5300:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Maldivian [dv]
- //! author : Jawish Hameed : https://github.com/jawish
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var months = [
- 'ޖެނުއަރީ',
- 'ފެބްރުއަރީ',
- 'މާރިޗު',
- 'އޭޕްރީލު',
- 'މޭ',
- 'ޖޫން',
- 'ޖުލައި',
- 'އޯގަސްޓު',
- 'ސެޕްޓެމްބަރު',
- 'އޮކްޓޯބަރު',
- 'ނޮވެމްބަރު',
- 'ޑިސެމްބަރު',
- ],
- weekdays = [
- 'އާދިއްތަ',
- 'ހޯމަ',
- 'އަންގާރަ',
- 'ބުދަ',
- 'ބުރާސްފަތި',
- 'ހުކުރު',
- 'ހޮނިހިރު',
- ];
- var dv = moment.defineLocale('dv', {
- months: months,
- monthsShort: months,
- weekdays: weekdays,
- weekdaysShort: weekdays,
- weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'D/M/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- meridiemParse: /މކ|މފ/,
- isPM: function (input) {
- return 'މފ' === input;
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'މކ';
- } else {
- return 'މފ';
- }
- },
- calendar: {
- sameDay: '[މިއަދު] LT',
- nextDay: '[މާދަމާ] LT',
- nextWeek: 'dddd LT',
- lastDay: '[އިއްޔެ] LT',
- lastWeek: '[ފާއިތުވި] dddd LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'ތެރޭގައި %s',
- past: 'ކުރިން %s',
- s: 'ސިކުންތުކޮޅެއް',
- ss: 'd% ސިކުންތު',
- m: 'މިނިޓެއް',
- mm: 'މިނިޓު %d',
- h: 'ގަޑިއިރެއް',
- hh: 'ގަޑިއިރު %d',
- d: 'ދުވަހެއް',
- dd: 'ދުވަސް %d',
- M: 'މަހެއް',
- MM: 'މަސް %d',
- y: 'އަހަރެއް',
- yy: 'އަހަރު %d',
- },
- preparse: function (string) {
- return string.replace(/،/g, ',');
- },
- postformat: function (string) {
- return string.replace(/,/g, '،');
- },
- week: {
- dow: 7, // Sunday is the first day of the week.
- doy: 12, // The week that contains Jan 12th is the first week of the year.
- },
- });
- return dv;
- })));
- /***/ }),
- /***/ 50837:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Greek [el]
- //! author : Aggelos Karalias : https://github.com/mehiel
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function isFunction(input) {
- return (
- (typeof Function !== 'undefined' && input instanceof Function) ||
- Object.prototype.toString.call(input) === '[object Function]'
- );
- }
- var el = moment.defineLocale('el', {
- monthsNominativeEl: 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split(
- '_'
- ),
- monthsGenitiveEl: 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split(
- '_'
- ),
- months: function (momentToFormat, format) {
- if (!momentToFormat) {
- return this._monthsNominativeEl;
- } else if (
- typeof format === 'string' &&
- /D/.test(format.substring(0, format.indexOf('MMMM')))
- ) {
- // if there is a day number before 'MMMM'
- return this._monthsGenitiveEl[momentToFormat.month()];
- } else {
- return this._monthsNominativeEl[momentToFormat.month()];
- }
- },
- monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
- weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split(
- '_'
- ),
- weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
- weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
- meridiem: function (hours, minutes, isLower) {
- if (hours > 11) {
- return isLower ? 'μμ' : 'ΜΜ';
- } else {
- return isLower ? 'πμ' : 'ΠΜ';
- }
- },
- isPM: function (input) {
- return (input + '').toLowerCase()[0] === 'μ';
- },
- meridiemParse: /[ΠΜ]\.?Μ?\.?/i,
- longDateFormat: {
- LT: 'h:mm A',
- LTS: 'h:mm:ss A',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY h:mm A',
- LLLL: 'dddd, D MMMM YYYY h:mm A',
- },
- calendarEl: {
- sameDay: '[Σήμερα {}] LT',
- nextDay: '[Αύριο {}] LT',
- nextWeek: 'dddd [{}] LT',
- lastDay: '[Χθες {}] LT',
- lastWeek: function () {
- switch (this.day()) {
- case 6:
- return '[το προηγούμενο] dddd [{}] LT';
- default:
- return '[την προηγούμενη] dddd [{}] LT';
- }
- },
- sameElse: 'L',
- },
- calendar: function (key, mom) {
- var output = this._calendarEl[key],
- hours = mom && mom.hours();
- if (isFunction(output)) {
- output = output.apply(mom);
- }
- return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις');
- },
- relativeTime: {
- future: 'σε %s',
- past: '%s πριν',
- s: 'λίγα δευτερόλεπτα',
- ss: '%d δευτερόλεπτα',
- m: 'ένα λεπτό',
- mm: '%d λεπτά',
- h: 'μία ώρα',
- hh: '%d ώρες',
- d: 'μία μέρα',
- dd: '%d μέρες',
- M: 'ένας μήνας',
- MM: '%d μήνες',
- y: 'ένας χρόνος',
- yy: '%d χρόνια',
- },
- dayOfMonthOrdinalParse: /\d{1,2}η/,
- ordinal: '%dη',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4st is the first week of the year.
- },
- });
- return el;
- })));
- /***/ }),
- /***/ 78348:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : English (Australia) [en-au]
- //! author : Jared Morse : https://github.com/jarcoal
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var enAu = moment.defineLocale('en-au', {
- months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
- weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
- '_'
- ),
- weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
- weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- longDateFormat: {
- LT: 'h:mm A',
- LTS: 'h:mm:ss A',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY h:mm A',
- LLLL: 'dddd, D MMMM YYYY h:mm A',
- },
- calendar: {
- sameDay: '[Today at] LT',
- nextDay: '[Tomorrow at] LT',
- nextWeek: 'dddd [at] LT',
- lastDay: '[Yesterday at] LT',
- lastWeek: '[Last] dddd [at] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'in %s',
- past: '%s ago',
- s: 'a few seconds',
- ss: '%d seconds',
- m: 'a minute',
- mm: '%d minutes',
- h: 'an hour',
- hh: '%d hours',
- d: 'a day',
- dd: '%d days',
- M: 'a month',
- MM: '%d months',
- y: 'a year',
- yy: '%d years',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return enAu;
- })));
- /***/ }),
- /***/ 77925:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : English (Canada) [en-ca]
- //! author : Jonathan Abourbih : https://github.com/jonbca
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var enCa = moment.defineLocale('en-ca', {
- months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
- weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
- '_'
- ),
- weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
- weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- longDateFormat: {
- LT: 'h:mm A',
- LTS: 'h:mm:ss A',
- L: 'YYYY-MM-DD',
- LL: 'MMMM D, YYYY',
- LLL: 'MMMM D, YYYY h:mm A',
- LLLL: 'dddd, MMMM D, YYYY h:mm A',
- },
- calendar: {
- sameDay: '[Today at] LT',
- nextDay: '[Tomorrow at] LT',
- nextWeek: 'dddd [at] LT',
- lastDay: '[Yesterday at] LT',
- lastWeek: '[Last] dddd [at] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'in %s',
- past: '%s ago',
- s: 'a few seconds',
- ss: '%d seconds',
- m: 'a minute',
- mm: '%d minutes',
- h: 'an hour',
- hh: '%d hours',
- d: 'a day',
- dd: '%d days',
- M: 'a month',
- MM: '%d months',
- y: 'a year',
- yy: '%d years',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- });
- return enCa;
- })));
- /***/ }),
- /***/ 22243:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : English (United Kingdom) [en-gb]
- //! author : Chris Gedrim : https://github.com/chrisgedrim
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var enGb = moment.defineLocale('en-gb', {
- months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
- weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
- '_'
- ),
- weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
- weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Today at] LT',
- nextDay: '[Tomorrow at] LT',
- nextWeek: 'dddd [at] LT',
- lastDay: '[Yesterday at] LT',
- lastWeek: '[Last] dddd [at] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'in %s',
- past: '%s ago',
- s: 'a few seconds',
- ss: '%d seconds',
- m: 'a minute',
- mm: '%d minutes',
- h: 'an hour',
- hh: '%d hours',
- d: 'a day',
- dd: '%d days',
- M: 'a month',
- MM: '%d months',
- y: 'a year',
- yy: '%d years',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return enGb;
- })));
- /***/ }),
- /***/ 46436:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : English (Ireland) [en-ie]
- //! author : Chris Cartlidge : https://github.com/chriscartlidge
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var enIe = moment.defineLocale('en-ie', {
- months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
- weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
- '_'
- ),
- weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
- weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Today at] LT',
- nextDay: '[Tomorrow at] LT',
- nextWeek: 'dddd [at] LT',
- lastDay: '[Yesterday at] LT',
- lastWeek: '[Last] dddd [at] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'in %s',
- past: '%s ago',
- s: 'a few seconds',
- ss: '%d seconds',
- m: 'a minute',
- mm: '%d minutes',
- h: 'an hour',
- hh: '%d hours',
- d: 'a day',
- dd: '%d days',
- M: 'a month',
- MM: '%d months',
- y: 'a year',
- yy: '%d years',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return enIe;
- })));
- /***/ }),
- /***/ 47207:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : English (Israel) [en-il]
- //! author : Chris Gedrim : https://github.com/chrisgedrim
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var enIl = moment.defineLocale('en-il', {
- months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
- weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
- '_'
- ),
- weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
- weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Today at] LT',
- nextDay: '[Tomorrow at] LT',
- nextWeek: 'dddd [at] LT',
- lastDay: '[Yesterday at] LT',
- lastWeek: '[Last] dddd [at] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'in %s',
- past: '%s ago',
- s: 'a few seconds',
- ss: '%d seconds',
- m: 'a minute',
- mm: '%d minutes',
- h: 'an hour',
- hh: '%d hours',
- d: 'a day',
- dd: '%d days',
- M: 'a month',
- MM: '%d months',
- y: 'a year',
- yy: '%d years',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- });
- return enIl;
- })));
- /***/ }),
- /***/ 44175:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : English (India) [en-in]
- //! author : Jatin Agrawal : https://github.com/jatinag22
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var enIn = moment.defineLocale('en-in', {
- months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
- weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
- '_'
- ),
- weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
- weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- longDateFormat: {
- LT: 'h:mm A',
- LTS: 'h:mm:ss A',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY h:mm A',
- LLLL: 'dddd, D MMMM YYYY h:mm A',
- },
- calendar: {
- sameDay: '[Today at] LT',
- nextDay: '[Tomorrow at] LT',
- nextWeek: 'dddd [at] LT',
- lastDay: '[Yesterday at] LT',
- lastWeek: '[Last] dddd [at] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'in %s',
- past: '%s ago',
- s: 'a few seconds',
- ss: '%d seconds',
- m: 'a minute',
- mm: '%d minutes',
- h: 'an hour',
- hh: '%d hours',
- d: 'a day',
- dd: '%d days',
- M: 'a month',
- MM: '%d months',
- y: 'a year',
- yy: '%d years',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 1st is the first week of the year.
- },
- });
- return enIn;
- })));
- /***/ }),
- /***/ 76319:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : English (New Zealand) [en-nz]
- //! author : Luke McGregor : https://github.com/lukemcgregor
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var enNz = moment.defineLocale('en-nz', {
- months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
- weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
- '_'
- ),
- weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
- weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- longDateFormat: {
- LT: 'h:mm A',
- LTS: 'h:mm:ss A',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY h:mm A',
- LLLL: 'dddd, D MMMM YYYY h:mm A',
- },
- calendar: {
- sameDay: '[Today at] LT',
- nextDay: '[Tomorrow at] LT',
- nextWeek: 'dddd [at] LT',
- lastDay: '[Yesterday at] LT',
- lastWeek: '[Last] dddd [at] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'in %s',
- past: '%s ago',
- s: 'a few seconds',
- ss: '%d seconds',
- m: 'a minute',
- mm: '%d minutes',
- h: 'an hour',
- hh: '%d hours',
- d: 'a day',
- dd: '%d days',
- M: 'a month',
- MM: '%d months',
- y: 'a year',
- yy: '%d years',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return enNz;
- })));
- /***/ }),
- /***/ 31662:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : English (Singapore) [en-sg]
- //! author : Matthew Castrillon-Madrigal : https://github.com/techdimension
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var enSg = moment.defineLocale('en-sg', {
- months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
- weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
- '_'
- ),
- weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
- weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Today at] LT',
- nextDay: '[Tomorrow at] LT',
- nextWeek: 'dddd [at] LT',
- lastDay: '[Yesterday at] LT',
- lastWeek: '[Last] dddd [at] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'in %s',
- past: '%s ago',
- s: 'a few seconds',
- ss: '%d seconds',
- m: 'a minute',
- mm: '%d minutes',
- h: 'an hour',
- hh: '%d hours',
- d: 'a day',
- dd: '%d days',
- M: 'a month',
- MM: '%d months',
- y: 'a year',
- yy: '%d years',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return enSg;
- })));
- /***/ }),
- /***/ 92915:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Esperanto [eo]
- //! author : Colin Dean : https://github.com/colindean
- //! author : Mia Nordentoft Imperatori : https://github.com/miestasmia
- //! comment : miestasmia corrected the translation by colindean
- //! comment : Vivakvo corrected the translation by colindean and miestasmia
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var eo = moment.defineLocale('eo', {
- months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split(
- '_'
- ),
- monthsShort: 'jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec'.split('_'),
- weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),
- weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),
- weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY-MM-DD',
- LL: '[la] D[-an de] MMMM, YYYY',
- LLL: '[la] D[-an de] MMMM, YYYY HH:mm',
- LLLL: 'dddd[n], [la] D[-an de] MMMM, YYYY HH:mm',
- llll: 'ddd, [la] D[-an de] MMM, YYYY HH:mm',
- },
- meridiemParse: /[ap]\.t\.m/i,
- isPM: function (input) {
- return input.charAt(0).toLowerCase() === 'p';
- },
- meridiem: function (hours, minutes, isLower) {
- if (hours > 11) {
- return isLower ? 'p.t.m.' : 'P.T.M.';
- } else {
- return isLower ? 'a.t.m.' : 'A.T.M.';
- }
- },
- calendar: {
- sameDay: '[Hodiaŭ je] LT',
- nextDay: '[Morgaŭ je] LT',
- nextWeek: 'dddd[n je] LT',
- lastDay: '[Hieraŭ je] LT',
- lastWeek: '[pasintan] dddd[n je] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'post %s',
- past: 'antaŭ %s',
- s: 'kelkaj sekundoj',
- ss: '%d sekundoj',
- m: 'unu minuto',
- mm: '%d minutoj',
- h: 'unu horo',
- hh: '%d horoj',
- d: 'unu tago', //ne 'diurno', ĉar estas uzita por proksimumo
- dd: '%d tagoj',
- M: 'unu monato',
- MM: '%d monatoj',
- y: 'unu jaro',
- yy: '%d jaroj',
- },
- dayOfMonthOrdinalParse: /\d{1,2}a/,
- ordinal: '%da',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return eo;
- })));
- /***/ }),
- /***/ 55251:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Spanish (Dominican Republic) [es-do]
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
- '_'
- ),
- monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
- monthsParse = [
- /^ene/i,
- /^feb/i,
- /^mar/i,
- /^abr/i,
- /^may/i,
- /^jun/i,
- /^jul/i,
- /^ago/i,
- /^sep/i,
- /^oct/i,
- /^nov/i,
- /^dic/i,
- ],
- monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
- var esDo = moment.defineLocale('es-do', {
- months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
- '_'
- ),
- monthsShort: function (m, format) {
- if (!m) {
- return monthsShortDot;
- } else if (/-MMM-/.test(format)) {
- return monthsShort[m.month()];
- } else {
- return monthsShortDot[m.month()];
- }
- },
- monthsRegex: monthsRegex,
- monthsShortRegex: monthsRegex,
- monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
- monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
- weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
- weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'h:mm A',
- LTS: 'h:mm:ss A',
- L: 'DD/MM/YYYY',
- LL: 'D [de] MMMM [de] YYYY',
- LLL: 'D [de] MMMM [de] YYYY h:mm A',
- LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',
- },
- calendar: {
- sameDay: function () {
- return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- nextDay: function () {
- return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- nextWeek: function () {
- return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- lastDay: function () {
- return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- lastWeek: function () {
- return (
- '[el] dddd [pasado a la' +
- (this.hours() !== 1 ? 's' : '') +
- '] LT'
- );
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'en %s',
- past: 'hace %s',
- s: 'unos segundos',
- ss: '%d segundos',
- m: 'un minuto',
- mm: '%d minutos',
- h: 'una hora',
- hh: '%d horas',
- d: 'un día',
- dd: '%d días',
- w: 'una semana',
- ww: '%d semanas',
- M: 'un mes',
- MM: '%d meses',
- y: 'un año',
- yy: '%d años',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return esDo;
- })));
- /***/ }),
- /***/ 96112:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Spanish (Mexico) [es-mx]
- //! author : JC Franco : https://github.com/jcfranco
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
- '_'
- ),
- monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
- monthsParse = [
- /^ene/i,
- /^feb/i,
- /^mar/i,
- /^abr/i,
- /^may/i,
- /^jun/i,
- /^jul/i,
- /^ago/i,
- /^sep/i,
- /^oct/i,
- /^nov/i,
- /^dic/i,
- ],
- monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
- var esMx = moment.defineLocale('es-mx', {
- months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
- '_'
- ),
- monthsShort: function (m, format) {
- if (!m) {
- return monthsShortDot;
- } else if (/-MMM-/.test(format)) {
- return monthsShort[m.month()];
- } else {
- return monthsShortDot[m.month()];
- }
- },
- monthsRegex: monthsRegex,
- monthsShortRegex: monthsRegex,
- monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
- monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
- weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
- weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D [de] MMMM [de] YYYY',
- LLL: 'D [de] MMMM [de] YYYY H:mm',
- LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
- },
- calendar: {
- sameDay: function () {
- return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- nextDay: function () {
- return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- nextWeek: function () {
- return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- lastDay: function () {
- return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- lastWeek: function () {
- return (
- '[el] dddd [pasado a la' +
- (this.hours() !== 1 ? 's' : '') +
- '] LT'
- );
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'en %s',
- past: 'hace %s',
- s: 'unos segundos',
- ss: '%d segundos',
- m: 'un minuto',
- mm: '%d minutos',
- h: 'una hora',
- hh: '%d horas',
- d: 'un día',
- dd: '%d días',
- w: 'una semana',
- ww: '%d semanas',
- M: 'un mes',
- MM: '%d meses',
- y: 'un año',
- yy: '%d años',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- invalidDate: 'Fecha inválida',
- });
- return esMx;
- })));
- /***/ }),
- /***/ 71146:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Spanish (United States) [es-us]
- //! author : bustta : https://github.com/bustta
- //! author : chrisrodz : https://github.com/chrisrodz
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
- '_'
- ),
- monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
- monthsParse = [
- /^ene/i,
- /^feb/i,
- /^mar/i,
- /^abr/i,
- /^may/i,
- /^jun/i,
- /^jul/i,
- /^ago/i,
- /^sep/i,
- /^oct/i,
- /^nov/i,
- /^dic/i,
- ],
- monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
- var esUs = moment.defineLocale('es-us', {
- months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
- '_'
- ),
- monthsShort: function (m, format) {
- if (!m) {
- return monthsShortDot;
- } else if (/-MMM-/.test(format)) {
- return monthsShort[m.month()];
- } else {
- return monthsShortDot[m.month()];
- }
- },
- monthsRegex: monthsRegex,
- monthsShortRegex: monthsRegex,
- monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
- monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
- weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
- weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'h:mm A',
- LTS: 'h:mm:ss A',
- L: 'MM/DD/YYYY',
- LL: 'D [de] MMMM [de] YYYY',
- LLL: 'D [de] MMMM [de] YYYY h:mm A',
- LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',
- },
- calendar: {
- sameDay: function () {
- return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- nextDay: function () {
- return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- nextWeek: function () {
- return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- lastDay: function () {
- return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- lastWeek: function () {
- return (
- '[el] dddd [pasado a la' +
- (this.hours() !== 1 ? 's' : '') +
- '] LT'
- );
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'en %s',
- past: 'hace %s',
- s: 'unos segundos',
- ss: '%d segundos',
- m: 'un minuto',
- mm: '%d minutos',
- h: 'una hora',
- hh: '%d horas',
- d: 'un día',
- dd: '%d días',
- w: 'una semana',
- ww: '%d semanas',
- M: 'un mes',
- MM: '%d meses',
- y: 'un año',
- yy: '%d años',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return esUs;
- })));
- /***/ }),
- /***/ 55655:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Spanish [es]
- //! author : Julio Napurí : https://github.com/julionc
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
- '_'
- ),
- monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
- monthsParse = [
- /^ene/i,
- /^feb/i,
- /^mar/i,
- /^abr/i,
- /^may/i,
- /^jun/i,
- /^jul/i,
- /^ago/i,
- /^sep/i,
- /^oct/i,
- /^nov/i,
- /^dic/i,
- ],
- monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
- var es = moment.defineLocale('es', {
- months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
- '_'
- ),
- monthsShort: function (m, format) {
- if (!m) {
- return monthsShortDot;
- } else if (/-MMM-/.test(format)) {
- return monthsShort[m.month()];
- } else {
- return monthsShortDot[m.month()];
- }
- },
- monthsRegex: monthsRegex,
- monthsShortRegex: monthsRegex,
- monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
- monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
- weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
- weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D [de] MMMM [de] YYYY',
- LLL: 'D [de] MMMM [de] YYYY H:mm',
- LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
- },
- calendar: {
- sameDay: function () {
- return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- nextDay: function () {
- return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- nextWeek: function () {
- return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- lastDay: function () {
- return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
- },
- lastWeek: function () {
- return (
- '[el] dddd [pasado a la' +
- (this.hours() !== 1 ? 's' : '') +
- '] LT'
- );
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'en %s',
- past: 'hace %s',
- s: 'unos segundos',
- ss: '%d segundos',
- m: 'un minuto',
- mm: '%d minutos',
- h: 'una hora',
- hh: '%d horas',
- d: 'un día',
- dd: '%d días',
- w: 'una semana',
- ww: '%d semanas',
- M: 'un mes',
- MM: '%d meses',
- y: 'un año',
- yy: '%d años',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- invalidDate: 'Fecha inválida',
- });
- return es;
- })));
- /***/ }),
- /***/ 5603:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Estonian [et]
- //! author : Henry Kehlmann : https://github.com/madhenry
- //! improvements : Illimar Tambek : https://github.com/ragulka
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function processRelativeTime(number, withoutSuffix, key, isFuture) {
- var format = {
- s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
- ss: [number + 'sekundi', number + 'sekundit'],
- m: ['ühe minuti', 'üks minut'],
- mm: [number + ' minuti', number + ' minutit'],
- h: ['ühe tunni', 'tund aega', 'üks tund'],
- hh: [number + ' tunni', number + ' tundi'],
- d: ['ühe päeva', 'üks päev'],
- M: ['kuu aja', 'kuu aega', 'üks kuu'],
- MM: [number + ' kuu', number + ' kuud'],
- y: ['ühe aasta', 'aasta', 'üks aasta'],
- yy: [number + ' aasta', number + ' aastat'],
- };
- if (withoutSuffix) {
- return format[key][2] ? format[key][2] : format[key][1];
- }
- return isFuture ? format[key][0] : format[key][1];
- }
- var et = moment.defineLocale('et', {
- months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split(
- '_'
- ),
- monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split(
- '_'
- ),
- weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split(
- '_'
- ),
- weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),
- weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY H:mm',
- LLLL: 'dddd, D. MMMM YYYY H:mm',
- },
- calendar: {
- sameDay: '[Täna,] LT',
- nextDay: '[Homme,] LT',
- nextWeek: '[Järgmine] dddd LT',
- lastDay: '[Eile,] LT',
- lastWeek: '[Eelmine] dddd LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s pärast',
- past: '%s tagasi',
- s: processRelativeTime,
- ss: processRelativeTime,
- m: processRelativeTime,
- mm: processRelativeTime,
- h: processRelativeTime,
- hh: processRelativeTime,
- d: processRelativeTime,
- dd: '%d päeva',
- M: processRelativeTime,
- MM: processRelativeTime,
- y: processRelativeTime,
- yy: processRelativeTime,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return et;
- })));
- /***/ }),
- /***/ 77763:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Basque [eu]
- //! author : Eneko Illarramendi : https://github.com/eillarra
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var eu = moment.defineLocale('eu', {
- months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split(
- '_'
- ),
- monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split(
- '_'
- ),
- weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'),
- weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY-MM-DD',
- LL: 'YYYY[ko] MMMM[ren] D[a]',
- LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm',
- LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
- l: 'YYYY-M-D',
- ll: 'YYYY[ko] MMM D[a]',
- lll: 'YYYY[ko] MMM D[a] HH:mm',
- llll: 'ddd, YYYY[ko] MMM D[a] HH:mm',
- },
- calendar: {
- sameDay: '[gaur] LT[etan]',
- nextDay: '[bihar] LT[etan]',
- nextWeek: 'dddd LT[etan]',
- lastDay: '[atzo] LT[etan]',
- lastWeek: '[aurreko] dddd LT[etan]',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s barru',
- past: 'duela %s',
- s: 'segundo batzuk',
- ss: '%d segundo',
- m: 'minutu bat',
- mm: '%d minutu',
- h: 'ordu bat',
- hh: '%d ordu',
- d: 'egun bat',
- dd: '%d egun',
- M: 'hilabete bat',
- MM: '%d hilabete',
- y: 'urte bat',
- yy: '%d urte',
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return eu;
- })));
- /***/ }),
- /***/ 76959:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Persian [fa]
- //! author : Ebrahim Byagowi : https://github.com/ebraminio
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '۱',
- 2: '۲',
- 3: '۳',
- 4: '۴',
- 5: '۵',
- 6: '۶',
- 7: '۷',
- 8: '۸',
- 9: '۹',
- 0: '۰',
- },
- numberMap = {
- '۱': '1',
- '۲': '2',
- '۳': '3',
- '۴': '4',
- '۵': '5',
- '۶': '6',
- '۷': '7',
- '۸': '8',
- '۹': '9',
- '۰': '0',
- };
- var fa = moment.defineLocale('fa', {
- months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
- '_'
- ),
- monthsShort: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
- '_'
- ),
- weekdays: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
- '_'
- ),
- weekdaysShort: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
- '_'
- ),
- weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- meridiemParse: /قبل از ظهر|بعد از ظهر/,
- isPM: function (input) {
- return /بعد از ظهر/.test(input);
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'قبل از ظهر';
- } else {
- return 'بعد از ظهر';
- }
- },
- calendar: {
- sameDay: '[امروز ساعت] LT',
- nextDay: '[فردا ساعت] LT',
- nextWeek: 'dddd [ساعت] LT',
- lastDay: '[دیروز ساعت] LT',
- lastWeek: 'dddd [پیش] [ساعت] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'در %s',
- past: '%s پیش',
- s: 'چند ثانیه',
- ss: '%d ثانیه',
- m: 'یک دقیقه',
- mm: '%d دقیقه',
- h: 'یک ساعت',
- hh: '%d ساعت',
- d: 'یک روز',
- dd: '%d روز',
- M: 'یک ماه',
- MM: '%d ماه',
- y: 'یک سال',
- yy: '%d سال',
- },
- preparse: function (string) {
- return string
- .replace(/[۰-۹]/g, function (match) {
- return numberMap[match];
- })
- .replace(/،/g, ',');
- },
- postformat: function (string) {
- return string
- .replace(/\d/g, function (match) {
- return symbolMap[match];
- })
- .replace(/,/g, '،');
- },
- dayOfMonthOrdinalParse: /\d{1,2}م/,
- ordinal: '%dم',
- week: {
- dow: 6, // Saturday is the first day of the week.
- doy: 12, // The week that contains Jan 12th is the first week of the year.
- },
- });
- return fa;
- })));
- /***/ }),
- /***/ 11897:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Finnish [fi]
- //! author : Tarmo Aidantausta : https://github.com/bleadof
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(
- ' '
- ),
- numbersFuture = [
- 'nolla',
- 'yhden',
- 'kahden',
- 'kolmen',
- 'neljän',
- 'viiden',
- 'kuuden',
- numbersPast[7],
- numbersPast[8],
- numbersPast[9],
- ];
- function translate(number, withoutSuffix, key, isFuture) {
- var result = '';
- switch (key) {
- case 's':
- return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
- case 'ss':
- result = isFuture ? 'sekunnin' : 'sekuntia';
- break;
- case 'm':
- return isFuture ? 'minuutin' : 'minuutti';
- case 'mm':
- result = isFuture ? 'minuutin' : 'minuuttia';
- break;
- case 'h':
- return isFuture ? 'tunnin' : 'tunti';
- case 'hh':
- result = isFuture ? 'tunnin' : 'tuntia';
- break;
- case 'd':
- return isFuture ? 'päivän' : 'päivä';
- case 'dd':
- result = isFuture ? 'päivän' : 'päivää';
- break;
- case 'M':
- return isFuture ? 'kuukauden' : 'kuukausi';
- case 'MM':
- result = isFuture ? 'kuukauden' : 'kuukautta';
- break;
- case 'y':
- return isFuture ? 'vuoden' : 'vuosi';
- case 'yy':
- result = isFuture ? 'vuoden' : 'vuotta';
- break;
- }
- result = verbalNumber(number, isFuture) + ' ' + result;
- return result;
- }
- function verbalNumber(number, isFuture) {
- return number < 10
- ? isFuture
- ? numbersFuture[number]
- : numbersPast[number]
- : number;
- }
- var fi = moment.defineLocale('fi', {
- months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split(
- '_'
- ),
- monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split(
- '_'
- ),
- weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split(
- '_'
- ),
- weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),
- weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),
- longDateFormat: {
- LT: 'HH.mm',
- LTS: 'HH.mm.ss',
- L: 'DD.MM.YYYY',
- LL: 'Do MMMM[ta] YYYY',
- LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',
- LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
- l: 'D.M.YYYY',
- ll: 'Do MMM YYYY',
- lll: 'Do MMM YYYY, [klo] HH.mm',
- llll: 'ddd, Do MMM YYYY, [klo] HH.mm',
- },
- calendar: {
- sameDay: '[tänään] [klo] LT',
- nextDay: '[huomenna] [klo] LT',
- nextWeek: 'dddd [klo] LT',
- lastDay: '[eilen] [klo] LT',
- lastWeek: '[viime] dddd[na] [klo] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s päästä',
- past: '%s sitten',
- s: translate,
- ss: translate,
- m: translate,
- mm: translate,
- h: translate,
- hh: translate,
- d: translate,
- dd: translate,
- M: translate,
- MM: translate,
- y: translate,
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return fi;
- })));
- /***/ }),
- /***/ 42549:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Filipino [fil]
- //! author : Dan Hagman : https://github.com/hagmandan
- //! author : Matthew Co : https://github.com/matthewdeeco
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var fil = moment.defineLocale('fil', {
- months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(
- '_'
- ),
- monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
- weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(
- '_'
- ),
- weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
- weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'MM/D/YYYY',
- LL: 'MMMM D, YYYY',
- LLL: 'MMMM D, YYYY HH:mm',
- LLLL: 'dddd, MMMM DD, YYYY HH:mm',
- },
- calendar: {
- sameDay: 'LT [ngayong araw]',
- nextDay: '[Bukas ng] LT',
- nextWeek: 'LT [sa susunod na] dddd',
- lastDay: 'LT [kahapon]',
- lastWeek: 'LT [noong nakaraang] dddd',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'sa loob ng %s',
- past: '%s ang nakalipas',
- s: 'ilang segundo',
- ss: '%d segundo',
- m: 'isang minuto',
- mm: '%d minuto',
- h: 'isang oras',
- hh: '%d oras',
- d: 'isang araw',
- dd: '%d araw',
- M: 'isang buwan',
- MM: '%d buwan',
- y: 'isang taon',
- yy: '%d taon',
- },
- dayOfMonthOrdinalParse: /\d{1,2}/,
- ordinal: function (number) {
- return number;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return fil;
- })));
- /***/ }),
- /***/ 94694:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Faroese [fo]
- //! author : Ragnar Johannesen : https://github.com/ragnar123
- //! author : Kristian Sakarisson : https://github.com/sakarisson
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var fo = moment.defineLocale('fo', {
- months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split(
- '_'
- ),
- monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
- weekdays: 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split(
- '_'
- ),
- weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
- weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D. MMMM, YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Í dag kl.] LT',
- nextDay: '[Í morgin kl.] LT',
- nextWeek: 'dddd [kl.] LT',
- lastDay: '[Í gjár kl.] LT',
- lastWeek: '[síðstu] dddd [kl] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'um %s',
- past: '%s síðani',
- s: 'fá sekund',
- ss: '%d sekundir',
- m: 'ein minuttur',
- mm: '%d minuttir',
- h: 'ein tími',
- hh: '%d tímar',
- d: 'ein dagur',
- dd: '%d dagar',
- M: 'ein mánaður',
- MM: '%d mánaðir',
- y: 'eitt ár',
- yy: '%d ár',
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return fo;
- })));
- /***/ }),
- /***/ 63049:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : French (Canada) [fr-ca]
- //! author : Jonathan Abourbih : https://github.com/jonbca
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var frCa = moment.defineLocale('fr-ca', {
- months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
- '_'
- ),
- monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
- weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
- weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY-MM-DD',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Aujourd’hui à] LT',
- nextDay: '[Demain à] LT',
- nextWeek: 'dddd [à] LT',
- lastDay: '[Hier à] LT',
- lastWeek: 'dddd [dernier à] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'dans %s',
- past: 'il y a %s',
- s: 'quelques secondes',
- ss: '%d secondes',
- m: 'une minute',
- mm: '%d minutes',
- h: 'une heure',
- hh: '%d heures',
- d: 'un jour',
- dd: '%d jours',
- M: 'un mois',
- MM: '%d mois',
- y: 'un an',
- yy: '%d ans',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
- ordinal: function (number, period) {
- switch (period) {
- // Words with masculine grammatical gender: mois, trimestre, jour
- default:
- case 'M':
- case 'Q':
- case 'D':
- case 'DDD':
- case 'd':
- return number + (number === 1 ? 'er' : 'e');
- // Words with feminine grammatical gender: semaine
- case 'w':
- case 'W':
- return number + (number === 1 ? 're' : 'e');
- }
- },
- });
- return frCa;
- })));
- /***/ }),
- /***/ 52330:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : French (Switzerland) [fr-ch]
- //! author : Gaspard Bucher : https://github.com/gaspard
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var frCh = moment.defineLocale('fr-ch', {
- months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
- '_'
- ),
- monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
- weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
- weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Aujourd’hui à] LT',
- nextDay: '[Demain à] LT',
- nextWeek: 'dddd [à] LT',
- lastDay: '[Hier à] LT',
- lastWeek: 'dddd [dernier à] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'dans %s',
- past: 'il y a %s',
- s: 'quelques secondes',
- ss: '%d secondes',
- m: 'une minute',
- mm: '%d minutes',
- h: 'une heure',
- hh: '%d heures',
- d: 'un jour',
- dd: '%d jours',
- M: 'un mois',
- MM: '%d mois',
- y: 'un an',
- yy: '%d ans',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
- ordinal: function (number, period) {
- switch (period) {
- // Words with masculine grammatical gender: mois, trimestre, jour
- default:
- case 'M':
- case 'Q':
- case 'D':
- case 'DDD':
- case 'd':
- return number + (number === 1 ? 'er' : 'e');
- // Words with feminine grammatical gender: semaine
- case 'w':
- case 'W':
- return number + (number === 1 ? 're' : 'e');
- }
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return frCh;
- })));
- /***/ }),
- /***/ 94470:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : French [fr]
- //! author : John Fischer : https://github.com/jfroffice
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var monthsStrictRegex = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
- monthsShortStrictRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,
- monthsRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
- monthsParse = [
- /^janv/i,
- /^févr/i,
- /^mars/i,
- /^avr/i,
- /^mai/i,
- /^juin/i,
- /^juil/i,
- /^août/i,
- /^sept/i,
- /^oct/i,
- /^nov/i,
- /^déc/i,
- ];
- var fr = moment.defineLocale('fr', {
- months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
- '_'
- ),
- monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
- '_'
- ),
- monthsRegex: monthsRegex,
- monthsShortRegex: monthsRegex,
- monthsStrictRegex: monthsStrictRegex,
- monthsShortStrictRegex: monthsShortStrictRegex,
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
- weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
- weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Aujourd’hui à] LT',
- nextDay: '[Demain à] LT',
- nextWeek: 'dddd [à] LT',
- lastDay: '[Hier à] LT',
- lastWeek: 'dddd [dernier à] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'dans %s',
- past: 'il y a %s',
- s: 'quelques secondes',
- ss: '%d secondes',
- m: 'une minute',
- mm: '%d minutes',
- h: 'une heure',
- hh: '%d heures',
- d: 'un jour',
- dd: '%d jours',
- w: 'une semaine',
- ww: '%d semaines',
- M: 'un mois',
- MM: '%d mois',
- y: 'un an',
- yy: '%d ans',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
- ordinal: function (number, period) {
- switch (period) {
- // TODO: Return 'e' when day of month > 1. Move this case inside
- // block for masculine words below.
- // See https://github.com/moment/moment/issues/3375
- case 'D':
- return number + (number === 1 ? 'er' : '');
- // Words with masculine grammatical gender: mois, trimestre, jour
- default:
- case 'M':
- case 'Q':
- case 'DDD':
- case 'd':
- return number + (number === 1 ? 'er' : 'e');
- // Words with feminine grammatical gender: semaine
- case 'w':
- case 'W':
- return number + (number === 1 ? 're' : 'e');
- }
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return fr;
- })));
- /***/ }),
- /***/ 5044:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Frisian [fy]
- //! author : Robin van der Vliet : https://github.com/robin0van0der0v
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split(
- '_'
- ),
- monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split(
- '_'
- );
- var fy = moment.defineLocale('fy', {
- months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split(
- '_'
- ),
- monthsShort: function (m, format) {
- if (!m) {
- return monthsShortWithDots;
- } else if (/-MMM-/.test(format)) {
- return monthsShortWithoutDots[m.month()];
- } else {
- return monthsShortWithDots[m.month()];
- }
- },
- monthsParseExact: true,
- weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split(
- '_'
- ),
- weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),
- weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD-MM-YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[hjoed om] LT',
- nextDay: '[moarn om] LT',
- nextWeek: 'dddd [om] LT',
- lastDay: '[juster om] LT',
- lastWeek: '[ôfrûne] dddd [om] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'oer %s',
- past: '%s lyn',
- s: 'in pear sekonden',
- ss: '%d sekonden',
- m: 'ien minút',
- mm: '%d minuten',
- h: 'ien oere',
- hh: '%d oeren',
- d: 'ien dei',
- dd: '%d dagen',
- M: 'ien moanne',
- MM: '%d moannen',
- y: 'ien jier',
- yy: '%d jierren',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
- ordinal: function (number) {
- return (
- number +
- (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
- );
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return fy;
- })));
- /***/ }),
- /***/ 29295:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Irish or Irish Gaelic [ga]
- //! author : André Silva : https://github.com/askpt
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var months = [
- 'Eanáir',
- 'Feabhra',
- 'Márta',
- 'Aibreán',
- 'Bealtaine',
- 'Meitheamh',
- 'Iúil',
- 'Lúnasa',
- 'Meán Fómhair',
- 'Deireadh Fómhair',
- 'Samhain',
- 'Nollaig',
- ],
- monthsShort = [
- 'Ean',
- 'Feabh',
- 'Márt',
- 'Aib',
- 'Beal',
- 'Meith',
- 'Iúil',
- 'Lún',
- 'M.F.',
- 'D.F.',
- 'Samh',
- 'Noll',
- ],
- weekdays = [
- 'Dé Domhnaigh',
- 'Dé Luain',
- 'Dé Máirt',
- 'Dé Céadaoin',
- 'Déardaoin',
- 'Dé hAoine',
- 'Dé Sathairn',
- ],
- weekdaysShort = ['Domh', 'Luan', 'Máirt', 'Céad', 'Déar', 'Aoine', 'Sath'],
- weekdaysMin = ['Do', 'Lu', 'Má', 'Cé', 'Dé', 'A', 'Sa'];
- var ga = moment.defineLocale('ga', {
- months: months,
- monthsShort: monthsShort,
- monthsParseExact: true,
- weekdays: weekdays,
- weekdaysShort: weekdaysShort,
- weekdaysMin: weekdaysMin,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Inniu ag] LT',
- nextDay: '[Amárach ag] LT',
- nextWeek: 'dddd [ag] LT',
- lastDay: '[Inné ag] LT',
- lastWeek: 'dddd [seo caite] [ag] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'i %s',
- past: '%s ó shin',
- s: 'cúpla soicind',
- ss: '%d soicind',
- m: 'nóiméad',
- mm: '%d nóiméad',
- h: 'uair an chloig',
- hh: '%d uair an chloig',
- d: 'lá',
- dd: '%d lá',
- M: 'mí',
- MM: '%d míonna',
- y: 'bliain',
- yy: '%d bliain',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
- ordinal: function (number) {
- var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return ga;
- })));
- /***/ }),
- /***/ 2101:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Scottish Gaelic [gd]
- //! author : Jon Ashdown : https://github.com/jonashdown
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var months = [
- 'Am Faoilleach',
- 'An Gearran',
- 'Am Màrt',
- 'An Giblean',
- 'An Cèitean',
- 'An t-Ògmhios',
- 'An t-Iuchar',
- 'An Lùnastal',
- 'An t-Sultain',
- 'An Dàmhair',
- 'An t-Samhain',
- 'An Dùbhlachd',
- ],
- monthsShort = [
- 'Faoi',
- 'Gear',
- 'Màrt',
- 'Gibl',
- 'Cèit',
- 'Ògmh',
- 'Iuch',
- 'Lùn',
- 'Sult',
- 'Dàmh',
- 'Samh',
- 'Dùbh',
- ],
- weekdays = [
- 'Didòmhnaich',
- 'Diluain',
- 'Dimàirt',
- 'Diciadain',
- 'Diardaoin',
- 'Dihaoine',
- 'Disathairne',
- ],
- weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'],
- weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];
- var gd = moment.defineLocale('gd', {
- months: months,
- monthsShort: monthsShort,
- monthsParseExact: true,
- weekdays: weekdays,
- weekdaysShort: weekdaysShort,
- weekdaysMin: weekdaysMin,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[An-diugh aig] LT',
- nextDay: '[A-màireach aig] LT',
- nextWeek: 'dddd [aig] LT',
- lastDay: '[An-dè aig] LT',
- lastWeek: 'dddd [seo chaidh] [aig] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'ann an %s',
- past: 'bho chionn %s',
- s: 'beagan diogan',
- ss: '%d diogan',
- m: 'mionaid',
- mm: '%d mionaidean',
- h: 'uair',
- hh: '%d uairean',
- d: 'latha',
- dd: '%d latha',
- M: 'mìos',
- MM: '%d mìosan',
- y: 'bliadhna',
- yy: '%d bliadhna',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
- ordinal: function (number) {
- var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return gd;
- })));
- /***/ }),
- /***/ 38794:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Galician [gl]
- //! author : Juan G. Hurtado : https://github.com/juanghurtado
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var gl = moment.defineLocale('gl', {
- months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split(
- '_'
- ),
- monthsShort: 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
- weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
- weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D [de] MMMM [de] YYYY',
- LLL: 'D [de] MMMM [de] YYYY H:mm',
- LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
- },
- calendar: {
- sameDay: function () {
- return '[hoxe ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
- },
- nextDay: function () {
- return '[mañá ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
- },
- nextWeek: function () {
- return 'dddd [' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT';
- },
- lastDay: function () {
- return '[onte ' + (this.hours() !== 1 ? 'á' : 'a') + '] LT';
- },
- lastWeek: function () {
- return (
- '[o] dddd [pasado ' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT'
- );
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: function (str) {
- if (str.indexOf('un') === 0) {
- return 'n' + str;
- }
- return 'en ' + str;
- },
- past: 'hai %s',
- s: 'uns segundos',
- ss: '%d segundos',
- m: 'un minuto',
- mm: '%d minutos',
- h: 'unha hora',
- hh: '%d horas',
- d: 'un día',
- dd: '%d días',
- M: 'un mes',
- MM: '%d meses',
- y: 'un ano',
- yy: '%d anos',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return gl;
- })));
- /***/ }),
- /***/ 27884:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Konkani Devanagari script [gom-deva]
- //! author : The Discoverer : https://github.com/WikiDiscoverer
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function processRelativeTime(number, withoutSuffix, key, isFuture) {
- var format = {
- s: ['थोडया सॅकंडांनी', 'थोडे सॅकंड'],
- ss: [number + ' सॅकंडांनी', number + ' सॅकंड'],
- m: ['एका मिणटान', 'एक मिनूट'],
- mm: [number + ' मिणटांनी', number + ' मिणटां'],
- h: ['एका वरान', 'एक वर'],
- hh: [number + ' वरांनी', number + ' वरां'],
- d: ['एका दिसान', 'एक दीस'],
- dd: [number + ' दिसांनी', number + ' दीस'],
- M: ['एका म्हयन्यान', 'एक म्हयनो'],
- MM: [number + ' म्हयन्यानी', number + ' म्हयने'],
- y: ['एका वर्सान', 'एक वर्स'],
- yy: [number + ' वर्सांनी', number + ' वर्सां'],
- };
- return isFuture ? format[key][0] : format[key][1];
- }
- var gomDeva = moment.defineLocale('gom-deva', {
- months: {
- standalone: 'जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(
- '_'
- ),
- format: 'जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या'.split(
- '_'
- ),
- isFormat: /MMMM(\s)+D[oD]?/,
- },
- monthsShort: 'जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार'.split('_'),
- weekdaysShort: 'आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.'.split('_'),
- weekdaysMin: 'आ_सो_मं_बु_ब्रे_सु_शे'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'A h:mm [वाजतां]',
- LTS: 'A h:mm:ss [वाजतां]',
- L: 'DD-MM-YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY A h:mm [वाजतां]',
- LLLL: 'dddd, MMMM Do, YYYY, A h:mm [वाजतां]',
- llll: 'ddd, D MMM YYYY, A h:mm [वाजतां]',
- },
- calendar: {
- sameDay: '[आयज] LT',
- nextDay: '[फाल्यां] LT',
- nextWeek: '[फुडलो] dddd[,] LT',
- lastDay: '[काल] LT',
- lastWeek: '[फाटलो] dddd[,] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s',
- past: '%s आदीं',
- s: processRelativeTime,
- ss: processRelativeTime,
- m: processRelativeTime,
- mm: processRelativeTime,
- h: processRelativeTime,
- hh: processRelativeTime,
- d: processRelativeTime,
- dd: processRelativeTime,
- M: processRelativeTime,
- MM: processRelativeTime,
- y: processRelativeTime,
- yy: processRelativeTime,
- },
- dayOfMonthOrdinalParse: /\d{1,2}(वेर)/,
- ordinal: function (number, period) {
- switch (period) {
- // the ordinal 'वेर' only applies to day of the month
- case 'D':
- return number + 'वेर';
- default:
- case 'M':
- case 'Q':
- case 'DDD':
- case 'd':
- case 'w':
- case 'W':
- return number;
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week
- doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)
- },
- meridiemParse: /राती|सकाळीं|दनपारां|सांजे/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'राती') {
- return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'सकाळीं') {
- return hour;
- } else if (meridiem === 'दनपारां') {
- return hour > 12 ? hour : hour + 12;
- } else if (meridiem === 'सांजे') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'राती';
- } else if (hour < 12) {
- return 'सकाळीं';
- } else if (hour < 16) {
- return 'दनपारां';
- } else if (hour < 20) {
- return 'सांजे';
- } else {
- return 'राती';
- }
- },
- });
- return gomDeva;
- })));
- /***/ }),
- /***/ 23168:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Konkani Latin script [gom-latn]
- //! author : The Discoverer : https://github.com/WikiDiscoverer
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function processRelativeTime(number, withoutSuffix, key, isFuture) {
- var format = {
- s: ['thoddea sekondamni', 'thodde sekond'],
- ss: [number + ' sekondamni', number + ' sekond'],
- m: ['eka mintan', 'ek minut'],
- mm: [number + ' mintamni', number + ' mintam'],
- h: ['eka voran', 'ek vor'],
- hh: [number + ' voramni', number + ' voram'],
- d: ['eka disan', 'ek dis'],
- dd: [number + ' disamni', number + ' dis'],
- M: ['eka mhoinean', 'ek mhoino'],
- MM: [number + ' mhoineamni', number + ' mhoine'],
- y: ['eka vorsan', 'ek voros'],
- yy: [number + ' vorsamni', number + ' vorsam'],
- };
- return isFuture ? format[key][0] : format[key][1];
- }
- var gomLatn = moment.defineLocale('gom-latn', {
- months: {
- standalone: 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split(
- '_'
- ),
- format: 'Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea'.split(
- '_'
- ),
- isFormat: /MMMM(\s)+D[oD]?/,
- },
- monthsShort: 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: "Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split('_'),
- weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
- weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'A h:mm [vazta]',
- LTS: 'A h:mm:ss [vazta]',
- L: 'DD-MM-YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY A h:mm [vazta]',
- LLLL: 'dddd, MMMM Do, YYYY, A h:mm [vazta]',
- llll: 'ddd, D MMM YYYY, A h:mm [vazta]',
- },
- calendar: {
- sameDay: '[Aiz] LT',
- nextDay: '[Faleam] LT',
- nextWeek: '[Fuddlo] dddd[,] LT',
- lastDay: '[Kal] LT',
- lastWeek: '[Fattlo] dddd[,] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s',
- past: '%s adim',
- s: processRelativeTime,
- ss: processRelativeTime,
- m: processRelativeTime,
- mm: processRelativeTime,
- h: processRelativeTime,
- hh: processRelativeTime,
- d: processRelativeTime,
- dd: processRelativeTime,
- M: processRelativeTime,
- MM: processRelativeTime,
- y: processRelativeTime,
- yy: processRelativeTime,
- },
- dayOfMonthOrdinalParse: /\d{1,2}(er)/,
- ordinal: function (number, period) {
- switch (period) {
- // the ordinal 'er' only applies to day of the month
- case 'D':
- return number + 'er';
- default:
- case 'M':
- case 'Q':
- case 'DDD':
- case 'd':
- case 'w':
- case 'W':
- return number;
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week
- doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)
- },
- meridiemParse: /rati|sokallim|donparam|sanje/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'rati') {
- return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'sokallim') {
- return hour;
- } else if (meridiem === 'donparam') {
- return hour > 12 ? hour : hour + 12;
- } else if (meridiem === 'sanje') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'rati';
- } else if (hour < 12) {
- return 'sokallim';
- } else if (hour < 16) {
- return 'donparam';
- } else if (hour < 20) {
- return 'sanje';
- } else {
- return 'rati';
- }
- },
- });
- return gomLatn;
- })));
- /***/ }),
- /***/ 95349:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Gujarati [gu]
- //! author : Kaushik Thanki : https://github.com/Kaushik1987
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '૧',
- 2: '૨',
- 3: '૩',
- 4: '૪',
- 5: '૫',
- 6: '૬',
- 7: '૭',
- 8: '૮',
- 9: '૯',
- 0: '૦',
- },
- numberMap = {
- '૧': '1',
- '૨': '2',
- '૩': '3',
- '૪': '4',
- '૫': '5',
- '૬': '6',
- '૭': '7',
- '૮': '8',
- '૯': '9',
- '૦': '0',
- };
- var gu = moment.defineLocale('gu', {
- months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split(
- '_'
- ),
- monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split(
- '_'
- ),
- weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
- weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
- longDateFormat: {
- LT: 'A h:mm વાગ્યે',
- LTS: 'A h:mm:ss વાગ્યે',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
- LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે',
- },
- calendar: {
- sameDay: '[આજ] LT',
- nextDay: '[કાલે] LT',
- nextWeek: 'dddd, LT',
- lastDay: '[ગઇકાલે] LT',
- lastWeek: '[પાછલા] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s મા',
- past: '%s પહેલા',
- s: 'અમુક પળો',
- ss: '%d સેકંડ',
- m: 'એક મિનિટ',
- mm: '%d મિનિટ',
- h: 'એક કલાક',
- hh: '%d કલાક',
- d: 'એક દિવસ',
- dd: '%d દિવસ',
- M: 'એક મહિનો',
- MM: '%d મહિનો',
- y: 'એક વર્ષ',
- yy: '%d વર્ષ',
- },
- preparse: function (string) {
- return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- // Gujarati notation for meridiems are quite fuzzy in practice. While there exists
- // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.
- meridiemParse: /રાત|બપોર|સવાર|સાંજ/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'રાત') {
- return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'સવાર') {
- return hour;
- } else if (meridiem === 'બપોર') {
- return hour >= 10 ? hour : hour + 12;
- } else if (meridiem === 'સાંજ') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'રાત';
- } else if (hour < 10) {
- return 'સવાર';
- } else if (hour < 17) {
- return 'બપોર';
- } else if (hour < 20) {
- return 'સાંજ';
- } else {
- return 'રાત';
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return gu;
- })));
- /***/ }),
- /***/ 24206:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Hebrew [he]
- //! author : Tomer Cohen : https://github.com/tomer
- //! author : Moshe Simantov : https://github.com/DevelopmentIL
- //! author : Tal Ater : https://github.com/TalAter
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var he = moment.defineLocale('he', {
- months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split(
- '_'
- ),
- monthsShort: 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split(
- '_'
- ),
- weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
- weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
- weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D [ב]MMMM YYYY',
- LLL: 'D [ב]MMMM YYYY HH:mm',
- LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
- l: 'D/M/YYYY',
- ll: 'D MMM YYYY',
- lll: 'D MMM YYYY HH:mm',
- llll: 'ddd, D MMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[היום ב־]LT',
- nextDay: '[מחר ב־]LT',
- nextWeek: 'dddd [בשעה] LT',
- lastDay: '[אתמול ב־]LT',
- lastWeek: '[ביום] dddd [האחרון בשעה] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'בעוד %s',
- past: 'לפני %s',
- s: 'מספר שניות',
- ss: '%d שניות',
- m: 'דקה',
- mm: '%d דקות',
- h: 'שעה',
- hh: function (number) {
- if (number === 2) {
- return 'שעתיים';
- }
- return number + ' שעות';
- },
- d: 'יום',
- dd: function (number) {
- if (number === 2) {
- return 'יומיים';
- }
- return number + ' ימים';
- },
- M: 'חודש',
- MM: function (number) {
- if (number === 2) {
- return 'חודשיים';
- }
- return number + ' חודשים';
- },
- y: 'שנה',
- yy: function (number) {
- if (number === 2) {
- return 'שנתיים';
- } else if (number % 10 === 0 && number !== 10) {
- return number + ' שנה';
- }
- return number + ' שנים';
- },
- },
- meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
- isPM: function (input) {
- return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 5) {
- return 'לפנות בוקר';
- } else if (hour < 10) {
- return 'בבוקר';
- } else if (hour < 12) {
- return isLower ? 'לפנה"צ' : 'לפני הצהריים';
- } else if (hour < 18) {
- return isLower ? 'אחה"צ' : 'אחרי הצהריים';
- } else {
- return 'בערב';
- }
- },
- });
- return he;
- })));
- /***/ }),
- /***/ 30094:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Hindi [hi]
- //! author : Mayank Singhal : https://github.com/mayanksinghal
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '१',
- 2: '२',
- 3: '३',
- 4: '४',
- 5: '५',
- 6: '६',
- 7: '७',
- 8: '८',
- 9: '९',
- 0: '०',
- },
- numberMap = {
- '१': '1',
- '२': '2',
- '३': '3',
- '४': '4',
- '५': '5',
- '६': '6',
- '७': '7',
- '८': '8',
- '९': '9',
- '०': '0',
- },
- monthsParse = [
- /^जन/i,
- /^फ़र|फर/i,
- /^मार्च/i,
- /^अप्रै/i,
- /^मई/i,
- /^जून/i,
- /^जुल/i,
- /^अग/i,
- /^सितं|सित/i,
- /^अक्टू/i,
- /^नव|नवं/i,
- /^दिसं|दिस/i,
- ],
- shortMonthsParse = [
- /^जन/i,
- /^फ़र/i,
- /^मार्च/i,
- /^अप्रै/i,
- /^मई/i,
- /^जून/i,
- /^जुल/i,
- /^अग/i,
- /^सित/i,
- /^अक्टू/i,
- /^नव/i,
- /^दिस/i,
- ];
- var hi = moment.defineLocale('hi', {
- months: {
- format: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split(
- '_'
- ),
- standalone: 'जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर'.split(
- '_'
- ),
- },
- monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split(
- '_'
- ),
- weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
- weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
- weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
- longDateFormat: {
- LT: 'A h:mm बजे',
- LTS: 'A h:mm:ss बजे',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, A h:mm बजे',
- LLLL: 'dddd, D MMMM YYYY, A h:mm बजे',
- },
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: shortMonthsParse,
- monthsRegex: /^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,
- monthsShortRegex: /^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,
- monthsStrictRegex: /^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,
- monthsShortStrictRegex: /^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,
- calendar: {
- sameDay: '[आज] LT',
- nextDay: '[कल] LT',
- nextWeek: 'dddd, LT',
- lastDay: '[कल] LT',
- lastWeek: '[पिछले] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s में',
- past: '%s पहले',
- s: 'कुछ ही क्षण',
- ss: '%d सेकंड',
- m: 'एक मिनट',
- mm: '%d मिनट',
- h: 'एक घंटा',
- hh: '%d घंटे',
- d: 'एक दिन',
- dd: '%d दिन',
- M: 'एक महीने',
- MM: '%d महीने',
- y: 'एक वर्ष',
- yy: '%d वर्ष',
- },
- preparse: function (string) {
- return string.replace(/[१२३४५६७८९०]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- // Hindi notation for meridiems are quite fuzzy in practice. While there exists
- // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
- meridiemParse: /रात|सुबह|दोपहर|शाम/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'रात') {
- return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'सुबह') {
- return hour;
- } else if (meridiem === 'दोपहर') {
- return hour >= 10 ? hour : hour + 12;
- } else if (meridiem === 'शाम') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'रात';
- } else if (hour < 10) {
- return 'सुबह';
- } else if (hour < 17) {
- return 'दोपहर';
- } else if (hour < 20) {
- return 'शाम';
- } else {
- return 'रात';
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return hi;
- })));
- /***/ }),
- /***/ 30316:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Croatian [hr]
- //! author : Bojan Marković : https://github.com/bmarkovic
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function translate(number, withoutSuffix, key) {
- var result = number + ' ';
- switch (key) {
- case 'ss':
- if (number === 1) {
- result += 'sekunda';
- } else if (number === 2 || number === 3 || number === 4) {
- result += 'sekunde';
- } else {
- result += 'sekundi';
- }
- return result;
- case 'm':
- return withoutSuffix ? 'jedna minuta' : 'jedne minute';
- case 'mm':
- if (number === 1) {
- result += 'minuta';
- } else if (number === 2 || number === 3 || number === 4) {
- result += 'minute';
- } else {
- result += 'minuta';
- }
- return result;
- case 'h':
- return withoutSuffix ? 'jedan sat' : 'jednog sata';
- case 'hh':
- if (number === 1) {
- result += 'sat';
- } else if (number === 2 || number === 3 || number === 4) {
- result += 'sata';
- } else {
- result += 'sati';
- }
- return result;
- case 'dd':
- if (number === 1) {
- result += 'dan';
- } else {
- result += 'dana';
- }
- return result;
- case 'MM':
- if (number === 1) {
- result += 'mjesec';
- } else if (number === 2 || number === 3 || number === 4) {
- result += 'mjeseca';
- } else {
- result += 'mjeseci';
- }
- return result;
- case 'yy':
- if (number === 1) {
- result += 'godina';
- } else if (number === 2 || number === 3 || number === 4) {
- result += 'godine';
- } else {
- result += 'godina';
- }
- return result;
- }
- }
- var hr = moment.defineLocale('hr', {
- months: {
- format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split(
- '_'
- ),
- standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split(
- '_'
- ),
- },
- monthsShort: 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
- '_'
- ),
- weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
- weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'Do MMMM YYYY',
- LLL: 'Do MMMM YYYY H:mm',
- LLLL: 'dddd, Do MMMM YYYY H:mm',
- },
- calendar: {
- sameDay: '[danas u] LT',
- nextDay: '[sutra u] LT',
- nextWeek: function () {
- switch (this.day()) {
- case 0:
- return '[u] [nedjelju] [u] LT';
- case 3:
- return '[u] [srijedu] [u] LT';
- case 6:
- return '[u] [subotu] [u] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[u] dddd [u] LT';
- }
- },
- lastDay: '[jučer u] LT',
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- return '[prošlu] [nedjelju] [u] LT';
- case 3:
- return '[prošlu] [srijedu] [u] LT';
- case 6:
- return '[prošle] [subote] [u] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[prošli] dddd [u] LT';
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'za %s',
- past: 'prije %s',
- s: 'par sekundi',
- ss: translate,
- m: translate,
- mm: translate,
- h: translate,
- hh: translate,
- d: 'dan',
- dd: translate,
- M: 'mjesec',
- MM: translate,
- y: 'godinu',
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return hr;
- })));
- /***/ }),
- /***/ 22138:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Hungarian [hu]
- //! author : Adam Brunner : https://github.com/adambrunner
- //! author : Peter Viszt : https://github.com/passatgt
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(
- ' '
- );
- function translate(number, withoutSuffix, key, isFuture) {
- var num = number;
- switch (key) {
- case 's':
- return isFuture || withoutSuffix
- ? 'néhány másodperc'
- : 'néhány másodperce';
- case 'ss':
- return num + (isFuture || withoutSuffix)
- ? ' másodperc'
- : ' másodperce';
- case 'm':
- return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
- case 'mm':
- return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
- case 'h':
- return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
- case 'hh':
- return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
- case 'd':
- return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
- case 'dd':
- return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
- case 'M':
- return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
- case 'MM':
- return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
- case 'y':
- return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
- case 'yy':
- return num + (isFuture || withoutSuffix ? ' év' : ' éve');
- }
- return '';
- }
- function week(isFuture) {
- return (
- (isFuture ? '' : '[múlt] ') +
- '[' +
- weekEndings[this.day()] +
- '] LT[-kor]'
- );
- }
- var hu = moment.defineLocale('hu', {
- months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split(
- '_'
- ),
- monthsShort: 'jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
- weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
- weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'YYYY.MM.DD.',
- LL: 'YYYY. MMMM D.',
- LLL: 'YYYY. MMMM D. H:mm',
- LLLL: 'YYYY. MMMM D., dddd H:mm',
- },
- meridiemParse: /de|du/i,
- isPM: function (input) {
- return input.charAt(1).toLowerCase() === 'u';
- },
- meridiem: function (hours, minutes, isLower) {
- if (hours < 12) {
- return isLower === true ? 'de' : 'DE';
- } else {
- return isLower === true ? 'du' : 'DU';
- }
- },
- calendar: {
- sameDay: '[ma] LT[-kor]',
- nextDay: '[holnap] LT[-kor]',
- nextWeek: function () {
- return week.call(this, true);
- },
- lastDay: '[tegnap] LT[-kor]',
- lastWeek: function () {
- return week.call(this, false);
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s múlva',
- past: '%s',
- s: translate,
- ss: translate,
- m: translate,
- mm: translate,
- h: translate,
- hh: translate,
- d: translate,
- dd: translate,
- M: translate,
- MM: translate,
- y: translate,
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return hu;
- })));
- /***/ }),
- /***/ 11423:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Armenian [hy-am]
- //! author : Armendarabyan : https://github.com/armendarabyan
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var hyAm = moment.defineLocale('hy-am', {
- months: {
- format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split(
- '_'
- ),
- standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split(
- '_'
- ),
- },
- monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
- weekdays: 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split(
- '_'
- ),
- weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
- weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY թ.',
- LLL: 'D MMMM YYYY թ., HH:mm',
- LLLL: 'dddd, D MMMM YYYY թ., HH:mm',
- },
- calendar: {
- sameDay: '[այսօր] LT',
- nextDay: '[վաղը] LT',
- lastDay: '[երեկ] LT',
- nextWeek: function () {
- return 'dddd [օրը ժամը] LT';
- },
- lastWeek: function () {
- return '[անցած] dddd [օրը ժամը] LT';
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s հետո',
- past: '%s առաջ',
- s: 'մի քանի վայրկյան',
- ss: '%d վայրկյան',
- m: 'րոպե',
- mm: '%d րոպե',
- h: 'ժամ',
- hh: '%d ժամ',
- d: 'օր',
- dd: '%d օր',
- M: 'ամիս',
- MM: '%d ամիս',
- y: 'տարի',
- yy: '%d տարի',
- },
- meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
- isPM: function (input) {
- return /^(ցերեկվա|երեկոյան)$/.test(input);
- },
- meridiem: function (hour) {
- if (hour < 4) {
- return 'գիշերվա';
- } else if (hour < 12) {
- return 'առավոտվա';
- } else if (hour < 17) {
- return 'ցերեկվա';
- } else {
- return 'երեկոյան';
- }
- },
- dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
- ordinal: function (number, period) {
- switch (period) {
- case 'DDD':
- case 'w':
- case 'W':
- case 'DDDo':
- if (number === 1) {
- return number + '-ին';
- }
- return number + '-րդ';
- default:
- return number;
- }
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return hyAm;
- })));
- /***/ }),
- /***/ 29218:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Indonesian [id]
- //! author : Mohammad Satrio Utomo : https://github.com/tyok
- //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var id = moment.defineLocale('id', {
- months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),
- weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
- weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
- weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
- longDateFormat: {
- LT: 'HH.mm',
- LTS: 'HH.mm.ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY [pukul] HH.mm',
- LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
- },
- meridiemParse: /pagi|siang|sore|malam/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'pagi') {
- return hour;
- } else if (meridiem === 'siang') {
- return hour >= 11 ? hour : hour + 12;
- } else if (meridiem === 'sore' || meridiem === 'malam') {
- return hour + 12;
- }
- },
- meridiem: function (hours, minutes, isLower) {
- if (hours < 11) {
- return 'pagi';
- } else if (hours < 15) {
- return 'siang';
- } else if (hours < 19) {
- return 'sore';
- } else {
- return 'malam';
- }
- },
- calendar: {
- sameDay: '[Hari ini pukul] LT',
- nextDay: '[Besok pukul] LT',
- nextWeek: 'dddd [pukul] LT',
- lastDay: '[Kemarin pukul] LT',
- lastWeek: 'dddd [lalu pukul] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'dalam %s',
- past: '%s yang lalu',
- s: 'beberapa detik',
- ss: '%d detik',
- m: 'semenit',
- mm: '%d menit',
- h: 'sejam',
- hh: '%d jam',
- d: 'sehari',
- dd: '%d hari',
- M: 'sebulan',
- MM: '%d bulan',
- y: 'setahun',
- yy: '%d tahun',
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return id;
- })));
- /***/ }),
- /***/ 90135:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Icelandic [is]
- //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function plural(n) {
- if (n % 100 === 11) {
- return true;
- } else if (n % 10 === 1) {
- return false;
- }
- return true;
- }
- function translate(number, withoutSuffix, key, isFuture) {
- var result = number + ' ';
- switch (key) {
- case 's':
- return withoutSuffix || isFuture
- ? 'nokkrar sekúndur'
- : 'nokkrum sekúndum';
- case 'ss':
- if (plural(number)) {
- return (
- result +
- (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum')
- );
- }
- return result + 'sekúnda';
- case 'm':
- return withoutSuffix ? 'mínúta' : 'mínútu';
- case 'mm':
- if (plural(number)) {
- return (
- result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum')
- );
- } else if (withoutSuffix) {
- return result + 'mínúta';
- }
- return result + 'mínútu';
- case 'hh':
- if (plural(number)) {
- return (
- result +
- (withoutSuffix || isFuture
- ? 'klukkustundir'
- : 'klukkustundum')
- );
- }
- return result + 'klukkustund';
- case 'd':
- if (withoutSuffix) {
- return 'dagur';
- }
- return isFuture ? 'dag' : 'degi';
- case 'dd':
- if (plural(number)) {
- if (withoutSuffix) {
- return result + 'dagar';
- }
- return result + (isFuture ? 'daga' : 'dögum');
- } else if (withoutSuffix) {
- return result + 'dagur';
- }
- return result + (isFuture ? 'dag' : 'degi');
- case 'M':
- if (withoutSuffix) {
- return 'mánuður';
- }
- return isFuture ? 'mánuð' : 'mánuði';
- case 'MM':
- if (plural(number)) {
- if (withoutSuffix) {
- return result + 'mánuðir';
- }
- return result + (isFuture ? 'mánuði' : 'mánuðum');
- } else if (withoutSuffix) {
- return result + 'mánuður';
- }
- return result + (isFuture ? 'mánuð' : 'mánuði');
- case 'y':
- return withoutSuffix || isFuture ? 'ár' : 'ári';
- case 'yy':
- if (plural(number)) {
- return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
- }
- return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
- }
- }
- var is = moment.defineLocale('is', {
- months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split(
- '_'
- ),
- monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
- weekdays: 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split(
- '_'
- ),
- weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
- weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY [kl.] H:mm',
- LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm',
- },
- calendar: {
- sameDay: '[í dag kl.] LT',
- nextDay: '[á morgun kl.] LT',
- nextWeek: 'dddd [kl.] LT',
- lastDay: '[í gær kl.] LT',
- lastWeek: '[síðasta] dddd [kl.] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'eftir %s',
- past: 'fyrir %s síðan',
- s: translate,
- ss: translate,
- m: translate,
- mm: translate,
- h: 'klukkustund',
- hh: translate,
- d: translate,
- dd: translate,
- M: translate,
- MM: translate,
- y: translate,
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return is;
- })));
- /***/ }),
- /***/ 10150:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Italian (Switzerland) [it-ch]
- //! author : xfh : https://github.com/xfh
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var itCh = moment.defineLocale('it-ch', {
- months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(
- '_'
- ),
- monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
- weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(
- '_'
- ),
- weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
- weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Oggi alle] LT',
- nextDay: '[Domani alle] LT',
- nextWeek: 'dddd [alle] LT',
- lastDay: '[Ieri alle] LT',
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- return '[la scorsa] dddd [alle] LT';
- default:
- return '[lo scorso] dddd [alle] LT';
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: function (s) {
- return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;
- },
- past: '%s fa',
- s: 'alcuni secondi',
- ss: '%d secondi',
- m: 'un minuto',
- mm: '%d minuti',
- h: "un'ora",
- hh: '%d ore',
- d: 'un giorno',
- dd: '%d giorni',
- M: 'un mese',
- MM: '%d mesi',
- y: 'un anno',
- yy: '%d anni',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return itCh;
- })));
- /***/ }),
- /***/ 90626:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Italian [it]
- //! author : Lorenzo : https://github.com/aliem
- //! author: Mattia Larentis: https://github.com/nostalgiaz
- //! author: Marco : https://github.com/Manfre98
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var it = moment.defineLocale('it', {
- months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(
- '_'
- ),
- monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
- weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(
- '_'
- ),
- weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
- weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: function () {
- return (
- '[Oggi a' +
- (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
- ']LT'
- );
- },
- nextDay: function () {
- return (
- '[Domani a' +
- (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
- ']LT'
- );
- },
- nextWeek: function () {
- return (
- 'dddd [a' +
- (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
- ']LT'
- );
- },
- lastDay: function () {
- return (
- '[Ieri a' +
- (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
- ']LT'
- );
- },
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- return (
- '[La scorsa] dddd [a' +
- (this.hours() > 1
- ? 'lle '
- : this.hours() === 0
- ? ' '
- : "ll'") +
- ']LT'
- );
- default:
- return (
- '[Lo scorso] dddd [a' +
- (this.hours() > 1
- ? 'lle '
- : this.hours() === 0
- ? ' '
- : "ll'") +
- ']LT'
- );
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'tra %s',
- past: '%s fa',
- s: 'alcuni secondi',
- ss: '%d secondi',
- m: 'un minuto',
- mm: '%d minuti',
- h: "un'ora",
- hh: '%d ore',
- d: 'un giorno',
- dd: '%d giorni',
- w: 'una settimana',
- ww: '%d settimane',
- M: 'un mese',
- MM: '%d mesi',
- y: 'un anno',
- yy: '%d anni',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return it;
- })));
- /***/ }),
- /***/ 39183:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Japanese [ja]
- //! author : LI Long : https://github.com/baryon
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var ja = moment.defineLocale('ja', {
- eras: [
- {
- since: '2019-05-01',
- offset: 1,
- name: '令和',
- narrow: '㋿',
- abbr: 'R',
- },
- {
- since: '1989-01-08',
- until: '2019-04-30',
- offset: 1,
- name: '平成',
- narrow: '㍻',
- abbr: 'H',
- },
- {
- since: '1926-12-25',
- until: '1989-01-07',
- offset: 1,
- name: '昭和',
- narrow: '㍼',
- abbr: 'S',
- },
- {
- since: '1912-07-30',
- until: '1926-12-24',
- offset: 1,
- name: '大正',
- narrow: '㍽',
- abbr: 'T',
- },
- {
- since: '1873-01-01',
- until: '1912-07-29',
- offset: 6,
- name: '明治',
- narrow: '㍾',
- abbr: 'M',
- },
- {
- since: '0001-01-01',
- until: '1873-12-31',
- offset: 1,
- name: '西暦',
- narrow: 'AD',
- abbr: 'AD',
- },
- {
- since: '0000-12-31',
- until: -Infinity,
- offset: 1,
- name: '紀元前',
- narrow: 'BC',
- abbr: 'BC',
- },
- ],
- eraYearOrdinalRegex: /(元|\d+)年/,
- eraYearOrdinalParse: function (input, match) {
- return match[1] === '元' ? 1 : parseInt(match[1] || input, 10);
- },
- months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
- monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
- '_'
- ),
- weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
- weekdaysShort: '日_月_火_水_木_金_土'.split('_'),
- weekdaysMin: '日_月_火_水_木_金_土'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY/MM/DD',
- LL: 'YYYY年M月D日',
- LLL: 'YYYY年M月D日 HH:mm',
- LLLL: 'YYYY年M月D日 dddd HH:mm',
- l: 'YYYY/MM/DD',
- ll: 'YYYY年M月D日',
- lll: 'YYYY年M月D日 HH:mm',
- llll: 'YYYY年M月D日(ddd) HH:mm',
- },
- meridiemParse: /午前|午後/i,
- isPM: function (input) {
- return input === '午後';
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return '午前';
- } else {
- return '午後';
- }
- },
- calendar: {
- sameDay: '[今日] LT',
- nextDay: '[明日] LT',
- nextWeek: function (now) {
- if (now.week() !== this.week()) {
- return '[来週]dddd LT';
- } else {
- return 'dddd LT';
- }
- },
- lastDay: '[昨日] LT',
- lastWeek: function (now) {
- if (this.week() !== now.week()) {
- return '[先週]dddd LT';
- } else {
- return 'dddd LT';
- }
- },
- sameElse: 'L',
- },
- dayOfMonthOrdinalParse: /\d{1,2}日/,
- ordinal: function (number, period) {
- switch (period) {
- case 'y':
- return number === 1 ? '元年' : number + '年';
- case 'd':
- case 'D':
- case 'DDD':
- return number + '日';
- default:
- return number;
- }
- },
- relativeTime: {
- future: '%s後',
- past: '%s前',
- s: '数秒',
- ss: '%d秒',
- m: '1分',
- mm: '%d分',
- h: '1時間',
- hh: '%d時間',
- d: '1日',
- dd: '%d日',
- M: '1ヶ月',
- MM: '%dヶ月',
- y: '1年',
- yy: '%d年',
- },
- });
- return ja;
- })));
- /***/ }),
- /***/ 24286:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Javanese [jv]
- //! author : Rony Lantip : https://github.com/lantip
- //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var jv = moment.defineLocale('jv', {
- months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
- weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
- weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
- weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
- longDateFormat: {
- LT: 'HH.mm',
- LTS: 'HH.mm.ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY [pukul] HH.mm',
- LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
- },
- meridiemParse: /enjing|siyang|sonten|ndalu/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'enjing') {
- return hour;
- } else if (meridiem === 'siyang') {
- return hour >= 11 ? hour : hour + 12;
- } else if (meridiem === 'sonten' || meridiem === 'ndalu') {
- return hour + 12;
- }
- },
- meridiem: function (hours, minutes, isLower) {
- if (hours < 11) {
- return 'enjing';
- } else if (hours < 15) {
- return 'siyang';
- } else if (hours < 19) {
- return 'sonten';
- } else {
- return 'ndalu';
- }
- },
- calendar: {
- sameDay: '[Dinten puniko pukul] LT',
- nextDay: '[Mbenjang pukul] LT',
- nextWeek: 'dddd [pukul] LT',
- lastDay: '[Kala wingi pukul] LT',
- lastWeek: 'dddd [kepengker pukul] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'wonten ing %s',
- past: '%s ingkang kepengker',
- s: 'sawetawis detik',
- ss: '%d detik',
- m: 'setunggal menit',
- mm: '%d menit',
- h: 'setunggal jam',
- hh: '%d jam',
- d: 'sedinten',
- dd: '%d dinten',
- M: 'sewulan',
- MM: '%d wulan',
- y: 'setaun',
- yy: '%d taun',
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return jv;
- })));
- /***/ }),
- /***/ 12105:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Georgian [ka]
- //! author : Irakli Janiashvili : https://github.com/IrakliJani
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var ka = moment.defineLocale('ka', {
- months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split(
- '_'
- ),
- monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
- weekdays: {
- standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split(
- '_'
- ),
- format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split(
- '_'
- ),
- isFormat: /(წინა|შემდეგ)/,
- },
- weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
- weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[დღეს] LT[-ზე]',
- nextDay: '[ხვალ] LT[-ზე]',
- lastDay: '[გუშინ] LT[-ზე]',
- nextWeek: '[შემდეგ] dddd LT[-ზე]',
- lastWeek: '[წინა] dddd LT-ზე',
- sameElse: 'L',
- },
- relativeTime: {
- future: function (s) {
- return s.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/, function (
- $0,
- $1,
- $2
- ) {
- return $2 === 'ი' ? $1 + 'ში' : $1 + $2 + 'ში';
- });
- },
- past: function (s) {
- if (/(წამი|წუთი|საათი|დღე|თვე)/.test(s)) {
- return s.replace(/(ი|ე)$/, 'ის წინ');
- }
- if (/წელი/.test(s)) {
- return s.replace(/წელი$/, 'წლის წინ');
- }
- return s;
- },
- s: 'რამდენიმე წამი',
- ss: '%d წამი',
- m: 'წუთი',
- mm: '%d წუთი',
- h: 'საათი',
- hh: '%d საათი',
- d: 'დღე',
- dd: '%d დღე',
- M: 'თვე',
- MM: '%d თვე',
- y: 'წელი',
- yy: '%d წელი',
- },
- dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
- ordinal: function (number) {
- if (number === 0) {
- return number;
- }
- if (number === 1) {
- return number + '-ლი';
- }
- if (
- number < 20 ||
- (number <= 100 && number % 20 === 0) ||
- number % 100 === 0
- ) {
- return 'მე-' + number;
- }
- return number + '-ე';
- },
- week: {
- dow: 1,
- doy: 7,
- },
- });
- return ka;
- })));
- /***/ }),
- /***/ 47772:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Kazakh [kk]
- //! authors : Nurlan Rakhimzhanov : https://github.com/nurlan
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var suffixes = {
- 0: '-ші',
- 1: '-ші',
- 2: '-ші',
- 3: '-ші',
- 4: '-ші',
- 5: '-ші',
- 6: '-шы',
- 7: '-ші',
- 8: '-ші',
- 9: '-шы',
- 10: '-шы',
- 20: '-шы',
- 30: '-шы',
- 40: '-шы',
- 50: '-ші',
- 60: '-шы',
- 70: '-ші',
- 80: '-ші',
- 90: '-шы',
- 100: '-ші',
- };
- var kk = moment.defineLocale('kk', {
- months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split(
- '_'
- ),
- monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
- weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split(
- '_'
- ),
- weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
- weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Бүгін сағат] LT',
- nextDay: '[Ертең сағат] LT',
- nextWeek: 'dddd [сағат] LT',
- lastDay: '[Кеше сағат] LT',
- lastWeek: '[Өткен аптаның] dddd [сағат] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s ішінде',
- past: '%s бұрын',
- s: 'бірнеше секунд',
- ss: '%d секунд',
- m: 'бір минут',
- mm: '%d минут',
- h: 'бір сағат',
- hh: '%d сағат',
- d: 'бір күн',
- dd: '%d күн',
- M: 'бір ай',
- MM: '%d ай',
- y: 'бір жыл',
- yy: '%d жыл',
- },
- dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/,
- ordinal: function (number) {
- var a = number % 10,
- b = number >= 100 ? 100 : null;
- return number + (suffixes[number] || suffixes[a] || suffixes[b]);
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return kk;
- })));
- /***/ }),
- /***/ 18758:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Cambodian [km]
- //! author : Kruy Vanna : https://github.com/kruyvanna
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '១',
- 2: '២',
- 3: '៣',
- 4: '៤',
- 5: '៥',
- 6: '៦',
- 7: '៧',
- 8: '៨',
- 9: '៩',
- 0: '០',
- },
- numberMap = {
- '១': '1',
- '២': '2',
- '៣': '3',
- '៤': '4',
- '៥': '5',
- '៦': '6',
- '៧': '7',
- '៨': '8',
- '៩': '9',
- '០': '0',
- };
- var km = moment.defineLocale('km', {
- months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
- '_'
- ),
- monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
- '_'
- ),
- weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
- weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
- weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- meridiemParse: /ព្រឹក|ល្ងាច/,
- isPM: function (input) {
- return input === 'ល្ងាច';
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'ព្រឹក';
- } else {
- return 'ល្ងាច';
- }
- },
- calendar: {
- sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
- nextDay: '[ស្អែក ម៉ោង] LT',
- nextWeek: 'dddd [ម៉ោង] LT',
- lastDay: '[ម្សិលមិញ ម៉ោង] LT',
- lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%sទៀត',
- past: '%sមុន',
- s: 'ប៉ុន្មានវិនាទី',
- ss: '%d វិនាទី',
- m: 'មួយនាទី',
- mm: '%d នាទី',
- h: 'មួយម៉ោង',
- hh: '%d ម៉ោង',
- d: 'មួយថ្ងៃ',
- dd: '%d ថ្ងៃ',
- M: 'មួយខែ',
- MM: '%d ខែ',
- y: 'មួយឆ្នាំ',
- yy: '%d ឆ្នាំ',
- },
- dayOfMonthOrdinalParse: /ទី\d{1,2}/,
- ordinal: 'ទី%d',
- preparse: function (string) {
- return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return km;
- })));
- /***/ }),
- /***/ 79282:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Kannada [kn]
- //! author : Rajeev Naik : https://github.com/rajeevnaikte
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '೧',
- 2: '೨',
- 3: '೩',
- 4: '೪',
- 5: '೫',
- 6: '೬',
- 7: '೭',
- 8: '೮',
- 9: '೯',
- 0: '೦',
- },
- numberMap = {
- '೧': '1',
- '೨': '2',
- '೩': '3',
- '೪': '4',
- '೫': '5',
- '೬': '6',
- '೭': '7',
- '೮': '8',
- '೯': '9',
- '೦': '0',
- };
- var kn = moment.defineLocale('kn', {
- months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split(
- '_'
- ),
- monthsShort: 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split(
- '_'
- ),
- weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),
- weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),
- longDateFormat: {
- LT: 'A h:mm',
- LTS: 'A h:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, A h:mm',
- LLLL: 'dddd, D MMMM YYYY, A h:mm',
- },
- calendar: {
- sameDay: '[ಇಂದು] LT',
- nextDay: '[ನಾಳೆ] LT',
- nextWeek: 'dddd, LT',
- lastDay: '[ನಿನ್ನೆ] LT',
- lastWeek: '[ಕೊನೆಯ] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s ನಂತರ',
- past: '%s ಹಿಂದೆ',
- s: 'ಕೆಲವು ಕ್ಷಣಗಳು',
- ss: '%d ಸೆಕೆಂಡುಗಳು',
- m: 'ಒಂದು ನಿಮಿಷ',
- mm: '%d ನಿಮಿಷ',
- h: 'ಒಂದು ಗಂಟೆ',
- hh: '%d ಗಂಟೆ',
- d: 'ಒಂದು ದಿನ',
- dd: '%d ದಿನ',
- M: 'ಒಂದು ತಿಂಗಳು',
- MM: '%d ತಿಂಗಳು',
- y: 'ಒಂದು ವರ್ಷ',
- yy: '%d ವರ್ಷ',
- },
- preparse: function (string) {
- return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'ರಾತ್ರಿ') {
- return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') {
- return hour;
- } else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') {
- return hour >= 10 ? hour : hour + 12;
- } else if (meridiem === 'ಸಂಜೆ') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'ರಾತ್ರಿ';
- } else if (hour < 10) {
- return 'ಬೆಳಿಗ್ಗೆ';
- } else if (hour < 17) {
- return 'ಮಧ್ಯಾಹ್ನ';
- } else if (hour < 20) {
- return 'ಸಂಜೆ';
- } else {
- return 'ರಾತ್ರಿ';
- }
- },
- dayOfMonthOrdinalParse: /\d{1,2}(ನೇ)/,
- ordinal: function (number) {
- return number + 'ನೇ';
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return kn;
- })));
- /***/ }),
- /***/ 33730:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Korean [ko]
- //! author : Kyungwook, Park : https://github.com/kyungw00k
- //! author : Jeeeyul Lee <jeeeyul@gmail.com>
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var ko = moment.defineLocale('ko', {
- months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
- monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split(
- '_'
- ),
- weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
- weekdaysShort: '일_월_화_수_목_금_토'.split('_'),
- weekdaysMin: '일_월_화_수_목_금_토'.split('_'),
- longDateFormat: {
- LT: 'A h:mm',
- LTS: 'A h:mm:ss',
- L: 'YYYY.MM.DD.',
- LL: 'YYYY년 MMMM D일',
- LLL: 'YYYY년 MMMM D일 A h:mm',
- LLLL: 'YYYY년 MMMM D일 dddd A h:mm',
- l: 'YYYY.MM.DD.',
- ll: 'YYYY년 MMMM D일',
- lll: 'YYYY년 MMMM D일 A h:mm',
- llll: 'YYYY년 MMMM D일 dddd A h:mm',
- },
- calendar: {
- sameDay: '오늘 LT',
- nextDay: '내일 LT',
- nextWeek: 'dddd LT',
- lastDay: '어제 LT',
- lastWeek: '지난주 dddd LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s 후',
- past: '%s 전',
- s: '몇 초',
- ss: '%d초',
- m: '1분',
- mm: '%d분',
- h: '한 시간',
- hh: '%d시간',
- d: '하루',
- dd: '%d일',
- M: '한 달',
- MM: '%d달',
- y: '일 년',
- yy: '%d년',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(일|월|주)/,
- ordinal: function (number, period) {
- switch (period) {
- case 'd':
- case 'D':
- case 'DDD':
- return number + '일';
- case 'M':
- return number + '월';
- case 'w':
- case 'W':
- return number + '주';
- default:
- return number;
- }
- },
- meridiemParse: /오전|오후/,
- isPM: function (token) {
- return token === '오후';
- },
- meridiem: function (hour, minute, isUpper) {
- return hour < 12 ? '오전' : '오후';
- },
- });
- return ko;
- })));
- /***/ }),
- /***/ 1408:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Kurdish [ku]
- //! author : Shahram Mebashar : https://github.com/ShahramMebashar
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '١',
- 2: '٢',
- 3: '٣',
- 4: '٤',
- 5: '٥',
- 6: '٦',
- 7: '٧',
- 8: '٨',
- 9: '٩',
- 0: '٠',
- },
- numberMap = {
- '١': '1',
- '٢': '2',
- '٣': '3',
- '٤': '4',
- '٥': '5',
- '٦': '6',
- '٧': '7',
- '٨': '8',
- '٩': '9',
- '٠': '0',
- },
- months = [
- 'کانونی دووەم',
- 'شوبات',
- 'ئازار',
- 'نیسان',
- 'ئایار',
- 'حوزەیران',
- 'تەمموز',
- 'ئاب',
- 'ئەیلوول',
- 'تشرینی یەكەم',
- 'تشرینی دووەم',
- 'كانونی یەکەم',
- ];
- var ku = moment.defineLocale('ku', {
- months: months,
- monthsShort: months,
- weekdays: 'یهكشهممه_دووشهممه_سێشهممه_چوارشهممه_پێنجشهممه_ههینی_شهممه'.split(
- '_'
- ),
- weekdaysShort: 'یهكشهم_دووشهم_سێشهم_چوارشهم_پێنجشهم_ههینی_شهممه'.split(
- '_'
- ),
- weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- meridiemParse: /ئێواره|بهیانی/,
- isPM: function (input) {
- return /ئێواره/.test(input);
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'بهیانی';
- } else {
- return 'ئێواره';
- }
- },
- calendar: {
- sameDay: '[ئهمرۆ كاتژمێر] LT',
- nextDay: '[بهیانی كاتژمێر] LT',
- nextWeek: 'dddd [كاتژمێر] LT',
- lastDay: '[دوێنێ كاتژمێر] LT',
- lastWeek: 'dddd [كاتژمێر] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'له %s',
- past: '%s',
- s: 'چهند چركهیهك',
- ss: 'چركه %d',
- m: 'یهك خولهك',
- mm: '%d خولهك',
- h: 'یهك كاتژمێر',
- hh: '%d كاتژمێر',
- d: 'یهك ڕۆژ',
- dd: '%d ڕۆژ',
- M: 'یهك مانگ',
- MM: '%d مانگ',
- y: 'یهك ساڵ',
- yy: '%d ساڵ',
- },
- preparse: function (string) {
- return string
- .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
- return numberMap[match];
- })
- .replace(/،/g, ',');
- },
- postformat: function (string) {
- return string
- .replace(/\d/g, function (match) {
- return symbolMap[match];
- })
- .replace(/,/g, '،');
- },
- week: {
- dow: 6, // Saturday is the first day of the week.
- doy: 12, // The week that contains Jan 12th is the first week of the year.
- },
- });
- return ku;
- })));
- /***/ }),
- /***/ 33291:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Kyrgyz [ky]
- //! author : Chyngyz Arystan uulu : https://github.com/chyngyz
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var suffixes = {
- 0: '-чү',
- 1: '-чи',
- 2: '-чи',
- 3: '-чү',
- 4: '-чү',
- 5: '-чи',
- 6: '-чы',
- 7: '-чи',
- 8: '-чи',
- 9: '-чу',
- 10: '-чу',
- 20: '-чы',
- 30: '-чу',
- 40: '-чы',
- 50: '-чү',
- 60: '-чы',
- 70: '-чи',
- 80: '-чи',
- 90: '-чу',
- 100: '-чү',
- };
- var ky = moment.defineLocale('ky', {
- months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(
- '_'
- ),
- monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split(
- '_'
- ),
- weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split(
- '_'
- ),
- weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
- weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Бүгүн саат] LT',
- nextDay: '[Эртең саат] LT',
- nextWeek: 'dddd [саат] LT',
- lastDay: '[Кечээ саат] LT',
- lastWeek: '[Өткөн аптанын] dddd [күнү] [саат] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s ичинде',
- past: '%s мурун',
- s: 'бирнече секунд',
- ss: '%d секунд',
- m: 'бир мүнөт',
- mm: '%d мүнөт',
- h: 'бир саат',
- hh: '%d саат',
- d: 'бир күн',
- dd: '%d күн',
- M: 'бир ай',
- MM: '%d ай',
- y: 'бир жыл',
- yy: '%d жыл',
- },
- dayOfMonthOrdinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
- ordinal: function (number) {
- var a = number % 10,
- b = number >= 100 ? 100 : null;
- return number + (suffixes[number] || suffixes[a] || suffixes[b]);
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return ky;
- })));
- /***/ }),
- /***/ 36841:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Luxembourgish [lb]
- //! author : mweimerskirch : https://github.com/mweimerskirch
- //! author : David Raison : https://github.com/kwisatz
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function processRelativeTime(number, withoutSuffix, key, isFuture) {
- var format = {
- m: ['eng Minutt', 'enger Minutt'],
- h: ['eng Stonn', 'enger Stonn'],
- d: ['een Dag', 'engem Dag'],
- M: ['ee Mount', 'engem Mount'],
- y: ['ee Joer', 'engem Joer'],
- };
- return withoutSuffix ? format[key][0] : format[key][1];
- }
- function processFutureTime(string) {
- var number = string.substr(0, string.indexOf(' '));
- if (eifelerRegelAppliesToNumber(number)) {
- return 'a ' + string;
- }
- return 'an ' + string;
- }
- function processPastTime(string) {
- var number = string.substr(0, string.indexOf(' '));
- if (eifelerRegelAppliesToNumber(number)) {
- return 'viru ' + string;
- }
- return 'virun ' + string;
- }
- /**
- * Returns true if the word before the given number loses the '-n' ending.
- * e.g. 'an 10 Deeg' but 'a 5 Deeg'
- *
- * @param number {integer}
- * @returns {boolean}
- */
- function eifelerRegelAppliesToNumber(number) {
- number = parseInt(number, 10);
- if (isNaN(number)) {
- return false;
- }
- if (number < 0) {
- // Negative Number --> always true
- return true;
- } else if (number < 10) {
- // Only 1 digit
- if (4 <= number && number <= 7) {
- return true;
- }
- return false;
- } else if (number < 100) {
- // 2 digits
- var lastDigit = number % 10,
- firstDigit = number / 10;
- if (lastDigit === 0) {
- return eifelerRegelAppliesToNumber(firstDigit);
- }
- return eifelerRegelAppliesToNumber(lastDigit);
- } else if (number < 10000) {
- // 3 or 4 digits --> recursively check first digit
- while (number >= 10) {
- number = number / 10;
- }
- return eifelerRegelAppliesToNumber(number);
- } else {
- // Anything larger than 4 digits: recursively check first n-3 digits
- number = number / 1000;
- return eifelerRegelAppliesToNumber(number);
- }
- }
- var lb = moment.defineLocale('lb', {
- months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split(
- '_'
- ),
- monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split(
- '_'
- ),
- weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
- weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm [Auer]',
- LTS: 'H:mm:ss [Auer]',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY H:mm [Auer]',
- LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]',
- },
- calendar: {
- sameDay: '[Haut um] LT',
- sameElse: 'L',
- nextDay: '[Muer um] LT',
- nextWeek: 'dddd [um] LT',
- lastDay: '[Gëschter um] LT',
- lastWeek: function () {
- // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
- switch (this.day()) {
- case 2:
- case 4:
- return '[Leschten] dddd [um] LT';
- default:
- return '[Leschte] dddd [um] LT';
- }
- },
- },
- relativeTime: {
- future: processFutureTime,
- past: processPastTime,
- s: 'e puer Sekonnen',
- ss: '%d Sekonnen',
- m: processRelativeTime,
- mm: '%d Minutten',
- h: processRelativeTime,
- hh: '%d Stonnen',
- d: processRelativeTime,
- dd: '%d Deeg',
- M: processRelativeTime,
- MM: '%d Méint',
- y: processRelativeTime,
- yy: '%d Joer',
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return lb;
- })));
- /***/ }),
- /***/ 55466:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Lao [lo]
- //! author : Ryan Hart : https://github.com/ryanhart2
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var lo = moment.defineLocale('lo', {
- months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(
- '_'
- ),
- monthsShort: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(
- '_'
- ),
- weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
- weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
- weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'ວັນdddd D MMMM YYYY HH:mm',
- },
- meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
- isPM: function (input) {
- return input === 'ຕອນແລງ';
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'ຕອນເຊົ້າ';
- } else {
- return 'ຕອນແລງ';
- }
- },
- calendar: {
- sameDay: '[ມື້ນີ້ເວລາ] LT',
- nextDay: '[ມື້ອື່ນເວລາ] LT',
- nextWeek: '[ວັນ]dddd[ໜ້າເວລາ] LT',
- lastDay: '[ມື້ວານນີ້ເວລາ] LT',
- lastWeek: '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'ອີກ %s',
- past: '%sຜ່ານມາ',
- s: 'ບໍ່ເທົ່າໃດວິນາທີ',
- ss: '%d ວິນາທີ',
- m: '1 ນາທີ',
- mm: '%d ນາທີ',
- h: '1 ຊົ່ວໂມງ',
- hh: '%d ຊົ່ວໂມງ',
- d: '1 ມື້',
- dd: '%d ມື້',
- M: '1 ເດືອນ',
- MM: '%d ເດືອນ',
- y: '1 ປີ',
- yy: '%d ປີ',
- },
- dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/,
- ordinal: function (number) {
- return 'ທີ່' + number;
- },
- });
- return lo;
- })));
- /***/ }),
- /***/ 57010:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Lithuanian [lt]
- //! author : Mindaugas Mozūras : https://github.com/mmozuras
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var units = {
- ss: 'sekundė_sekundžių_sekundes',
- m: 'minutė_minutės_minutę',
- mm: 'minutės_minučių_minutes',
- h: 'valanda_valandos_valandą',
- hh: 'valandos_valandų_valandas',
- d: 'diena_dienos_dieną',
- dd: 'dienos_dienų_dienas',
- M: 'mėnuo_mėnesio_mėnesį',
- MM: 'mėnesiai_mėnesių_mėnesius',
- y: 'metai_metų_metus',
- yy: 'metai_metų_metus',
- };
- function translateSeconds(number, withoutSuffix, key, isFuture) {
- if (withoutSuffix) {
- return 'kelios sekundės';
- } else {
- return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
- }
- }
- function translateSingular(number, withoutSuffix, key, isFuture) {
- return withoutSuffix
- ? forms(key)[0]
- : isFuture
- ? forms(key)[1]
- : forms(key)[2];
- }
- function special(number) {
- return number % 10 === 0 || (number > 10 && number < 20);
- }
- function forms(key) {
- return units[key].split('_');
- }
- function translate(number, withoutSuffix, key, isFuture) {
- var result = number + ' ';
- if (number === 1) {
- return (
- result + translateSingular(number, withoutSuffix, key[0], isFuture)
- );
- } else if (withoutSuffix) {
- return result + (special(number) ? forms(key)[1] : forms(key)[0]);
- } else {
- if (isFuture) {
- return result + forms(key)[1];
- } else {
- return result + (special(number) ? forms(key)[1] : forms(key)[2]);
- }
- }
- }
- var lt = moment.defineLocale('lt', {
- months: {
- format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split(
- '_'
- ),
- standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split(
- '_'
- ),
- isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,
- },
- monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
- weekdays: {
- format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split(
- '_'
- ),
- standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split(
- '_'
- ),
- isFormat: /dddd HH:mm/,
- },
- weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
- weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY-MM-DD',
- LL: 'YYYY [m.] MMMM D [d.]',
- LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
- LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
- l: 'YYYY-MM-DD',
- ll: 'YYYY [m.] MMMM D [d.]',
- lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
- llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]',
- },
- calendar: {
- sameDay: '[Šiandien] LT',
- nextDay: '[Rytoj] LT',
- nextWeek: 'dddd LT',
- lastDay: '[Vakar] LT',
- lastWeek: '[Praėjusį] dddd LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'po %s',
- past: 'prieš %s',
- s: translateSeconds,
- ss: translate,
- m: translateSingular,
- mm: translate,
- h: translateSingular,
- hh: translate,
- d: translateSingular,
- dd: translate,
- M: translateSingular,
- MM: translate,
- y: translateSingular,
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}-oji/,
- ordinal: function (number) {
- return number + '-oji';
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return lt;
- })));
- /***/ }),
- /***/ 37595:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Latvian [lv]
- //! author : Kristaps Karlsons : https://github.com/skakri
- //! author : Jānis Elmeris : https://github.com/JanisE
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var units = {
- ss: 'sekundes_sekundēm_sekunde_sekundes'.split('_'),
- m: 'minūtes_minūtēm_minūte_minūtes'.split('_'),
- mm: 'minūtes_minūtēm_minūte_minūtes'.split('_'),
- h: 'stundas_stundām_stunda_stundas'.split('_'),
- hh: 'stundas_stundām_stunda_stundas'.split('_'),
- d: 'dienas_dienām_diena_dienas'.split('_'),
- dd: 'dienas_dienām_diena_dienas'.split('_'),
- M: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
- MM: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
- y: 'gada_gadiem_gads_gadi'.split('_'),
- yy: 'gada_gadiem_gads_gadi'.split('_'),
- };
- /**
- * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
- */
- function format(forms, number, withoutSuffix) {
- if (withoutSuffix) {
- // E.g. "21 minūte", "3 minūtes".
- return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];
- } else {
- // E.g. "21 minūtes" as in "pēc 21 minūtes".
- // E.g. "3 minūtēm" as in "pēc 3 minūtēm".
- return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];
- }
- }
- function relativeTimeWithPlural(number, withoutSuffix, key) {
- return number + ' ' + format(units[key], number, withoutSuffix);
- }
- function relativeTimeWithSingular(number, withoutSuffix, key) {
- return format(units[key], number, withoutSuffix);
- }
- function relativeSeconds(number, withoutSuffix) {
- return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
- }
- var lv = moment.defineLocale('lv', {
- months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split(
- '_'
- ),
- monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
- weekdays: 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split(
- '_'
- ),
- weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),
- weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY.',
- LL: 'YYYY. [gada] D. MMMM',
- LLL: 'YYYY. [gada] D. MMMM, HH:mm',
- LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm',
- },
- calendar: {
- sameDay: '[Šodien pulksten] LT',
- nextDay: '[Rīt pulksten] LT',
- nextWeek: 'dddd [pulksten] LT',
- lastDay: '[Vakar pulksten] LT',
- lastWeek: '[Pagājušā] dddd [pulksten] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'pēc %s',
- past: 'pirms %s',
- s: relativeSeconds,
- ss: relativeTimeWithPlural,
- m: relativeTimeWithSingular,
- mm: relativeTimeWithPlural,
- h: relativeTimeWithSingular,
- hh: relativeTimeWithPlural,
- d: relativeTimeWithSingular,
- dd: relativeTimeWithPlural,
- M: relativeTimeWithSingular,
- MM: relativeTimeWithPlural,
- y: relativeTimeWithSingular,
- yy: relativeTimeWithPlural,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return lv;
- })));
- /***/ }),
- /***/ 39861:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Montenegrin [me]
- //! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var translator = {
- words: {
- //Different grammatical cases
- ss: ['sekund', 'sekunda', 'sekundi'],
- m: ['jedan minut', 'jednog minuta'],
- mm: ['minut', 'minuta', 'minuta'],
- h: ['jedan sat', 'jednog sata'],
- hh: ['sat', 'sata', 'sati'],
- dd: ['dan', 'dana', 'dana'],
- MM: ['mjesec', 'mjeseca', 'mjeseci'],
- yy: ['godina', 'godine', 'godina'],
- },
- correctGrammaticalCase: function (number, wordKey) {
- return number === 1
- ? wordKey[0]
- : number >= 2 && number <= 4
- ? wordKey[1]
- : wordKey[2];
- },
- translate: function (number, withoutSuffix, key) {
- var wordKey = translator.words[key];
- if (key.length === 1) {
- return withoutSuffix ? wordKey[0] : wordKey[1];
- } else {
- return (
- number +
- ' ' +
- translator.correctGrammaticalCase(number, wordKey)
- );
- }
- },
- };
- var me = moment.defineLocale('me', {
- months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
- '_'
- ),
- monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
- '_'
- ),
- weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
- weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY H:mm',
- LLLL: 'dddd, D. MMMM YYYY H:mm',
- },
- calendar: {
- sameDay: '[danas u] LT',
- nextDay: '[sjutra u] LT',
- nextWeek: function () {
- switch (this.day()) {
- case 0:
- return '[u] [nedjelju] [u] LT';
- case 3:
- return '[u] [srijedu] [u] LT';
- case 6:
- return '[u] [subotu] [u] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[u] dddd [u] LT';
- }
- },
- lastDay: '[juče u] LT',
- lastWeek: function () {
- var lastWeekDays = [
- '[prošle] [nedjelje] [u] LT',
- '[prošlog] [ponedjeljka] [u] LT',
- '[prošlog] [utorka] [u] LT',
- '[prošle] [srijede] [u] LT',
- '[prošlog] [četvrtka] [u] LT',
- '[prošlog] [petka] [u] LT',
- '[prošle] [subote] [u] LT',
- ];
- return lastWeekDays[this.day()];
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'za %s',
- past: 'prije %s',
- s: 'nekoliko sekundi',
- ss: translator.translate,
- m: translator.translate,
- mm: translator.translate,
- h: translator.translate,
- hh: translator.translate,
- d: 'dan',
- dd: translator.translate,
- M: 'mjesec',
- MM: translator.translate,
- y: 'godinu',
- yy: translator.translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return me;
- })));
- /***/ }),
- /***/ 35493:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Maori [mi]
- //! author : John Corrigan <robbiecloset@gmail.com> : https://github.com/johnideal
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var mi = moment.defineLocale('mi', {
- months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split(
- '_'
- ),
- monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split(
- '_'
- ),
- monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
- monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
- monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
- monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,
- weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
- weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
- weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY [i] HH:mm',
- LLLL: 'dddd, D MMMM YYYY [i] HH:mm',
- },
- calendar: {
- sameDay: '[i teie mahana, i] LT',
- nextDay: '[apopo i] LT',
- nextWeek: 'dddd [i] LT',
- lastDay: '[inanahi i] LT',
- lastWeek: 'dddd [whakamutunga i] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'i roto i %s',
- past: '%s i mua',
- s: 'te hēkona ruarua',
- ss: '%d hēkona',
- m: 'he meneti',
- mm: '%d meneti',
- h: 'te haora',
- hh: '%d haora',
- d: 'he ra',
- dd: '%d ra',
- M: 'he marama',
- MM: '%d marama',
- y: 'he tau',
- yy: '%d tau',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return mi;
- })));
- /***/ }),
- /***/ 95966:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Macedonian [mk]
- //! author : Borislav Mickov : https://github.com/B0k0
- //! author : Sashko Todorov : https://github.com/bkyceh
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var mk = moment.defineLocale('mk', {
- months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split(
- '_'
- ),
- monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
- weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split(
- '_'
- ),
- weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
- weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'),
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'D.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY H:mm',
- LLLL: 'dddd, D MMMM YYYY H:mm',
- },
- calendar: {
- sameDay: '[Денес во] LT',
- nextDay: '[Утре во] LT',
- nextWeek: '[Во] dddd [во] LT',
- lastDay: '[Вчера во] LT',
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- case 3:
- case 6:
- return '[Изминатата] dddd [во] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[Изминатиот] dddd [во] LT';
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'за %s',
- past: 'пред %s',
- s: 'неколку секунди',
- ss: '%d секунди',
- m: 'една минута',
- mm: '%d минути',
- h: 'еден час',
- hh: '%d часа',
- d: 'еден ден',
- dd: '%d дена',
- M: 'еден месец',
- MM: '%d месеци',
- y: 'една година',
- yy: '%d години',
- },
- dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
- ordinal: function (number) {
- var lastDigit = number % 10,
- last2Digits = number % 100;
- if (number === 0) {
- return number + '-ев';
- } else if (last2Digits === 0) {
- return number + '-ен';
- } else if (last2Digits > 10 && last2Digits < 20) {
- return number + '-ти';
- } else if (lastDigit === 1) {
- return number + '-ви';
- } else if (lastDigit === 2) {
- return number + '-ри';
- } else if (lastDigit === 7 || lastDigit === 8) {
- return number + '-ми';
- } else {
- return number + '-ти';
- }
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return mk;
- })));
- /***/ }),
- /***/ 87341:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Malayalam [ml]
- //! author : Floyd Pink : https://github.com/floydpink
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var ml = moment.defineLocale('ml', {
- months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split(
- '_'
- ),
- monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split(
- '_'
- ),
- weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
- weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
- longDateFormat: {
- LT: 'A h:mm -നു',
- LTS: 'A h:mm:ss -നു',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, A h:mm -നു',
- LLLL: 'dddd, D MMMM YYYY, A h:mm -നു',
- },
- calendar: {
- sameDay: '[ഇന്ന്] LT',
- nextDay: '[നാളെ] LT',
- nextWeek: 'dddd, LT',
- lastDay: '[ഇന്നലെ] LT',
- lastWeek: '[കഴിഞ്ഞ] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s കഴിഞ്ഞ്',
- past: '%s മുൻപ്',
- s: 'അൽപ നിമിഷങ്ങൾ',
- ss: '%d സെക്കൻഡ്',
- m: 'ഒരു മിനിറ്റ്',
- mm: '%d മിനിറ്റ്',
- h: 'ഒരു മണിക്കൂർ',
- hh: '%d മണിക്കൂർ',
- d: 'ഒരു ദിവസം',
- dd: '%d ദിവസം',
- M: 'ഒരു മാസം',
- MM: '%d മാസം',
- y: 'ഒരു വർഷം',
- yy: '%d വർഷം',
- },
- meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (
- (meridiem === 'രാത്രി' && hour >= 4) ||
- meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||
- meridiem === 'വൈകുന്നേരം'
- ) {
- return hour + 12;
- } else {
- return hour;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'രാത്രി';
- } else if (hour < 12) {
- return 'രാവിലെ';
- } else if (hour < 17) {
- return 'ഉച്ച കഴിഞ്ഞ്';
- } else if (hour < 20) {
- return 'വൈകുന്നേരം';
- } else {
- return 'രാത്രി';
- }
- },
- });
- return ml;
- })));
- /***/ }),
- /***/ 5115:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Mongolian [mn]
- //! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function translate(number, withoutSuffix, key, isFuture) {
- switch (key) {
- case 's':
- return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';
- case 'ss':
- return number + (withoutSuffix ? ' секунд' : ' секундын');
- case 'm':
- case 'mm':
- return number + (withoutSuffix ? ' минут' : ' минутын');
- case 'h':
- case 'hh':
- return number + (withoutSuffix ? ' цаг' : ' цагийн');
- case 'd':
- case 'dd':
- return number + (withoutSuffix ? ' өдөр' : ' өдрийн');
- case 'M':
- case 'MM':
- return number + (withoutSuffix ? ' сар' : ' сарын');
- case 'y':
- case 'yy':
- return number + (withoutSuffix ? ' жил' : ' жилийн');
- default:
- return number;
- }
- }
- var mn = moment.defineLocale('mn', {
- months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split(
- '_'
- ),
- monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),
- weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
- weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY-MM-DD',
- LL: 'YYYY оны MMMMын D',
- LLL: 'YYYY оны MMMMын D HH:mm',
- LLLL: 'dddd, YYYY оны MMMMын D HH:mm',
- },
- meridiemParse: /ҮӨ|ҮХ/i,
- isPM: function (input) {
- return input === 'ҮХ';
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'ҮӨ';
- } else {
- return 'ҮХ';
- }
- },
- calendar: {
- sameDay: '[Өнөөдөр] LT',
- nextDay: '[Маргааш] LT',
- nextWeek: '[Ирэх] dddd LT',
- lastDay: '[Өчигдөр] LT',
- lastWeek: '[Өнгөрсөн] dddd LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s дараа',
- past: '%s өмнө',
- s: translate,
- ss: translate,
- m: translate,
- mm: translate,
- h: translate,
- hh: translate,
- d: translate,
- dd: translate,
- M: translate,
- MM: translate,
- y: translate,
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2} өдөр/,
- ordinal: function (number, period) {
- switch (period) {
- case 'd':
- case 'D':
- case 'DDD':
- return number + ' өдөр';
- default:
- return number;
- }
- },
- });
- return mn;
- })));
- /***/ }),
- /***/ 10370:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Marathi [mr]
- //! author : Harshad Kale : https://github.com/kalehv
- //! author : Vivek Athalye : https://github.com/vnathalye
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '१',
- 2: '२',
- 3: '३',
- 4: '४',
- 5: '५',
- 6: '६',
- 7: '७',
- 8: '८',
- 9: '९',
- 0: '०',
- },
- numberMap = {
- '१': '1',
- '२': '2',
- '३': '3',
- '४': '4',
- '५': '5',
- '६': '6',
- '७': '7',
- '८': '8',
- '९': '9',
- '०': '0',
- };
- function relativeTimeMr(number, withoutSuffix, string, isFuture) {
- var output = '';
- if (withoutSuffix) {
- switch (string) {
- case 's':
- output = 'काही सेकंद';
- break;
- case 'ss':
- output = '%d सेकंद';
- break;
- case 'm':
- output = 'एक मिनिट';
- break;
- case 'mm':
- output = '%d मिनिटे';
- break;
- case 'h':
- output = 'एक तास';
- break;
- case 'hh':
- output = '%d तास';
- break;
- case 'd':
- output = 'एक दिवस';
- break;
- case 'dd':
- output = '%d दिवस';
- break;
- case 'M':
- output = 'एक महिना';
- break;
- case 'MM':
- output = '%d महिने';
- break;
- case 'y':
- output = 'एक वर्ष';
- break;
- case 'yy':
- output = '%d वर्षे';
- break;
- }
- } else {
- switch (string) {
- case 's':
- output = 'काही सेकंदां';
- break;
- case 'ss':
- output = '%d सेकंदां';
- break;
- case 'm':
- output = 'एका मिनिटा';
- break;
- case 'mm':
- output = '%d मिनिटां';
- break;
- case 'h':
- output = 'एका तासा';
- break;
- case 'hh':
- output = '%d तासां';
- break;
- case 'd':
- output = 'एका दिवसा';
- break;
- case 'dd':
- output = '%d दिवसां';
- break;
- case 'M':
- output = 'एका महिन्या';
- break;
- case 'MM':
- output = '%d महिन्यां';
- break;
- case 'y':
- output = 'एका वर्षा';
- break;
- case 'yy':
- output = '%d वर्षां';
- break;
- }
- }
- return output.replace(/%d/i, number);
- }
- var mr = moment.defineLocale('mr', {
- months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(
- '_'
- ),
- monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
- weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
- weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
- longDateFormat: {
- LT: 'A h:mm वाजता',
- LTS: 'A h:mm:ss वाजता',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, A h:mm वाजता',
- LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता',
- },
- calendar: {
- sameDay: '[आज] LT',
- nextDay: '[उद्या] LT',
- nextWeek: 'dddd, LT',
- lastDay: '[काल] LT',
- lastWeek: '[मागील] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%sमध्ये',
- past: '%sपूर्वी',
- s: relativeTimeMr,
- ss: relativeTimeMr,
- m: relativeTimeMr,
- mm: relativeTimeMr,
- h: relativeTimeMr,
- hh: relativeTimeMr,
- d: relativeTimeMr,
- dd: relativeTimeMr,
- M: relativeTimeMr,
- MM: relativeTimeMr,
- y: relativeTimeMr,
- yy: relativeTimeMr,
- },
- preparse: function (string) {
- return string.replace(/[१२३४५६७८९०]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- meridiemParse: /पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'पहाटे' || meridiem === 'सकाळी') {
- return hour;
- } else if (
- meridiem === 'दुपारी' ||
- meridiem === 'सायंकाळी' ||
- meridiem === 'रात्री'
- ) {
- return hour >= 12 ? hour : hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour >= 0 && hour < 6) {
- return 'पहाटे';
- } else if (hour < 12) {
- return 'सकाळी';
- } else if (hour < 17) {
- return 'दुपारी';
- } else if (hour < 20) {
- return 'सायंकाळी';
- } else {
- return 'रात्री';
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return mr;
- })));
- /***/ }),
- /***/ 41237:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Malay [ms-my]
- //! note : DEPRECATED, the correct one is [ms]
- //! author : Weldan Jamili : https://github.com/weldan
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var msMy = moment.defineLocale('ms-my', {
- months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
- weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
- weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
- weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
- longDateFormat: {
- LT: 'HH.mm',
- LTS: 'HH.mm.ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY [pukul] HH.mm',
- LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
- },
- meridiemParse: /pagi|tengahari|petang|malam/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'pagi') {
- return hour;
- } else if (meridiem === 'tengahari') {
- return hour >= 11 ? hour : hour + 12;
- } else if (meridiem === 'petang' || meridiem === 'malam') {
- return hour + 12;
- }
- },
- meridiem: function (hours, minutes, isLower) {
- if (hours < 11) {
- return 'pagi';
- } else if (hours < 15) {
- return 'tengahari';
- } else if (hours < 19) {
- return 'petang';
- } else {
- return 'malam';
- }
- },
- calendar: {
- sameDay: '[Hari ini pukul] LT',
- nextDay: '[Esok pukul] LT',
- nextWeek: 'dddd [pukul] LT',
- lastDay: '[Kelmarin pukul] LT',
- lastWeek: 'dddd [lepas pukul] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'dalam %s',
- past: '%s yang lepas',
- s: 'beberapa saat',
- ss: '%d saat',
- m: 'seminit',
- mm: '%d minit',
- h: 'sejam',
- hh: '%d jam',
- d: 'sehari',
- dd: '%d hari',
- M: 'sebulan',
- MM: '%d bulan',
- y: 'setahun',
- yy: '%d tahun',
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return msMy;
- })));
- /***/ }),
- /***/ 9847:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Malay [ms]
- //! author : Weldan Jamili : https://github.com/weldan
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var ms = moment.defineLocale('ms', {
- months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
- weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
- weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
- weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
- longDateFormat: {
- LT: 'HH.mm',
- LTS: 'HH.mm.ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY [pukul] HH.mm',
- LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
- },
- meridiemParse: /pagi|tengahari|petang|malam/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'pagi') {
- return hour;
- } else if (meridiem === 'tengahari') {
- return hour >= 11 ? hour : hour + 12;
- } else if (meridiem === 'petang' || meridiem === 'malam') {
- return hour + 12;
- }
- },
- meridiem: function (hours, minutes, isLower) {
- if (hours < 11) {
- return 'pagi';
- } else if (hours < 15) {
- return 'tengahari';
- } else if (hours < 19) {
- return 'petang';
- } else {
- return 'malam';
- }
- },
- calendar: {
- sameDay: '[Hari ini pukul] LT',
- nextDay: '[Esok pukul] LT',
- nextWeek: 'dddd [pukul] LT',
- lastDay: '[Kelmarin pukul] LT',
- lastWeek: 'dddd [lepas pukul] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'dalam %s',
- past: '%s yang lepas',
- s: 'beberapa saat',
- ss: '%d saat',
- m: 'seminit',
- mm: '%d minit',
- h: 'sejam',
- hh: '%d jam',
- d: 'sehari',
- dd: '%d hari',
- M: 'sebulan',
- MM: '%d bulan',
- y: 'setahun',
- yy: '%d tahun',
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return ms;
- })));
- /***/ }),
- /***/ 72126:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Maltese (Malta) [mt]
- //! author : Alessandro Maruccia : https://github.com/alesma
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var mt = moment.defineLocale('mt', {
- months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split(
- '_'
- ),
- monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),
- weekdays: 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split(
- '_'
- ),
- weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),
- weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Illum fil-]LT',
- nextDay: '[Għada fil-]LT',
- nextWeek: 'dddd [fil-]LT',
- lastDay: '[Il-bieraħ fil-]LT',
- lastWeek: 'dddd [li għadda] [fil-]LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'f’ %s',
- past: '%s ilu',
- s: 'ftit sekondi',
- ss: '%d sekondi',
- m: 'minuta',
- mm: '%d minuti',
- h: 'siegħa',
- hh: '%d siegħat',
- d: 'ġurnata',
- dd: '%d ġranet',
- M: 'xahar',
- MM: '%d xhur',
- y: 'sena',
- yy: '%d sni',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return mt;
- })));
- /***/ }),
- /***/ 56165:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Burmese [my]
- //! author : Squar team, mysquar.com
- //! author : David Rossellat : https://github.com/gholadr
- //! author : Tin Aung Lin : https://github.com/thanyawzinmin
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '၁',
- 2: '၂',
- 3: '၃',
- 4: '၄',
- 5: '၅',
- 6: '၆',
- 7: '၇',
- 8: '၈',
- 9: '၉',
- 0: '၀',
- },
- numberMap = {
- '၁': '1',
- '၂': '2',
- '၃': '3',
- '၄': '4',
- '၅': '5',
- '၆': '6',
- '၇': '7',
- '၈': '8',
- '၉': '9',
- '၀': '0',
- };
- var my = moment.defineLocale('my', {
- months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split(
- '_'
- ),
- monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
- weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split(
- '_'
- ),
- weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
- weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[ယနေ.] LT [မှာ]',
- nextDay: '[မနက်ဖြန်] LT [မှာ]',
- nextWeek: 'dddd LT [မှာ]',
- lastDay: '[မနေ.က] LT [မှာ]',
- lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'လာမည့် %s မှာ',
- past: 'လွန်ခဲ့သော %s က',
- s: 'စက္ကန်.အနည်းငယ်',
- ss: '%d စက္ကန့်',
- m: 'တစ်မိနစ်',
- mm: '%d မိနစ်',
- h: 'တစ်နာရီ',
- hh: '%d နာရီ',
- d: 'တစ်ရက်',
- dd: '%d ရက်',
- M: 'တစ်လ',
- MM: '%d လ',
- y: 'တစ်နှစ်',
- yy: '%d နှစ်',
- },
- preparse: function (string) {
- return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return my;
- })));
- /***/ }),
- /***/ 64924:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Norwegian Bokmål [nb]
- //! authors : Espen Hovlandsdal : https://github.com/rexxars
- //! Sigurd Gartmann : https://github.com/sigurdga
- //! Stephen Ramthun : https://github.com/stephenramthun
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var nb = moment.defineLocale('nb', {
- months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(
- '_'
- ),
- monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
- weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),
- weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY [kl.] HH:mm',
- LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',
- },
- calendar: {
- sameDay: '[i dag kl.] LT',
- nextDay: '[i morgen kl.] LT',
- nextWeek: 'dddd [kl.] LT',
- lastDay: '[i går kl.] LT',
- lastWeek: '[forrige] dddd [kl.] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'om %s',
- past: '%s siden',
- s: 'noen sekunder',
- ss: '%d sekunder',
- m: 'ett minutt',
- mm: '%d minutter',
- h: 'en time',
- hh: '%d timer',
- d: 'en dag',
- dd: '%d dager',
- w: 'en uke',
- ww: '%d uker',
- M: 'en måned',
- MM: '%d måneder',
- y: 'ett år',
- yy: '%d år',
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return nb;
- })));
- /***/ }),
- /***/ 16744:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Nepalese [ne]
- //! author : suvash : https://github.com/suvash
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '१',
- 2: '२',
- 3: '३',
- 4: '४',
- 5: '५',
- 6: '६',
- 7: '७',
- 8: '८',
- 9: '९',
- 0: '०',
- },
- numberMap = {
- '१': '1',
- '२': '2',
- '३': '3',
- '४': '4',
- '५': '5',
- '६': '6',
- '७': '7',
- '८': '8',
- '९': '9',
- '०': '0',
- };
- var ne = moment.defineLocale('ne', {
- months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split(
- '_'
- ),
- monthsShort: 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split(
- '_'
- ),
- weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
- weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'Aको h:mm बजे',
- LTS: 'Aको h:mm:ss बजे',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, Aको h:mm बजे',
- LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे',
- },
- preparse: function (string) {
- return string.replace(/[१२३४५६७८९०]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'राति') {
- return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'बिहान') {
- return hour;
- } else if (meridiem === 'दिउँसो') {
- return hour >= 10 ? hour : hour + 12;
- } else if (meridiem === 'साँझ') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 3) {
- return 'राति';
- } else if (hour < 12) {
- return 'बिहान';
- } else if (hour < 16) {
- return 'दिउँसो';
- } else if (hour < 20) {
- return 'साँझ';
- } else {
- return 'राति';
- }
- },
- calendar: {
- sameDay: '[आज] LT',
- nextDay: '[भोलि] LT',
- nextWeek: '[आउँदो] dddd[,] LT',
- lastDay: '[हिजो] LT',
- lastWeek: '[गएको] dddd[,] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%sमा',
- past: '%s अगाडि',
- s: 'केही क्षण',
- ss: '%d सेकेण्ड',
- m: 'एक मिनेट',
- mm: '%d मिनेट',
- h: 'एक घण्टा',
- hh: '%d घण्टा',
- d: 'एक दिन',
- dd: '%d दिन',
- M: 'एक महिना',
- MM: '%d महिना',
- y: 'एक बर्ष',
- yy: '%d बर्ष',
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return ne;
- })));
- /***/ }),
- /***/ 59814:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Dutch (Belgium) [nl-be]
- //! author : Joris Röling : https://github.com/jorisroling
- //! author : Jacob Middag : https://github.com/middagj
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split(
- '_'
- ),
- monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split(
- '_'
- ),
- monthsParse = [
- /^jan/i,
- /^feb/i,
- /^maart|mrt.?$/i,
- /^apr/i,
- /^mei$/i,
- /^jun[i.]?$/i,
- /^jul[i.]?$/i,
- /^aug/i,
- /^sep/i,
- /^okt/i,
- /^nov/i,
- /^dec/i,
- ],
- monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
- var nlBe = moment.defineLocale('nl-be', {
- months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(
- '_'
- ),
- monthsShort: function (m, format) {
- if (!m) {
- return monthsShortWithDots;
- } else if (/-MMM-/.test(format)) {
- return monthsShortWithoutDots[m.month()];
- } else {
- return monthsShortWithDots[m.month()];
- }
- },
- monthsRegex: monthsRegex,
- monthsShortRegex: monthsRegex,
- monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
- monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split(
- '_'
- ),
- weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
- weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[vandaag om] LT',
- nextDay: '[morgen om] LT',
- nextWeek: 'dddd [om] LT',
- lastDay: '[gisteren om] LT',
- lastWeek: '[afgelopen] dddd [om] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'over %s',
- past: '%s geleden',
- s: 'een paar seconden',
- ss: '%d seconden',
- m: 'één minuut',
- mm: '%d minuten',
- h: 'één uur',
- hh: '%d uur',
- d: 'één dag',
- dd: '%d dagen',
- M: 'één maand',
- MM: '%d maanden',
- y: 'één jaar',
- yy: '%d jaar',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
- ordinal: function (number) {
- return (
- number +
- (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
- );
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return nlBe;
- })));
- /***/ }),
- /***/ 93901:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Dutch [nl]
- //! author : Joris Röling : https://github.com/jorisroling
- //! author : Jacob Middag : https://github.com/middagj
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split(
- '_'
- ),
- monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split(
- '_'
- ),
- monthsParse = [
- /^jan/i,
- /^feb/i,
- /^maart|mrt.?$/i,
- /^apr/i,
- /^mei$/i,
- /^jun[i.]?$/i,
- /^jul[i.]?$/i,
- /^aug/i,
- /^sep/i,
- /^okt/i,
- /^nov/i,
- /^dec/i,
- ],
- monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
- var nl = moment.defineLocale('nl', {
- months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(
- '_'
- ),
- monthsShort: function (m, format) {
- if (!m) {
- return monthsShortWithDots;
- } else if (/-MMM-/.test(format)) {
- return monthsShortWithoutDots[m.month()];
- } else {
- return monthsShortWithDots[m.month()];
- }
- },
- monthsRegex: monthsRegex,
- monthsShortRegex: monthsRegex,
- monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
- monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split(
- '_'
- ),
- weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
- weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD-MM-YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[vandaag om] LT',
- nextDay: '[morgen om] LT',
- nextWeek: 'dddd [om] LT',
- lastDay: '[gisteren om] LT',
- lastWeek: '[afgelopen] dddd [om] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'over %s',
- past: '%s geleden',
- s: 'een paar seconden',
- ss: '%d seconden',
- m: 'één minuut',
- mm: '%d minuten',
- h: 'één uur',
- hh: '%d uur',
- d: 'één dag',
- dd: '%d dagen',
- w: 'één week',
- ww: '%d weken',
- M: 'één maand',
- MM: '%d maanden',
- y: 'één jaar',
- yy: '%d jaar',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
- ordinal: function (number) {
- return (
- number +
- (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
- );
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return nl;
- })));
- /***/ }),
- /***/ 83877:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Nynorsk [nn]
- //! authors : https://github.com/mechuwind
- //! Stephen Ramthun : https://github.com/stephenramthun
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var nn = moment.defineLocale('nn', {
- months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(
- '_'
- ),
- monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
- weekdaysShort: 'su._må._ty._on._to._fr._lau.'.split('_'),
- weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY [kl.] H:mm',
- LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',
- },
- calendar: {
- sameDay: '[I dag klokka] LT',
- nextDay: '[I morgon klokka] LT',
- nextWeek: 'dddd [klokka] LT',
- lastDay: '[I går klokka] LT',
- lastWeek: '[Føregåande] dddd [klokka] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'om %s',
- past: '%s sidan',
- s: 'nokre sekund',
- ss: '%d sekund',
- m: 'eit minutt',
- mm: '%d minutt',
- h: 'ein time',
- hh: '%d timar',
- d: 'ein dag',
- dd: '%d dagar',
- w: 'ei veke',
- ww: '%d veker',
- M: 'ein månad',
- MM: '%d månader',
- y: 'eit år',
- yy: '%d år',
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return nn;
- })));
- /***/ }),
- /***/ 92135:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Occitan, lengadocian dialecte [oc-lnc]
- //! author : Quentin PAGÈS : https://github.com/Quenty31
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var ocLnc = moment.defineLocale('oc-lnc', {
- months: {
- standalone: 'genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre'.split(
- '_'
- ),
- format: "de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split(
- '_'
- ),
- isFormat: /D[oD]?(\s)+MMMM/,
- },
- monthsShort: 'gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte'.split(
- '_'
- ),
- weekdaysShort: 'dg._dl._dm._dc._dj._dv._ds.'.split('_'),
- weekdaysMin: 'dg_dl_dm_dc_dj_dv_ds'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM [de] YYYY',
- ll: 'D MMM YYYY',
- LLL: 'D MMMM [de] YYYY [a] H:mm',
- lll: 'D MMM YYYY, H:mm',
- LLLL: 'dddd D MMMM [de] YYYY [a] H:mm',
- llll: 'ddd D MMM YYYY, H:mm',
- },
- calendar: {
- sameDay: '[uèi a] LT',
- nextDay: '[deman a] LT',
- nextWeek: 'dddd [a] LT',
- lastDay: '[ièr a] LT',
- lastWeek: 'dddd [passat a] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: "d'aquí %s",
- past: 'fa %s',
- s: 'unas segondas',
- ss: '%d segondas',
- m: 'una minuta',
- mm: '%d minutas',
- h: 'una ora',
- hh: '%d oras',
- d: 'un jorn',
- dd: '%d jorns',
- M: 'un mes',
- MM: '%d meses',
- y: 'un an',
- yy: '%d ans',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
- ordinal: function (number, period) {
- var output =
- number === 1
- ? 'r'
- : number === 2
- ? 'n'
- : number === 3
- ? 'r'
- : number === 4
- ? 't'
- : 'è';
- if (period === 'w' || period === 'W') {
- output = 'a';
- }
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4,
- },
- });
- return ocLnc;
- })));
- /***/ }),
- /***/ 15858:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Punjabi (India) [pa-in]
- //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '੧',
- 2: '੨',
- 3: '੩',
- 4: '੪',
- 5: '੫',
- 6: '੬',
- 7: '੭',
- 8: '੮',
- 9: '੯',
- 0: '੦',
- },
- numberMap = {
- '੧': '1',
- '੨': '2',
- '੩': '3',
- '੪': '4',
- '੫': '5',
- '੬': '6',
- '੭': '7',
- '੮': '8',
- '੯': '9',
- '੦': '0',
- };
- var paIn = moment.defineLocale('pa-in', {
- // There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi.
- months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(
- '_'
- ),
- monthsShort: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(
- '_'
- ),
- weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split(
- '_'
- ),
- weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
- weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
- longDateFormat: {
- LT: 'A h:mm ਵਜੇ',
- LTS: 'A h:mm:ss ਵਜੇ',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, A h:mm ਵਜੇ',
- LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ',
- },
- calendar: {
- sameDay: '[ਅਜ] LT',
- nextDay: '[ਕਲ] LT',
- nextWeek: '[ਅਗਲਾ] dddd, LT',
- lastDay: '[ਕਲ] LT',
- lastWeek: '[ਪਿਛਲੇ] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s ਵਿੱਚ',
- past: '%s ਪਿਛਲੇ',
- s: 'ਕੁਝ ਸਕਿੰਟ',
- ss: '%d ਸਕਿੰਟ',
- m: 'ਇਕ ਮਿੰਟ',
- mm: '%d ਮਿੰਟ',
- h: 'ਇੱਕ ਘੰਟਾ',
- hh: '%d ਘੰਟੇ',
- d: 'ਇੱਕ ਦਿਨ',
- dd: '%d ਦਿਨ',
- M: 'ਇੱਕ ਮਹੀਨਾ',
- MM: '%d ਮਹੀਨੇ',
- y: 'ਇੱਕ ਸਾਲ',
- yy: '%d ਸਾਲ',
- },
- preparse: function (string) {
- return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- // Punjabi notation for meridiems are quite fuzzy in practice. While there exists
- // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
- meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'ਰਾਤ') {
- return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'ਸਵੇਰ') {
- return hour;
- } else if (meridiem === 'ਦੁਪਹਿਰ') {
- return hour >= 10 ? hour : hour + 12;
- } else if (meridiem === 'ਸ਼ਾਮ') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'ਰਾਤ';
- } else if (hour < 10) {
- return 'ਸਵੇਰ';
- } else if (hour < 17) {
- return 'ਦੁਪਹਿਰ';
- } else if (hour < 20) {
- return 'ਸ਼ਾਮ';
- } else {
- return 'ਰਾਤ';
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return paIn;
- })));
- /***/ }),
- /***/ 64495:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Polish [pl]
- //! author : Rafal Hirsz : https://github.com/evoL
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split(
- '_'
- ),
- monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split(
- '_'
- ),
- monthsParse = [
- /^sty/i,
- /^lut/i,
- /^mar/i,
- /^kwi/i,
- /^maj/i,
- /^cze/i,
- /^lip/i,
- /^sie/i,
- /^wrz/i,
- /^paź/i,
- /^lis/i,
- /^gru/i,
- ];
- function plural(n) {
- return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;
- }
- function translate(number, withoutSuffix, key) {
- var result = number + ' ';
- switch (key) {
- case 'ss':
- return result + (plural(number) ? 'sekundy' : 'sekund');
- case 'm':
- return withoutSuffix ? 'minuta' : 'minutę';
- case 'mm':
- return result + (plural(number) ? 'minuty' : 'minut');
- case 'h':
- return withoutSuffix ? 'godzina' : 'godzinę';
- case 'hh':
- return result + (plural(number) ? 'godziny' : 'godzin');
- case 'ww':
- return result + (plural(number) ? 'tygodnie' : 'tygodni');
- case 'MM':
- return result + (plural(number) ? 'miesiące' : 'miesięcy');
- case 'yy':
- return result + (plural(number) ? 'lata' : 'lat');
- }
- }
- var pl = moment.defineLocale('pl', {
- months: function (momentToFormat, format) {
- if (!momentToFormat) {
- return monthsNominative;
- } else if (/D MMMM/.test(format)) {
- return monthsSubjective[momentToFormat.month()];
- } else {
- return monthsNominative[momentToFormat.month()];
- }
- },
- monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split(
- '_'
- ),
- weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
- weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Dziś o] LT',
- nextDay: '[Jutro o] LT',
- nextWeek: function () {
- switch (this.day()) {
- case 0:
- return '[W niedzielę o] LT';
- case 2:
- return '[We wtorek o] LT';
- case 3:
- return '[W środę o] LT';
- case 6:
- return '[W sobotę o] LT';
- default:
- return '[W] dddd [o] LT';
- }
- },
- lastDay: '[Wczoraj o] LT',
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- return '[W zeszłą niedzielę o] LT';
- case 3:
- return '[W zeszłą środę o] LT';
- case 6:
- return '[W zeszłą sobotę o] LT';
- default:
- return '[W zeszły] dddd [o] LT';
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'za %s',
- past: '%s temu',
- s: 'kilka sekund',
- ss: translate,
- m: translate,
- mm: translate,
- h: translate,
- hh: translate,
- d: '1 dzień',
- dd: '%d dni',
- w: 'tydzień',
- ww: translate,
- M: 'miesiąc',
- MM: translate,
- y: 'rok',
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return pl;
- })));
- /***/ }),
- /***/ 57971:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Portuguese (Brazil) [pt-br]
- //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var ptBr = moment.defineLocale('pt-br', {
- months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
- '_'
- ),
- monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
- weekdays: 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split(
- '_'
- ),
- weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),
- weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D [de] MMMM [de] YYYY',
- LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
- LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm',
- },
- calendar: {
- sameDay: '[Hoje às] LT',
- nextDay: '[Amanhã às] LT',
- nextWeek: 'dddd [às] LT',
- lastDay: '[Ontem às] LT',
- lastWeek: function () {
- return this.day() === 0 || this.day() === 6
- ? '[Último] dddd [às] LT' // Saturday + Sunday
- : '[Última] dddd [às] LT'; // Monday - Friday
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'em %s',
- past: 'há %s',
- s: 'poucos segundos',
- ss: '%d segundos',
- m: 'um minuto',
- mm: '%d minutos',
- h: 'uma hora',
- hh: '%d horas',
- d: 'um dia',
- dd: '%d dias',
- M: 'um mês',
- MM: '%d meses',
- y: 'um ano',
- yy: '%d anos',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- invalidDate: 'Data inválida',
- });
- return ptBr;
- })));
- /***/ }),
- /***/ 89520:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Portuguese [pt]
- //! author : Jefferson : https://github.com/jalex79
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var pt = moment.defineLocale('pt', {
- months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
- '_'
- ),
- monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
- weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split(
- '_'
- ),
- weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
- weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D [de] MMMM [de] YYYY',
- LLL: 'D [de] MMMM [de] YYYY HH:mm',
- LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Hoje às] LT',
- nextDay: '[Amanhã às] LT',
- nextWeek: 'dddd [às] LT',
- lastDay: '[Ontem às] LT',
- lastWeek: function () {
- return this.day() === 0 || this.day() === 6
- ? '[Último] dddd [às] LT' // Saturday + Sunday
- : '[Última] dddd [às] LT'; // Monday - Friday
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'em %s',
- past: 'há %s',
- s: 'segundos',
- ss: '%d segundos',
- m: 'um minuto',
- mm: '%d minutos',
- h: 'uma hora',
- hh: '%d horas',
- d: 'um dia',
- dd: '%d dias',
- w: 'uma semana',
- ww: '%d semanas',
- M: 'um mês',
- MM: '%d meses',
- y: 'um ano',
- yy: '%d anos',
- },
- dayOfMonthOrdinalParse: /\d{1,2}º/,
- ordinal: '%dº',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return pt;
- })));
- /***/ }),
- /***/ 96459:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Romanian [ro]
- //! author : Vlad Gurdiga : https://github.com/gurdiga
- //! author : Valentin Agachi : https://github.com/avaly
- //! author : Emanuel Cepoi : https://github.com/cepem
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function relativeTimeWithPlural(number, withoutSuffix, key) {
- var format = {
- ss: 'secunde',
- mm: 'minute',
- hh: 'ore',
- dd: 'zile',
- ww: 'săptămâni',
- MM: 'luni',
- yy: 'ani',
- },
- separator = ' ';
- if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
- separator = ' de ';
- }
- return number + separator + format[key];
- }
- var ro = moment.defineLocale('ro', {
- months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(
- '_'
- ),
- monthsShort: 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
- weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
- weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY H:mm',
- LLLL: 'dddd, D MMMM YYYY H:mm',
- },
- calendar: {
- sameDay: '[azi la] LT',
- nextDay: '[mâine la] LT',
- nextWeek: 'dddd [la] LT',
- lastDay: '[ieri la] LT',
- lastWeek: '[fosta] dddd [la] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'peste %s',
- past: '%s în urmă',
- s: 'câteva secunde',
- ss: relativeTimeWithPlural,
- m: 'un minut',
- mm: relativeTimeWithPlural,
- h: 'o oră',
- hh: relativeTimeWithPlural,
- d: 'o zi',
- dd: relativeTimeWithPlural,
- w: 'o săptămână',
- ww: relativeTimeWithPlural,
- M: 'o lună',
- MM: relativeTimeWithPlural,
- y: 'un an',
- yy: relativeTimeWithPlural,
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return ro;
- })));
- /***/ }),
- /***/ 21793:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Russian [ru]
- //! author : Viktorminator : https://github.com/Viktorminator
- //! author : Menelion Elensúle : https://github.com/Oire
- //! author : Коренберг Марк : https://github.com/socketpair
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function plural(word, num) {
- var forms = word.split('_');
- return num % 10 === 1 && num % 100 !== 11
- ? forms[0]
- : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
- ? forms[1]
- : forms[2];
- }
- function relativeTimeWithPlural(number, withoutSuffix, key) {
- var format = {
- ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
- mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
- hh: 'час_часа_часов',
- dd: 'день_дня_дней',
- ww: 'неделя_недели_недель',
- MM: 'месяц_месяца_месяцев',
- yy: 'год_года_лет',
- };
- if (key === 'm') {
- return withoutSuffix ? 'минута' : 'минуту';
- } else {
- return number + ' ' + plural(format[key], +number);
- }
- }
- var monthsParse = [
- /^янв/i,
- /^фев/i,
- /^мар/i,
- /^апр/i,
- /^ма[йя]/i,
- /^июн/i,
- /^июл/i,
- /^авг/i,
- /^сен/i,
- /^окт/i,
- /^ноя/i,
- /^дек/i,
- ];
- // http://new.gramota.ru/spravka/rules/139-prop : § 103
- // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
- // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
- var ru = moment.defineLocale('ru', {
- months: {
- format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split(
- '_'
- ),
- standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(
- '_'
- ),
- },
- monthsShort: {
- // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку?
- format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split(
- '_'
- ),
- standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split(
- '_'
- ),
- },
- weekdays: {
- standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split(
- '_'
- ),
- format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split(
- '_'
- ),
- isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/,
- },
- weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
- weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
- monthsParse: monthsParse,
- longMonthsParse: monthsParse,
- shortMonthsParse: monthsParse,
- // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
- monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
- // копия предыдущего
- monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
- // полные названия с падежами
- monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
- // Выражение, которое соответствует только сокращённым формам
- monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY г.',
- LLL: 'D MMMM YYYY г., H:mm',
- LLLL: 'dddd, D MMMM YYYY г., H:mm',
- },
- calendar: {
- sameDay: '[Сегодня, в] LT',
- nextDay: '[Завтра, в] LT',
- lastDay: '[Вчера, в] LT',
- nextWeek: function (now) {
- if (now.week() !== this.week()) {
- switch (this.day()) {
- case 0:
- return '[В следующее] dddd, [в] LT';
- case 1:
- case 2:
- case 4:
- return '[В следующий] dddd, [в] LT';
- case 3:
- case 5:
- case 6:
- return '[В следующую] dddd, [в] LT';
- }
- } else {
- if (this.day() === 2) {
- return '[Во] dddd, [в] LT';
- } else {
- return '[В] dddd, [в] LT';
- }
- }
- },
- lastWeek: function (now) {
- if (now.week() !== this.week()) {
- switch (this.day()) {
- case 0:
- return '[В прошлое] dddd, [в] LT';
- case 1:
- case 2:
- case 4:
- return '[В прошлый] dddd, [в] LT';
- case 3:
- case 5:
- case 6:
- return '[В прошлую] dddd, [в] LT';
- }
- } else {
- if (this.day() === 2) {
- return '[Во] dddd, [в] LT';
- } else {
- return '[В] dddd, [в] LT';
- }
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'через %s',
- past: '%s назад',
- s: 'несколько секунд',
- ss: relativeTimeWithPlural,
- m: relativeTimeWithPlural,
- mm: relativeTimeWithPlural,
- h: 'час',
- hh: relativeTimeWithPlural,
- d: 'день',
- dd: relativeTimeWithPlural,
- w: 'неделя',
- ww: relativeTimeWithPlural,
- M: 'месяц',
- MM: relativeTimeWithPlural,
- y: 'год',
- yy: relativeTimeWithPlural,
- },
- meridiemParse: /ночи|утра|дня|вечера/i,
- isPM: function (input) {
- return /^(дня|вечера)$/.test(input);
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'ночи';
- } else if (hour < 12) {
- return 'утра';
- } else if (hour < 17) {
- return 'дня';
- } else {
- return 'вечера';
- }
- },
- dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
- ordinal: function (number, period) {
- switch (period) {
- case 'M':
- case 'd':
- case 'DDD':
- return number + '-й';
- case 'D':
- return number + '-го';
- case 'w':
- case 'W':
- return number + '-я';
- default:
- return number;
- }
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return ru;
- })));
- /***/ }),
- /***/ 40950:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Sindhi [sd]
- //! author : Narain Sagar : https://github.com/narainsagar
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var months = [
- 'جنوري',
- 'فيبروري',
- 'مارچ',
- 'اپريل',
- 'مئي',
- 'جون',
- 'جولاءِ',
- 'آگسٽ',
- 'سيپٽمبر',
- 'آڪٽوبر',
- 'نومبر',
- 'ڊسمبر',
- ],
- days = ['آچر', 'سومر', 'اڱارو', 'اربع', 'خميس', 'جمع', 'ڇنڇر'];
- var sd = moment.defineLocale('sd', {
- months: months,
- monthsShort: months,
- weekdays: days,
- weekdaysShort: days,
- weekdaysMin: days,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd، D MMMM YYYY HH:mm',
- },
- meridiemParse: /صبح|شام/,
- isPM: function (input) {
- return 'شام' === input;
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'صبح';
- }
- return 'شام';
- },
- calendar: {
- sameDay: '[اڄ] LT',
- nextDay: '[سڀاڻي] LT',
- nextWeek: 'dddd [اڳين هفتي تي] LT',
- lastDay: '[ڪالهه] LT',
- lastWeek: '[گزريل هفتي] dddd [تي] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s پوء',
- past: '%s اڳ',
- s: 'چند سيڪنڊ',
- ss: '%d سيڪنڊ',
- m: 'هڪ منٽ',
- mm: '%d منٽ',
- h: 'هڪ ڪلاڪ',
- hh: '%d ڪلاڪ',
- d: 'هڪ ڏينهن',
- dd: '%d ڏينهن',
- M: 'هڪ مهينو',
- MM: '%d مهينا',
- y: 'هڪ سال',
- yy: '%d سال',
- },
- preparse: function (string) {
- return string.replace(/،/g, ',');
- },
- postformat: function (string) {
- return string.replace(/,/g, '،');
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return sd;
- })));
- /***/ }),
- /***/ 10490:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Northern Sami [se]
- //! authors : Bård Rolstad Henriksen : https://github.com/karamell
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var se = moment.defineLocale('se', {
- months: 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split(
- '_'
- ),
- monthsShort: 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split(
- '_'
- ),
- weekdays: 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split(
- '_'
- ),
- weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
- weekdaysMin: 's_v_m_g_d_b_L'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'MMMM D. [b.] YYYY',
- LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',
- LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm',
- },
- calendar: {
- sameDay: '[otne ti] LT',
- nextDay: '[ihttin ti] LT',
- nextWeek: 'dddd [ti] LT',
- lastDay: '[ikte ti] LT',
- lastWeek: '[ovddit] dddd [ti] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s geažes',
- past: 'maŋit %s',
- s: 'moadde sekunddat',
- ss: '%d sekunddat',
- m: 'okta minuhta',
- mm: '%d minuhtat',
- h: 'okta diimmu',
- hh: '%d diimmut',
- d: 'okta beaivi',
- dd: '%d beaivvit',
- M: 'okta mánnu',
- MM: '%d mánut',
- y: 'okta jahki',
- yy: '%d jagit',
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return se;
- })));
- /***/ }),
- /***/ 90124:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Sinhalese [si]
- //! author : Sampath Sitinamaluwa : https://github.com/sampathsris
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- /*jshint -W100*/
- var si = moment.defineLocale('si', {
- months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split(
- '_'
- ),
- monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split(
- '_'
- ),
- weekdays: 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split(
- '_'
- ),
- weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන'.split('_'),
- weekdaysMin: 'ඉ_ස_අ_බ_බ්ර_සි_සෙ'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'a h:mm',
- LTS: 'a h:mm:ss',
- L: 'YYYY/MM/DD',
- LL: 'YYYY MMMM D',
- LLL: 'YYYY MMMM D, a h:mm',
- LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss',
- },
- calendar: {
- sameDay: '[අද] LT[ට]',
- nextDay: '[හෙට] LT[ට]',
- nextWeek: 'dddd LT[ට]',
- lastDay: '[ඊයේ] LT[ට]',
- lastWeek: '[පසුගිය] dddd LT[ට]',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%sකින්',
- past: '%sකට පෙර',
- s: 'තත්පර කිහිපය',
- ss: 'තත්පර %d',
- m: 'මිනිත්තුව',
- mm: 'මිනිත්තු %d',
- h: 'පැය',
- hh: 'පැය %d',
- d: 'දිනය',
- dd: 'දින %d',
- M: 'මාසය',
- MM: 'මාස %d',
- y: 'වසර',
- yy: 'වසර %d',
- },
- dayOfMonthOrdinalParse: /\d{1,2} වැනි/,
- ordinal: function (number) {
- return number + ' වැනි';
- },
- meridiemParse: /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
- isPM: function (input) {
- return input === 'ප.ව.' || input === 'පස් වරු';
- },
- meridiem: function (hours, minutes, isLower) {
- if (hours > 11) {
- return isLower ? 'ප.ව.' : 'පස් වරු';
- } else {
- return isLower ? 'පෙ.ව.' : 'පෙර වරු';
- }
- },
- });
- return si;
- })));
- /***/ }),
- /***/ 64249:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Slovak [sk]
- //! author : Martin Minka : https://github.com/k2s
- //! based on work of petrbela : https://github.com/petrbela
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(
- '_'
- ),
- monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
- function plural(n) {
- return n > 1 && n < 5;
- }
- function translate(number, withoutSuffix, key, isFuture) {
- var result = number + ' ';
- switch (key) {
- case 's': // a few seconds / in a few seconds / a few seconds ago
- return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
- case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'sekundy' : 'sekúnd');
- } else {
- return result + 'sekundami';
- }
- case 'm': // a minute / in a minute / a minute ago
- return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';
- case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'minúty' : 'minút');
- } else {
- return result + 'minútami';
- }
- case 'h': // an hour / in an hour / an hour ago
- return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
- case 'hh': // 9 hours / in 9 hours / 9 hours ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'hodiny' : 'hodín');
- } else {
- return result + 'hodinami';
- }
- case 'd': // a day / in a day / a day ago
- return withoutSuffix || isFuture ? 'deň' : 'dňom';
- case 'dd': // 9 days / in 9 days / 9 days ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'dni' : 'dní');
- } else {
- return result + 'dňami';
- }
- case 'M': // a month / in a month / a month ago
- return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';
- case 'MM': // 9 months / in 9 months / 9 months ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'mesiace' : 'mesiacov');
- } else {
- return result + 'mesiacmi';
- }
- case 'y': // a year / in a year / a year ago
- return withoutSuffix || isFuture ? 'rok' : 'rokom';
- case 'yy': // 9 years / in 9 years / 9 years ago
- if (withoutSuffix || isFuture) {
- return result + (plural(number) ? 'roky' : 'rokov');
- } else {
- return result + 'rokmi';
- }
- }
- }
- var sk = moment.defineLocale('sk', {
- months: months,
- monthsShort: monthsShort,
- weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
- weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
- weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY H:mm',
- LLLL: 'dddd D. MMMM YYYY H:mm',
- },
- calendar: {
- sameDay: '[dnes o] LT',
- nextDay: '[zajtra o] LT',
- nextWeek: function () {
- switch (this.day()) {
- case 0:
- return '[v nedeľu o] LT';
- case 1:
- case 2:
- return '[v] dddd [o] LT';
- case 3:
- return '[v stredu o] LT';
- case 4:
- return '[vo štvrtok o] LT';
- case 5:
- return '[v piatok o] LT';
- case 6:
- return '[v sobotu o] LT';
- }
- },
- lastDay: '[včera o] LT',
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- return '[minulú nedeľu o] LT';
- case 1:
- case 2:
- return '[minulý] dddd [o] LT';
- case 3:
- return '[minulú stredu o] LT';
- case 4:
- case 5:
- return '[minulý] dddd [o] LT';
- case 6:
- return '[minulú sobotu o] LT';
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'za %s',
- past: 'pred %s',
- s: translate,
- ss: translate,
- m: translate,
- mm: translate,
- h: translate,
- hh: translate,
- d: translate,
- dd: translate,
- M: translate,
- MM: translate,
- y: translate,
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return sk;
- })));
- /***/ }),
- /***/ 14985:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Slovenian [sl]
- //! author : Robert Sedovšek : https://github.com/sedovsek
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function processRelativeTime(number, withoutSuffix, key, isFuture) {
- var result = number + ' ';
- switch (key) {
- case 's':
- return withoutSuffix || isFuture
- ? 'nekaj sekund'
- : 'nekaj sekundami';
- case 'ss':
- if (number === 1) {
- result += withoutSuffix ? 'sekundo' : 'sekundi';
- } else if (number === 2) {
- result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
- } else if (number < 5) {
- result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
- } else {
- result += 'sekund';
- }
- return result;
- case 'm':
- return withoutSuffix ? 'ena minuta' : 'eno minuto';
- case 'mm':
- if (number === 1) {
- result += withoutSuffix ? 'minuta' : 'minuto';
- } else if (number === 2) {
- result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
- } else if (number < 5) {
- result += withoutSuffix || isFuture ? 'minute' : 'minutami';
- } else {
- result += withoutSuffix || isFuture ? 'minut' : 'minutami';
- }
- return result;
- case 'h':
- return withoutSuffix ? 'ena ura' : 'eno uro';
- case 'hh':
- if (number === 1) {
- result += withoutSuffix ? 'ura' : 'uro';
- } else if (number === 2) {
- result += withoutSuffix || isFuture ? 'uri' : 'urama';
- } else if (number < 5) {
- result += withoutSuffix || isFuture ? 'ure' : 'urami';
- } else {
- result += withoutSuffix || isFuture ? 'ur' : 'urami';
- }
- return result;
- case 'd':
- return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
- case 'dd':
- if (number === 1) {
- result += withoutSuffix || isFuture ? 'dan' : 'dnem';
- } else if (number === 2) {
- result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
- } else {
- result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
- }
- return result;
- case 'M':
- return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
- case 'MM':
- if (number === 1) {
- result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
- } else if (number === 2) {
- result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
- } else if (number < 5) {
- result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
- } else {
- result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
- }
- return result;
- case 'y':
- return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
- case 'yy':
- if (number === 1) {
- result += withoutSuffix || isFuture ? 'leto' : 'letom';
- } else if (number === 2) {
- result += withoutSuffix || isFuture ? 'leti' : 'letoma';
- } else if (number < 5) {
- result += withoutSuffix || isFuture ? 'leta' : 'leti';
- } else {
- result += withoutSuffix || isFuture ? 'let' : 'leti';
- }
- return result;
- }
- }
- var sl = moment.defineLocale('sl', {
- months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split(
- '_'
- ),
- monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
- weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
- weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD. MM. YYYY',
- LL: 'D. MMMM YYYY',
- LLL: 'D. MMMM YYYY H:mm',
- LLLL: 'dddd, D. MMMM YYYY H:mm',
- },
- calendar: {
- sameDay: '[danes ob] LT',
- nextDay: '[jutri ob] LT',
- nextWeek: function () {
- switch (this.day()) {
- case 0:
- return '[v] [nedeljo] [ob] LT';
- case 3:
- return '[v] [sredo] [ob] LT';
- case 6:
- return '[v] [soboto] [ob] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[v] dddd [ob] LT';
- }
- },
- lastDay: '[včeraj ob] LT',
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- return '[prejšnjo] [nedeljo] [ob] LT';
- case 3:
- return '[prejšnjo] [sredo] [ob] LT';
- case 6:
- return '[prejšnjo] [soboto] [ob] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[prejšnji] dddd [ob] LT';
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'čez %s',
- past: 'pred %s',
- s: processRelativeTime,
- ss: processRelativeTime,
- m: processRelativeTime,
- mm: processRelativeTime,
- h: processRelativeTime,
- hh: processRelativeTime,
- d: processRelativeTime,
- dd: processRelativeTime,
- M: processRelativeTime,
- MM: processRelativeTime,
- y: processRelativeTime,
- yy: processRelativeTime,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return sl;
- })));
- /***/ }),
- /***/ 51104:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Albanian [sq]
- //! author : Flakërim Ismani : https://github.com/flakerimi
- //! author : Menelion Elensúle : https://github.com/Oire
- //! author : Oerd Cukalla : https://github.com/oerd
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var sq = moment.defineLocale('sq', {
- months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split(
- '_'
- ),
- monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
- weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split(
- '_'
- ),
- weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
- weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'),
- weekdaysParseExact: true,
- meridiemParse: /PD|MD/,
- isPM: function (input) {
- return input.charAt(0) === 'M';
- },
- meridiem: function (hours, minutes, isLower) {
- return hours < 12 ? 'PD' : 'MD';
- },
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Sot në] LT',
- nextDay: '[Nesër në] LT',
- nextWeek: 'dddd [në] LT',
- lastDay: '[Dje në] LT',
- lastWeek: 'dddd [e kaluar në] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'në %s',
- past: '%s më parë',
- s: 'disa sekonda',
- ss: '%d sekonda',
- m: 'një minutë',
- mm: '%d minuta',
- h: 'një orë',
- hh: '%d orë',
- d: 'një ditë',
- dd: '%d ditë',
- M: 'një muaj',
- MM: '%d muaj',
- y: 'një vit',
- yy: '%d vite',
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return sq;
- })));
- /***/ }),
- /***/ 79915:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Serbian Cyrillic [sr-cyrl]
- //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
- //! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var translator = {
- words: {
- //Different grammatical cases
- ss: ['секунда', 'секунде', 'секунди'],
- m: ['један минут', 'једне минуте'],
- mm: ['минут', 'минуте', 'минута'],
- h: ['један сат', 'једног сата'],
- hh: ['сат', 'сата', 'сати'],
- dd: ['дан', 'дана', 'дана'],
- MM: ['месец', 'месеца', 'месеци'],
- yy: ['година', 'године', 'година'],
- },
- correctGrammaticalCase: function (number, wordKey) {
- return number === 1
- ? wordKey[0]
- : number >= 2 && number <= 4
- ? wordKey[1]
- : wordKey[2];
- },
- translate: function (number, withoutSuffix, key) {
- var wordKey = translator.words[key];
- if (key.length === 1) {
- return withoutSuffix ? wordKey[0] : wordKey[1];
- } else {
- return (
- number +
- ' ' +
- translator.correctGrammaticalCase(number, wordKey)
- );
- }
- },
- };
- var srCyrl = moment.defineLocale('sr-cyrl', {
- months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split(
- '_'
- ),
- monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
- weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
- weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'D. M. YYYY.',
- LL: 'D. MMMM YYYY.',
- LLL: 'D. MMMM YYYY. H:mm',
- LLLL: 'dddd, D. MMMM YYYY. H:mm',
- },
- calendar: {
- sameDay: '[данас у] LT',
- nextDay: '[сутра у] LT',
- nextWeek: function () {
- switch (this.day()) {
- case 0:
- return '[у] [недељу] [у] LT';
- case 3:
- return '[у] [среду] [у] LT';
- case 6:
- return '[у] [суботу] [у] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[у] dddd [у] LT';
- }
- },
- lastDay: '[јуче у] LT',
- lastWeek: function () {
- var lastWeekDays = [
- '[прошле] [недеље] [у] LT',
- '[прошлог] [понедељка] [у] LT',
- '[прошлог] [уторка] [у] LT',
- '[прошле] [среде] [у] LT',
- '[прошлог] [четвртка] [у] LT',
- '[прошлог] [петка] [у] LT',
- '[прошле] [суботе] [у] LT',
- ];
- return lastWeekDays[this.day()];
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'за %s',
- past: 'пре %s',
- s: 'неколико секунди',
- ss: translator.translate,
- m: translator.translate,
- mm: translator.translate,
- h: translator.translate,
- hh: translator.translate,
- d: 'дан',
- dd: translator.translate,
- M: 'месец',
- MM: translator.translate,
- y: 'годину',
- yy: translator.translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 1st is the first week of the year.
- },
- });
- return srCyrl;
- })));
- /***/ }),
- /***/ 49131:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Serbian [sr]
- //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
- //! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var translator = {
- words: {
- //Different grammatical cases
- ss: ['sekunda', 'sekunde', 'sekundi'],
- m: ['jedan minut', 'jedne minute'],
- mm: ['minut', 'minute', 'minuta'],
- h: ['jedan sat', 'jednog sata'],
- hh: ['sat', 'sata', 'sati'],
- dd: ['dan', 'dana', 'dana'],
- MM: ['mesec', 'meseca', 'meseci'],
- yy: ['godina', 'godine', 'godina'],
- },
- correctGrammaticalCase: function (number, wordKey) {
- return number === 1
- ? wordKey[0]
- : number >= 2 && number <= 4
- ? wordKey[1]
- : wordKey[2];
- },
- translate: function (number, withoutSuffix, key) {
- var wordKey = translator.words[key];
- if (key.length === 1) {
- return withoutSuffix ? wordKey[0] : wordKey[1];
- } else {
- return (
- number +
- ' ' +
- translator.correctGrammaticalCase(number, wordKey)
- );
- }
- },
- };
- var sr = moment.defineLocale('sr', {
- months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
- '_'
- ),
- monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
- '_'
- ),
- weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
- weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'D. M. YYYY.',
- LL: 'D. MMMM YYYY.',
- LLL: 'D. MMMM YYYY. H:mm',
- LLLL: 'dddd, D. MMMM YYYY. H:mm',
- },
- calendar: {
- sameDay: '[danas u] LT',
- nextDay: '[sutra u] LT',
- nextWeek: function () {
- switch (this.day()) {
- case 0:
- return '[u] [nedelju] [u] LT';
- case 3:
- return '[u] [sredu] [u] LT';
- case 6:
- return '[u] [subotu] [u] LT';
- case 1:
- case 2:
- case 4:
- case 5:
- return '[u] dddd [u] LT';
- }
- },
- lastDay: '[juče u] LT',
- lastWeek: function () {
- var lastWeekDays = [
- '[prošle] [nedelje] [u] LT',
- '[prošlog] [ponedeljka] [u] LT',
- '[prošlog] [utorka] [u] LT',
- '[prošle] [srede] [u] LT',
- '[prošlog] [četvrtka] [u] LT',
- '[prošlog] [petka] [u] LT',
- '[prošle] [subote] [u] LT',
- ];
- return lastWeekDays[this.day()];
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'za %s',
- past: 'pre %s',
- s: 'nekoliko sekundi',
- ss: translator.translate,
- m: translator.translate,
- mm: translator.translate,
- h: translator.translate,
- hh: translator.translate,
- d: 'dan',
- dd: translator.translate,
- M: 'mesec',
- MM: translator.translate,
- y: 'godinu',
- yy: translator.translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return sr;
- })));
- /***/ }),
- /***/ 85893:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : siSwati [ss]
- //! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var ss = moment.defineLocale('ss', {
- months: "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split(
- '_'
- ),
- monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
- weekdays: 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split(
- '_'
- ),
- weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
- weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'h:mm A',
- LTS: 'h:mm:ss A',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY h:mm A',
- LLLL: 'dddd, D MMMM YYYY h:mm A',
- },
- calendar: {
- sameDay: '[Namuhla nga] LT',
- nextDay: '[Kusasa nga] LT',
- nextWeek: 'dddd [nga] LT',
- lastDay: '[Itolo nga] LT',
- lastWeek: 'dddd [leliphelile] [nga] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'nga %s',
- past: 'wenteka nga %s',
- s: 'emizuzwana lomcane',
- ss: '%d mzuzwana',
- m: 'umzuzu',
- mm: '%d emizuzu',
- h: 'lihora',
- hh: '%d emahora',
- d: 'lilanga',
- dd: '%d emalanga',
- M: 'inyanga',
- MM: '%d tinyanga',
- y: 'umnyaka',
- yy: '%d iminyaka',
- },
- meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
- meridiem: function (hours, minutes, isLower) {
- if (hours < 11) {
- return 'ekuseni';
- } else if (hours < 15) {
- return 'emini';
- } else if (hours < 19) {
- return 'entsambama';
- } else {
- return 'ebusuku';
- }
- },
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'ekuseni') {
- return hour;
- } else if (meridiem === 'emini') {
- return hour >= 11 ? hour : hour + 12;
- } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
- if (hour === 0) {
- return 0;
- }
- return hour + 12;
- }
- },
- dayOfMonthOrdinalParse: /\d{1,2}/,
- ordinal: '%d',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return ss;
- })));
- /***/ }),
- /***/ 98760:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Swedish [sv]
- //! author : Jens Alm : https://github.com/ulmus
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var sv = moment.defineLocale('sv', {
- months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split(
- '_'
- ),
- monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
- weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
- weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
- weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY-MM-DD',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY [kl.] HH:mm',
- LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',
- lll: 'D MMM YYYY HH:mm',
- llll: 'ddd D MMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Idag] LT',
- nextDay: '[Imorgon] LT',
- lastDay: '[Igår] LT',
- nextWeek: '[På] dddd LT',
- lastWeek: '[I] dddd[s] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'om %s',
- past: 'för %s sedan',
- s: 'några sekunder',
- ss: '%d sekunder',
- m: 'en minut',
- mm: '%d minuter',
- h: 'en timme',
- hh: '%d timmar',
- d: 'en dag',
- dd: '%d dagar',
- M: 'en månad',
- MM: '%d månader',
- y: 'ett år',
- yy: '%d år',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(\:e|\:a)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? ':e'
- : b === 1
- ? ':a'
- : b === 2
- ? ':a'
- : b === 3
- ? ':e'
- : ':e';
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return sv;
- })));
- /***/ }),
- /***/ 91172:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Swahili [sw]
- //! author : Fahad Kassim : https://github.com/fadsel
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var sw = moment.defineLocale('sw', {
- months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split(
- '_'
- ),
- monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
- weekdays: 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split(
- '_'
- ),
- weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
- weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'hh:mm A',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[leo saa] LT',
- nextDay: '[kesho saa] LT',
- nextWeek: '[wiki ijayo] dddd [saat] LT',
- lastDay: '[jana] LT',
- lastWeek: '[wiki iliyopita] dddd [saat] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s baadaye',
- past: 'tokea %s',
- s: 'hivi punde',
- ss: 'sekunde %d',
- m: 'dakika moja',
- mm: 'dakika %d',
- h: 'saa limoja',
- hh: 'masaa %d',
- d: 'siku moja',
- dd: 'siku %d',
- M: 'mwezi mmoja',
- MM: 'miezi %d',
- y: 'mwaka mmoja',
- yy: 'miaka %d',
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return sw;
- })));
- /***/ }),
- /***/ 27333:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Tamil [ta]
- //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var symbolMap = {
- 1: '௧',
- 2: '௨',
- 3: '௩',
- 4: '௪',
- 5: '௫',
- 6: '௬',
- 7: '௭',
- 8: '௮',
- 9: '௯',
- 0: '௦',
- },
- numberMap = {
- '௧': '1',
- '௨': '2',
- '௩': '3',
- '௪': '4',
- '௫': '5',
- '௬': '6',
- '௭': '7',
- '௮': '8',
- '௯': '9',
- '௦': '0',
- };
- var ta = moment.defineLocale('ta', {
- months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(
- '_'
- ),
- monthsShort: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(
- '_'
- ),
- weekdays: 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split(
- '_'
- ),
- weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split(
- '_'
- ),
- weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, HH:mm',
- LLLL: 'dddd, D MMMM YYYY, HH:mm',
- },
- calendar: {
- sameDay: '[இன்று] LT',
- nextDay: '[நாளை] LT',
- nextWeek: 'dddd, LT',
- lastDay: '[நேற்று] LT',
- lastWeek: '[கடந்த வாரம்] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s இல்',
- past: '%s முன்',
- s: 'ஒரு சில விநாடிகள்',
- ss: '%d விநாடிகள்',
- m: 'ஒரு நிமிடம்',
- mm: '%d நிமிடங்கள்',
- h: 'ஒரு மணி நேரம்',
- hh: '%d மணி நேரம்',
- d: 'ஒரு நாள்',
- dd: '%d நாட்கள்',
- M: 'ஒரு மாதம்',
- MM: '%d மாதங்கள்',
- y: 'ஒரு வருடம்',
- yy: '%d ஆண்டுகள்',
- },
- dayOfMonthOrdinalParse: /\d{1,2}வது/,
- ordinal: function (number) {
- return number + 'வது';
- },
- preparse: function (string) {
- return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
- return numberMap[match];
- });
- },
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- },
- // refer http://ta.wikipedia.org/s/1er1
- meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
- meridiem: function (hour, minute, isLower) {
- if (hour < 2) {
- return ' யாமம்';
- } else if (hour < 6) {
- return ' வைகறை'; // வைகறை
- } else if (hour < 10) {
- return ' காலை'; // காலை
- } else if (hour < 14) {
- return ' நண்பகல்'; // நண்பகல்
- } else if (hour < 18) {
- return ' எற்பாடு'; // எற்பாடு
- } else if (hour < 22) {
- return ' மாலை'; // மாலை
- } else {
- return ' யாமம்';
- }
- },
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'யாமம்') {
- return hour < 2 ? hour : hour + 12;
- } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
- return hour;
- } else if (meridiem === 'நண்பகல்') {
- return hour >= 10 ? hour : hour + 12;
- } else {
- return hour + 12;
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return ta;
- })));
- /***/ }),
- /***/ 23110:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Telugu [te]
- //! author : Krishna Chaitanya Thota : https://github.com/kcthota
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var te = moment.defineLocale('te', {
- months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split(
- '_'
- ),
- monthsShort: 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split(
- '_'
- ),
- weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
- weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
- longDateFormat: {
- LT: 'A h:mm',
- LTS: 'A h:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY, A h:mm',
- LLLL: 'dddd, D MMMM YYYY, A h:mm',
- },
- calendar: {
- sameDay: '[నేడు] LT',
- nextDay: '[రేపు] LT',
- nextWeek: 'dddd, LT',
- lastDay: '[నిన్న] LT',
- lastWeek: '[గత] dddd, LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s లో',
- past: '%s క్రితం',
- s: 'కొన్ని క్షణాలు',
- ss: '%d సెకన్లు',
- m: 'ఒక నిమిషం',
- mm: '%d నిమిషాలు',
- h: 'ఒక గంట',
- hh: '%d గంటలు',
- d: 'ఒక రోజు',
- dd: '%d రోజులు',
- M: 'ఒక నెల',
- MM: '%d నెలలు',
- y: 'ఒక సంవత్సరం',
- yy: '%d సంవత్సరాలు',
- },
- dayOfMonthOrdinalParse: /\d{1,2}వ/,
- ordinal: '%dవ',
- meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'రాత్రి') {
- return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'ఉదయం') {
- return hour;
- } else if (meridiem === 'మధ్యాహ్నం') {
- return hour >= 10 ? hour : hour + 12;
- } else if (meridiem === 'సాయంత్రం') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'రాత్రి';
- } else if (hour < 10) {
- return 'ఉదయం';
- } else if (hour < 17) {
- return 'మధ్యాహ్నం';
- } else if (hour < 20) {
- return 'సాయంత్రం';
- } else {
- return 'రాత్రి';
- }
- },
- week: {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- },
- });
- return te;
- })));
- /***/ }),
- /***/ 52095:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Tetun Dili (East Timor) [tet]
- //! author : Joshua Brooks : https://github.com/joshbrooks
- //! author : Onorio De J. Afonso : https://github.com/marobo
- //! author : Sonia Simoes : https://github.com/soniasimoes
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var tet = moment.defineLocale('tet', {
- months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split(
- '_'
- ),
- monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
- weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'),
- weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),
- weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Ohin iha] LT',
- nextDay: '[Aban iha] LT',
- nextWeek: 'dddd [iha] LT',
- lastDay: '[Horiseik iha] LT',
- lastWeek: 'dddd [semana kotuk] [iha] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'iha %s',
- past: '%s liuba',
- s: 'segundu balun',
- ss: 'segundu %d',
- m: 'minutu ida',
- mm: 'minutu %d',
- h: 'oras ida',
- hh: 'oras %d',
- d: 'loron ida',
- dd: 'loron %d',
- M: 'fulan ida',
- MM: 'fulan %d',
- y: 'tinan ida',
- yy: 'tinan %d',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return tet;
- })));
- /***/ }),
- /***/ 27321:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Tajik [tg]
- //! author : Orif N. Jr. : https://github.com/orif-jr
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var suffixes = {
- 0: '-ум',
- 1: '-ум',
- 2: '-юм',
- 3: '-юм',
- 4: '-ум',
- 5: '-ум',
- 6: '-ум',
- 7: '-ум',
- 8: '-ум',
- 9: '-ум',
- 10: '-ум',
- 12: '-ум',
- 13: '-ум',
- 20: '-ум',
- 30: '-юм',
- 40: '-ум',
- 50: '-ум',
- 60: '-ум',
- 70: '-ум',
- 80: '-ум',
- 90: '-ум',
- 100: '-ум',
- };
- var tg = moment.defineLocale('tg', {
- months: {
- format: 'январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри'.split(
- '_'
- ),
- standalone: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(
- '_'
- ),
- },
- monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
- weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split(
- '_'
- ),
- weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),
- weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Имрӯз соати] LT',
- nextDay: '[Фардо соати] LT',
- lastDay: '[Дирӯз соати] LT',
- nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT',
- lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'баъди %s',
- past: '%s пеш',
- s: 'якчанд сония',
- m: 'як дақиқа',
- mm: '%d дақиқа',
- h: 'як соат',
- hh: '%d соат',
- d: 'як рӯз',
- dd: '%d рӯз',
- M: 'як моҳ',
- MM: '%d моҳ',
- y: 'як сол',
- yy: '%d сол',
- },
- meridiemParse: /шаб|субҳ|рӯз|бегоҳ/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === 'шаб') {
- return hour < 4 ? hour : hour + 12;
- } else if (meridiem === 'субҳ') {
- return hour;
- } else if (meridiem === 'рӯз') {
- return hour >= 11 ? hour : hour + 12;
- } else if (meridiem === 'бегоҳ') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'шаб';
- } else if (hour < 11) {
- return 'субҳ';
- } else if (hour < 16) {
- return 'рӯз';
- } else if (hour < 19) {
- return 'бегоҳ';
- } else {
- return 'шаб';
- }
- },
- dayOfMonthOrdinalParse: /\d{1,2}-(ум|юм)/,
- ordinal: function (number) {
- var a = number % 10,
- b = number >= 100 ? 100 : null;
- return number + (suffixes[number] || suffixes[a] || suffixes[b]);
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 1th is the first week of the year.
- },
- });
- return tg;
- })));
- /***/ }),
- /***/ 9041:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Thai [th]
- //! author : Kridsada Thanabulpong : https://github.com/sirn
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var th = moment.defineLocale('th', {
- months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split(
- '_'
- ),
- monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
- weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
- weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'H:mm',
- LTS: 'H:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY เวลา H:mm',
- LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm',
- },
- meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
- isPM: function (input) {
- return input === 'หลังเที่ยง';
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'ก่อนเที่ยง';
- } else {
- return 'หลังเที่ยง';
- }
- },
- calendar: {
- sameDay: '[วันนี้ เวลา] LT',
- nextDay: '[พรุ่งนี้ เวลา] LT',
- nextWeek: 'dddd[หน้า เวลา] LT',
- lastDay: '[เมื่อวานนี้ เวลา] LT',
- lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'อีก %s',
- past: '%sที่แล้ว',
- s: 'ไม่กี่วินาที',
- ss: '%d วินาที',
- m: '1 นาที',
- mm: '%d นาที',
- h: '1 ชั่วโมง',
- hh: '%d ชั่วโมง',
- d: '1 วัน',
- dd: '%d วัน',
- w: '1 สัปดาห์',
- ww: '%d สัปดาห์',
- M: '1 เดือน',
- MM: '%d เดือน',
- y: '1 ปี',
- yy: '%d ปี',
- },
- });
- return th;
- })));
- /***/ }),
- /***/ 19005:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Turkmen [tk]
- //! author : Atamyrat Abdyrahmanov : https://github.com/atamyratabdy
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var suffixes = {
- 1: "'inji",
- 5: "'inji",
- 8: "'inji",
- 70: "'inji",
- 80: "'inji",
- 2: "'nji",
- 7: "'nji",
- 20: "'nji",
- 50: "'nji",
- 3: "'ünji",
- 4: "'ünji",
- 100: "'ünji",
- 6: "'njy",
- 9: "'unjy",
- 10: "'unjy",
- 30: "'unjy",
- 60: "'ynjy",
- 90: "'ynjy",
- };
- var tk = moment.defineLocale('tk', {
- months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split(
- '_'
- ),
- monthsShort: 'Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek'.split('_'),
- weekdays: 'Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe'.split(
- '_'
- ),
- weekdaysShort: 'Ýek_Duş_Siş_Çar_Pen_Ann_Şen'.split('_'),
- weekdaysMin: 'Ýk_Dş_Sş_Çr_Pn_An_Şn'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[bugün sagat] LT',
- nextDay: '[ertir sagat] LT',
- nextWeek: '[indiki] dddd [sagat] LT',
- lastDay: '[düýn] LT',
- lastWeek: '[geçen] dddd [sagat] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s soň',
- past: '%s öň',
- s: 'birnäçe sekunt',
- m: 'bir minut',
- mm: '%d minut',
- h: 'bir sagat',
- hh: '%d sagat',
- d: 'bir gün',
- dd: '%d gün',
- M: 'bir aý',
- MM: '%d aý',
- y: 'bir ýyl',
- yy: '%d ýyl',
- },
- ordinal: function (number, period) {
- switch (period) {
- case 'd':
- case 'D':
- case 'Do':
- case 'DD':
- return number;
- default:
- if (number === 0) {
- // special case for zero
- return number + "'unjy";
- }
- var a = number % 10,
- b = (number % 100) - a,
- c = number >= 100 ? 100 : null;
- return number + (suffixes[a] || suffixes[b] || suffixes[c]);
- }
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return tk;
- })));
- /***/ }),
- /***/ 75768:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Tagalog (Philippines) [tl-ph]
- //! author : Dan Hagman : https://github.com/hagmandan
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var tlPh = moment.defineLocale('tl-ph', {
- months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(
- '_'
- ),
- monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
- weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(
- '_'
- ),
- weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
- weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'MM/D/YYYY',
- LL: 'MMMM D, YYYY',
- LLL: 'MMMM D, YYYY HH:mm',
- LLLL: 'dddd, MMMM DD, YYYY HH:mm',
- },
- calendar: {
- sameDay: 'LT [ngayong araw]',
- nextDay: '[Bukas ng] LT',
- nextWeek: 'LT [sa susunod na] dddd',
- lastDay: 'LT [kahapon]',
- lastWeek: 'LT [noong nakaraang] dddd',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'sa loob ng %s',
- past: '%s ang nakalipas',
- s: 'ilang segundo',
- ss: '%d segundo',
- m: 'isang minuto',
- mm: '%d minuto',
- h: 'isang oras',
- hh: '%d oras',
- d: 'isang araw',
- dd: '%d araw',
- M: 'isang buwan',
- MM: '%d buwan',
- y: 'isang taon',
- yy: '%d taon',
- },
- dayOfMonthOrdinalParse: /\d{1,2}/,
- ordinal: function (number) {
- return number;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return tlPh;
- })));
- /***/ }),
- /***/ 89444:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Klingon [tlh]
- //! author : Dominika Kruk : https://github.com/amaranthrose
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
- function translateFuture(output) {
- var time = output;
- time =
- output.indexOf('jaj') !== -1
- ? time.slice(0, -3) + 'leS'
- : output.indexOf('jar') !== -1
- ? time.slice(0, -3) + 'waQ'
- : output.indexOf('DIS') !== -1
- ? time.slice(0, -3) + 'nem'
- : time + ' pIq';
- return time;
- }
- function translatePast(output) {
- var time = output;
- time =
- output.indexOf('jaj') !== -1
- ? time.slice(0, -3) + 'Hu’'
- : output.indexOf('jar') !== -1
- ? time.slice(0, -3) + 'wen'
- : output.indexOf('DIS') !== -1
- ? time.slice(0, -3) + 'ben'
- : time + ' ret';
- return time;
- }
- function translate(number, withoutSuffix, string, isFuture) {
- var numberNoun = numberAsNoun(number);
- switch (string) {
- case 'ss':
- return numberNoun + ' lup';
- case 'mm':
- return numberNoun + ' tup';
- case 'hh':
- return numberNoun + ' rep';
- case 'dd':
- return numberNoun + ' jaj';
- case 'MM':
- return numberNoun + ' jar';
- case 'yy':
- return numberNoun + ' DIS';
- }
- }
- function numberAsNoun(number) {
- var hundred = Math.floor((number % 1000) / 100),
- ten = Math.floor((number % 100) / 10),
- one = number % 10,
- word = '';
- if (hundred > 0) {
- word += numbersNouns[hundred] + 'vatlh';
- }
- if (ten > 0) {
- word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH';
- }
- if (one > 0) {
- word += (word !== '' ? ' ' : '') + numbersNouns[one];
- }
- return word === '' ? 'pagh' : word;
- }
- var tlh = moment.defineLocale('tlh', {
- months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split(
- '_'
- ),
- monthsShort: 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
- '_'
- ),
- weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
- '_'
- ),
- weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
- '_'
- ),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[DaHjaj] LT',
- nextDay: '[wa’leS] LT',
- nextWeek: 'LLL',
- lastDay: '[wa’Hu’] LT',
- lastWeek: 'LLL',
- sameElse: 'L',
- },
- relativeTime: {
- future: translateFuture,
- past: translatePast,
- s: 'puS lup',
- ss: translate,
- m: 'wa’ tup',
- mm: translate,
- h: 'wa’ rep',
- hh: translate,
- d: 'wa’ jaj',
- dd: translate,
- M: 'wa’ jar',
- MM: translate,
- y: 'wa’ DIS',
- yy: translate,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return tlh;
- })));
- /***/ }),
- /***/ 72397:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Turkish [tr]
- //! authors : Erhan Gundogan : https://github.com/erhangundogan,
- //! Burak Yiğit Kaya: https://github.com/BYK
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var suffixes = {
- 1: "'inci",
- 5: "'inci",
- 8: "'inci",
- 70: "'inci",
- 80: "'inci",
- 2: "'nci",
- 7: "'nci",
- 20: "'nci",
- 50: "'nci",
- 3: "'üncü",
- 4: "'üncü",
- 100: "'üncü",
- 6: "'ncı",
- 9: "'uncu",
- 10: "'uncu",
- 30: "'uncu",
- 60: "'ıncı",
- 90: "'ıncı",
- };
- var tr = moment.defineLocale('tr', {
- months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split(
- '_'
- ),
- monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
- weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split(
- '_'
- ),
- weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
- weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
- meridiem: function (hours, minutes, isLower) {
- if (hours < 12) {
- return isLower ? 'öö' : 'ÖÖ';
- } else {
- return isLower ? 'ös' : 'ÖS';
- }
- },
- meridiemParse: /öö|ÖÖ|ös|ÖS/,
- isPM: function (input) {
- return input === 'ös' || input === 'ÖS';
- },
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[bugün saat] LT',
- nextDay: '[yarın saat] LT',
- nextWeek: '[gelecek] dddd [saat] LT',
- lastDay: '[dün] LT',
- lastWeek: '[geçen] dddd [saat] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s sonra',
- past: '%s önce',
- s: 'birkaç saniye',
- ss: '%d saniye',
- m: 'bir dakika',
- mm: '%d dakika',
- h: 'bir saat',
- hh: '%d saat',
- d: 'bir gün',
- dd: '%d gün',
- w: 'bir hafta',
- ww: '%d hafta',
- M: 'bir ay',
- MM: '%d ay',
- y: 'bir yıl',
- yy: '%d yıl',
- },
- ordinal: function (number, period) {
- switch (period) {
- case 'd':
- case 'D':
- case 'Do':
- case 'DD':
- return number;
- default:
- if (number === 0) {
- // special case for zero
- return number + "'ıncı";
- }
- var a = number % 10,
- b = (number % 100) - a,
- c = number >= 100 ? 100 : null;
- return number + (suffixes[a] || suffixes[b] || suffixes[c]);
- }
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return tr;
- })));
- /***/ }),
- /***/ 28254:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Talossan [tzl]
- //! author : Robin van der Vliet : https://github.com/robin0van0der0v
- //! author : Iustì Canun
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
- // This is currently too difficult (maybe even impossible) to add.
- var tzl = moment.defineLocale('tzl', {
- months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split(
- '_'
- ),
- monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
- weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
- weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
- weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
- longDateFormat: {
- LT: 'HH.mm',
- LTS: 'HH.mm.ss',
- L: 'DD.MM.YYYY',
- LL: 'D. MMMM [dallas] YYYY',
- LLL: 'D. MMMM [dallas] YYYY HH.mm',
- LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm',
- },
- meridiemParse: /d\'o|d\'a/i,
- isPM: function (input) {
- return "d'o" === input.toLowerCase();
- },
- meridiem: function (hours, minutes, isLower) {
- if (hours > 11) {
- return isLower ? "d'o" : "D'O";
- } else {
- return isLower ? "d'a" : "D'A";
- }
- },
- calendar: {
- sameDay: '[oxhi à] LT',
- nextDay: '[demà à] LT',
- nextWeek: 'dddd [à] LT',
- lastDay: '[ieiri à] LT',
- lastWeek: '[sür el] dddd [lasteu à] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'osprei %s',
- past: 'ja%s',
- s: processRelativeTime,
- ss: processRelativeTime,
- m: processRelativeTime,
- mm: processRelativeTime,
- h: processRelativeTime,
- hh: processRelativeTime,
- d: processRelativeTime,
- dd: processRelativeTime,
- M: processRelativeTime,
- MM: processRelativeTime,
- y: processRelativeTime,
- yy: processRelativeTime,
- },
- dayOfMonthOrdinalParse: /\d{1,2}\./,
- ordinal: '%d.',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- function processRelativeTime(number, withoutSuffix, key, isFuture) {
- var format = {
- s: ['viensas secunds', "'iensas secunds"],
- ss: [number + ' secunds', '' + number + ' secunds'],
- m: ["'n míut", "'iens míut"],
- mm: [number + ' míuts', '' + number + ' míuts'],
- h: ["'n þora", "'iensa þora"],
- hh: [number + ' þoras', '' + number + ' þoras'],
- d: ["'n ziua", "'iensa ziua"],
- dd: [number + ' ziuas', '' + number + ' ziuas'],
- M: ["'n mes", "'iens mes"],
- MM: [number + ' mesen', '' + number + ' mesen'],
- y: ["'n ar", "'iens ar"],
- yy: [number + ' ars', '' + number + ' ars'],
- };
- return isFuture
- ? format[key][0]
- : withoutSuffix
- ? format[key][0]
- : format[key][1];
- }
- return tzl;
- })));
- /***/ }),
- /***/ 30699:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Central Atlas Tamazight Latin [tzm-latn]
- //! author : Abdel Said : https://github.com/abdelsaid
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var tzmLatn = moment.defineLocale('tzm-latn', {
- months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(
- '_'
- ),
- monthsShort: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(
- '_'
- ),
- weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
- weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
- weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[asdkh g] LT',
- nextDay: '[aska g] LT',
- nextWeek: 'dddd [g] LT',
- lastDay: '[assant g] LT',
- lastWeek: 'dddd [g] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'dadkh s yan %s',
- past: 'yan %s',
- s: 'imik',
- ss: '%d imik',
- m: 'minuḍ',
- mm: '%d minuḍ',
- h: 'saɛa',
- hh: '%d tassaɛin',
- d: 'ass',
- dd: '%d ossan',
- M: 'ayowr',
- MM: '%d iyyirn',
- y: 'asgas',
- yy: '%d isgasn',
- },
- week: {
- dow: 6, // Saturday is the first day of the week.
- doy: 12, // The week that contains Jan 12th is the first week of the year.
- },
- });
- return tzmLatn;
- })));
- /***/ }),
- /***/ 51106:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Central Atlas Tamazight [tzm]
- //! author : Abdel Said : https://github.com/abdelsaid
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var tzm = moment.defineLocale('tzm', {
- months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(
- '_'
- ),
- monthsShort: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(
- '_'
- ),
- weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
- weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
- weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
- nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
- nextWeek: 'dddd [ⴴ] LT',
- lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
- lastWeek: 'dddd [ⴴ] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
- past: 'ⵢⴰⵏ %s',
- s: 'ⵉⵎⵉⴽ',
- ss: '%d ⵉⵎⵉⴽ',
- m: 'ⵎⵉⵏⵓⴺ',
- mm: '%d ⵎⵉⵏⵓⴺ',
- h: 'ⵙⴰⵄⴰ',
- hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
- d: 'ⴰⵙⵙ',
- dd: '%d oⵙⵙⴰⵏ',
- M: 'ⴰⵢoⵓⵔ',
- MM: '%d ⵉⵢⵢⵉⵔⵏ',
- y: 'ⴰⵙⴳⴰⵙ',
- yy: '%d ⵉⵙⴳⴰⵙⵏ',
- },
- week: {
- dow: 6, // Saturday is the first day of the week.
- doy: 12, // The week that contains Jan 12th is the first week of the year.
- },
- });
- return tzm;
- })));
- /***/ }),
- /***/ 9288:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Uyghur (China) [ug-cn]
- //! author: boyaq : https://github.com/boyaq
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var ugCn = moment.defineLocale('ug-cn', {
- months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
- '_'
- ),
- monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
- '_'
- ),
- weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split(
- '_'
- ),
- weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
- weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY-MM-DD',
- LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',
- LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
- LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
- },
- meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (
- meridiem === 'يېرىم كېچە' ||
- meridiem === 'سەھەر' ||
- meridiem === 'چۈشتىن بۇرۇن'
- ) {
- return hour;
- } else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') {
- return hour + 12;
- } else {
- return hour >= 11 ? hour : hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- var hm = hour * 100 + minute;
- if (hm < 600) {
- return 'يېرىم كېچە';
- } else if (hm < 900) {
- return 'سەھەر';
- } else if (hm < 1130) {
- return 'چۈشتىن بۇرۇن';
- } else if (hm < 1230) {
- return 'چۈش';
- } else if (hm < 1800) {
- return 'چۈشتىن كېيىن';
- } else {
- return 'كەچ';
- }
- },
- calendar: {
- sameDay: '[بۈگۈن سائەت] LT',
- nextDay: '[ئەتە سائەت] LT',
- nextWeek: '[كېلەركى] dddd [سائەت] LT',
- lastDay: '[تۆنۈگۈن] LT',
- lastWeek: '[ئالدىنقى] dddd [سائەت] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s كېيىن',
- past: '%s بۇرۇن',
- s: 'نەچچە سېكونت',
- ss: '%d سېكونت',
- m: 'بىر مىنۇت',
- mm: '%d مىنۇت',
- h: 'بىر سائەت',
- hh: '%d سائەت',
- d: 'بىر كۈن',
- dd: '%d كۈن',
- M: 'بىر ئاي',
- MM: '%d ئاي',
- y: 'بىر يىل',
- yy: '%d يىل',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,
- ordinal: function (number, period) {
- switch (period) {
- case 'd':
- case 'D':
- case 'DDD':
- return number + '-كۈنى';
- case 'w':
- case 'W':
- return number + '-ھەپتە';
- default:
- return number;
- }
- },
- preparse: function (string) {
- return string.replace(/،/g, ',');
- },
- postformat: function (string) {
- return string.replace(/,/g, '،');
- },
- week: {
- // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 1st is the first week of the year.
- },
- });
- return ugCn;
- })));
- /***/ }),
- /***/ 67691:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Ukrainian [uk]
- //! author : zemlanin : https://github.com/zemlanin
- //! Author : Menelion Elensúle : https://github.com/Oire
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- function plural(word, num) {
- var forms = word.split('_');
- return num % 10 === 1 && num % 100 !== 11
- ? forms[0]
- : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
- ? forms[1]
- : forms[2];
- }
- function relativeTimeWithPlural(number, withoutSuffix, key) {
- var format = {
- ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
- mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
- hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
- dd: 'день_дні_днів',
- MM: 'місяць_місяці_місяців',
- yy: 'рік_роки_років',
- };
- if (key === 'm') {
- return withoutSuffix ? 'хвилина' : 'хвилину';
- } else if (key === 'h') {
- return withoutSuffix ? 'година' : 'годину';
- } else {
- return number + ' ' + plural(format[key], +number);
- }
- }
- function weekdaysCaseReplace(m, format) {
- var weekdays = {
- nominative: 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split(
- '_'
- ),
- accusative: 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split(
- '_'
- ),
- genitive: 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split(
- '_'
- ),
- },
- nounCase;
- if (m === true) {
- return weekdays['nominative']
- .slice(1, 7)
- .concat(weekdays['nominative'].slice(0, 1));
- }
- if (!m) {
- return weekdays['nominative'];
- }
- nounCase = /(\[[ВвУу]\]) ?dddd/.test(format)
- ? 'accusative'
- : /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format)
- ? 'genitive'
- : 'nominative';
- return weekdays[nounCase][m.day()];
- }
- function processHoursFunction(str) {
- return function () {
- return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
- };
- }
- var uk = moment.defineLocale('uk', {
- months: {
- format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split(
- '_'
- ),
- standalone: 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split(
- '_'
- ),
- },
- monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split(
- '_'
- ),
- weekdays: weekdaysCaseReplace,
- weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
- weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD.MM.YYYY',
- LL: 'D MMMM YYYY р.',
- LLL: 'D MMMM YYYY р., HH:mm',
- LLLL: 'dddd, D MMMM YYYY р., HH:mm',
- },
- calendar: {
- sameDay: processHoursFunction('[Сьогодні '),
- nextDay: processHoursFunction('[Завтра '),
- lastDay: processHoursFunction('[Вчора '),
- nextWeek: processHoursFunction('[У] dddd ['),
- lastWeek: function () {
- switch (this.day()) {
- case 0:
- case 3:
- case 5:
- case 6:
- return processHoursFunction('[Минулої] dddd [').call(this);
- case 1:
- case 2:
- case 4:
- return processHoursFunction('[Минулого] dddd [').call(this);
- }
- },
- sameElse: 'L',
- },
- relativeTime: {
- future: 'за %s',
- past: '%s тому',
- s: 'декілька секунд',
- ss: relativeTimeWithPlural,
- m: relativeTimeWithPlural,
- mm: relativeTimeWithPlural,
- h: 'годину',
- hh: relativeTimeWithPlural,
- d: 'день',
- dd: relativeTimeWithPlural,
- M: 'місяць',
- MM: relativeTimeWithPlural,
- y: 'рік',
- yy: relativeTimeWithPlural,
- },
- // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
- meridiemParse: /ночі|ранку|дня|вечора/,
- isPM: function (input) {
- return /^(дня|вечора)$/.test(input);
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 4) {
- return 'ночі';
- } else if (hour < 12) {
- return 'ранку';
- } else if (hour < 17) {
- return 'дня';
- } else {
- return 'вечора';
- }
- },
- dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
- ordinal: function (number, period) {
- switch (period) {
- case 'M':
- case 'd':
- case 'DDD':
- case 'w':
- case 'W':
- return number + '-й';
- case 'D':
- return number + '-го';
- default:
- return number;
- }
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return uk;
- })));
- /***/ }),
- /***/ 13795:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Urdu [ur]
- //! author : Sawood Alam : https://github.com/ibnesayeed
- //! author : Zack : https://github.com/ZackVision
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var months = [
- 'جنوری',
- 'فروری',
- 'مارچ',
- 'اپریل',
- 'مئی',
- 'جون',
- 'جولائی',
- 'اگست',
- 'ستمبر',
- 'اکتوبر',
- 'نومبر',
- 'دسمبر',
- ],
- days = ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ'];
- var ur = moment.defineLocale('ur', {
- months: months,
- monthsShort: months,
- weekdays: days,
- weekdaysShort: days,
- weekdaysMin: days,
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd، D MMMM YYYY HH:mm',
- },
- meridiemParse: /صبح|شام/,
- isPM: function (input) {
- return 'شام' === input;
- },
- meridiem: function (hour, minute, isLower) {
- if (hour < 12) {
- return 'صبح';
- }
- return 'شام';
- },
- calendar: {
- sameDay: '[آج بوقت] LT',
- nextDay: '[کل بوقت] LT',
- nextWeek: 'dddd [بوقت] LT',
- lastDay: '[گذشتہ روز بوقت] LT',
- lastWeek: '[گذشتہ] dddd [بوقت] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s بعد',
- past: '%s قبل',
- s: 'چند سیکنڈ',
- ss: '%d سیکنڈ',
- m: 'ایک منٹ',
- mm: '%d منٹ',
- h: 'ایک گھنٹہ',
- hh: '%d گھنٹے',
- d: 'ایک دن',
- dd: '%d دن',
- M: 'ایک ماہ',
- MM: '%d ماہ',
- y: 'ایک سال',
- yy: '%d سال',
- },
- preparse: function (string) {
- return string.replace(/،/g, ',');
- },
- postformat: function (string) {
- return string.replace(/,/g, '،');
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return ur;
- })));
- /***/ }),
- /***/ 60588:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Uzbek Latin [uz-latn]
- //! author : Rasulbek Mirzayev : github.com/Rasulbeeek
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var uzLatn = moment.defineLocale('uz-latn', {
- months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split(
- '_'
- ),
- monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
- weekdays: 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split(
- '_'
- ),
- weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
- weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'D MMMM YYYY, dddd HH:mm',
- },
- calendar: {
- sameDay: '[Bugun soat] LT [da]',
- nextDay: '[Ertaga] LT [da]',
- nextWeek: 'dddd [kuni soat] LT [da]',
- lastDay: '[Kecha soat] LT [da]',
- lastWeek: "[O'tgan] dddd [kuni soat] LT [da]",
- sameElse: 'L',
- },
- relativeTime: {
- future: 'Yaqin %s ichida',
- past: 'Bir necha %s oldin',
- s: 'soniya',
- ss: '%d soniya',
- m: 'bir daqiqa',
- mm: '%d daqiqa',
- h: 'bir soat',
- hh: '%d soat',
- d: 'bir kun',
- dd: '%d kun',
- M: 'bir oy',
- MM: '%d oy',
- y: 'bir yil',
- yy: '%d yil',
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 7th is the first week of the year.
- },
- });
- return uzLatn;
- })));
- /***/ }),
- /***/ 6791:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Uzbek [uz]
- //! author : Sardor Muminov : https://github.com/muminoff
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var uz = moment.defineLocale('uz', {
- months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(
- '_'
- ),
- monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
- weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
- weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
- weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'D MMMM YYYY, dddd HH:mm',
- },
- calendar: {
- sameDay: '[Бугун соат] LT [да]',
- nextDay: '[Эртага] LT [да]',
- nextWeek: 'dddd [куни соат] LT [да]',
- lastDay: '[Кеча соат] LT [да]',
- lastWeek: '[Утган] dddd [куни соат] LT [да]',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'Якин %s ичида',
- past: 'Бир неча %s олдин',
- s: 'фурсат',
- ss: '%d фурсат',
- m: 'бир дакика',
- mm: '%d дакика',
- h: 'бир соат',
- hh: '%d соат',
- d: 'бир кун',
- dd: '%d кун',
- M: 'бир ой',
- MM: '%d ой',
- y: 'бир йил',
- yy: '%d йил',
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 7, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return uz;
- })));
- /***/ }),
- /***/ 65666:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Vietnamese [vi]
- //! author : Bang Nguyen : https://github.com/bangnk
- //! author : Chien Kira : https://github.com/chienkira
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var vi = moment.defineLocale('vi', {
- months: 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split(
- '_'
- ),
- monthsShort: 'Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split(
- '_'
- ),
- weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
- weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
- weekdaysParseExact: true,
- meridiemParse: /sa|ch/i,
- isPM: function (input) {
- return /^ch$/i.test(input);
- },
- meridiem: function (hours, minutes, isLower) {
- if (hours < 12) {
- return isLower ? 'sa' : 'SA';
- } else {
- return isLower ? 'ch' : 'CH';
- }
- },
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM [năm] YYYY',
- LLL: 'D MMMM [năm] YYYY HH:mm',
- LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',
- l: 'DD/M/YYYY',
- ll: 'D MMM YYYY',
- lll: 'D MMM YYYY HH:mm',
- llll: 'ddd, D MMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[Hôm nay lúc] LT',
- nextDay: '[Ngày mai lúc] LT',
- nextWeek: 'dddd [tuần tới lúc] LT',
- lastDay: '[Hôm qua lúc] LT',
- lastWeek: 'dddd [tuần trước lúc] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: '%s tới',
- past: '%s trước',
- s: 'vài giây',
- ss: '%d giây',
- m: 'một phút',
- mm: '%d phút',
- h: 'một giờ',
- hh: '%d giờ',
- d: 'một ngày',
- dd: '%d ngày',
- w: 'một tuần',
- ww: '%d tuần',
- M: 'một tháng',
- MM: '%d tháng',
- y: 'một năm',
- yy: '%d năm',
- },
- dayOfMonthOrdinalParse: /\d{1,2}/,
- ordinal: function (number) {
- return number;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return vi;
- })));
- /***/ }),
- /***/ 14378:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Pseudo [x-pseudo]
- //! author : Andrew Hood : https://github.com/andrewhood125
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var xPseudo = moment.defineLocale('x-pseudo', {
- months: 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split(
- '_'
- ),
- monthsShort: 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split(
- '_'
- ),
- monthsParseExact: true,
- weekdays: 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split(
- '_'
- ),
- weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
- weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
- weekdaysParseExact: true,
- longDateFormat: {
- LT: 'HH:mm',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY HH:mm',
- LLLL: 'dddd, D MMMM YYYY HH:mm',
- },
- calendar: {
- sameDay: '[T~ódá~ý át] LT',
- nextDay: '[T~ómó~rró~w át] LT',
- nextWeek: 'dddd [át] LT',
- lastDay: '[Ý~ést~érdá~ý át] LT',
- lastWeek: '[L~ást] dddd [át] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'í~ñ %s',
- past: '%s á~gó',
- s: 'á ~féw ~sécó~ñds',
- ss: '%d s~écóñ~ds',
- m: 'á ~míñ~úté',
- mm: '%d m~íñú~tés',
- h: 'á~ñ hó~úr',
- hh: '%d h~óúrs',
- d: 'á ~dáý',
- dd: '%d d~áýs',
- M: 'á ~móñ~th',
- MM: '%d m~óñt~hs',
- y: 'á ~ýéár',
- yy: '%d ý~éárs',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- ~~((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return xPseudo;
- })));
- /***/ }),
- /***/ 75805:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Yoruba Nigeria [yo]
- //! author : Atolagbe Abisoye : https://github.com/andela-batolagbe
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var yo = moment.defineLocale('yo', {
- months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split(
- '_'
- ),
- monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
- weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
- weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
- weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
- longDateFormat: {
- LT: 'h:mm A',
- LTS: 'h:mm:ss A',
- L: 'DD/MM/YYYY',
- LL: 'D MMMM YYYY',
- LLL: 'D MMMM YYYY h:mm A',
- LLLL: 'dddd, D MMMM YYYY h:mm A',
- },
- calendar: {
- sameDay: '[Ònì ni] LT',
- nextDay: '[Ọ̀la ni] LT',
- nextWeek: "dddd [Ọsẹ̀ tón'bọ] [ni] LT",
- lastDay: '[Àna ni] LT',
- lastWeek: 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
- sameElse: 'L',
- },
- relativeTime: {
- future: 'ní %s',
- past: '%s kọjá',
- s: 'ìsẹjú aayá die',
- ss: 'aayá %d',
- m: 'ìsẹjú kan',
- mm: 'ìsẹjú %d',
- h: 'wákati kan',
- hh: 'wákati %d',
- d: 'ọjọ́ kan',
- dd: 'ọjọ́ %d',
- M: 'osù kan',
- MM: 'osù %d',
- y: 'ọdún kan',
- yy: 'ọdún %d',
- },
- dayOfMonthOrdinalParse: /ọjọ́\s\d{1,2}/,
- ordinal: 'ọjọ́ %d',
- week: {
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return yo;
- })));
- /***/ }),
- /***/ 83839:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Chinese (China) [zh-cn]
- //! author : suupic : https://github.com/suupic
- //! author : Zeno Zeng : https://github.com/zenozeng
- //! author : uu109 : https://github.com/uu109
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var zhCn = moment.defineLocale('zh-cn', {
- months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
- '_'
- ),
- monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
- '_'
- ),
- weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
- weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
- weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY/MM/DD',
- LL: 'YYYY年M月D日',
- LLL: 'YYYY年M月D日Ah点mm分',
- LLLL: 'YYYY年M月D日ddddAh点mm分',
- l: 'YYYY/M/D',
- ll: 'YYYY年M月D日',
- lll: 'YYYY年M月D日 HH:mm',
- llll: 'YYYY年M月D日dddd HH:mm',
- },
- meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
- return hour;
- } else if (meridiem === '下午' || meridiem === '晚上') {
- return hour + 12;
- } else {
- // '中午'
- return hour >= 11 ? hour : hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- var hm = hour * 100 + minute;
- if (hm < 600) {
- return '凌晨';
- } else if (hm < 900) {
- return '早上';
- } else if (hm < 1130) {
- return '上午';
- } else if (hm < 1230) {
- return '中午';
- } else if (hm < 1800) {
- return '下午';
- } else {
- return '晚上';
- }
- },
- calendar: {
- sameDay: '[今天]LT',
- nextDay: '[明天]LT',
- nextWeek: function (now) {
- if (now.week() !== this.week()) {
- return '[下]dddLT';
- } else {
- return '[本]dddLT';
- }
- },
- lastDay: '[昨天]LT',
- lastWeek: function (now) {
- if (this.week() !== now.week()) {
- return '[上]dddLT';
- } else {
- return '[本]dddLT';
- }
- },
- sameElse: 'L',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
- ordinal: function (number, period) {
- switch (period) {
- case 'd':
- case 'D':
- case 'DDD':
- return number + '日';
- case 'M':
- return number + '月';
- case 'w':
- case 'W':
- return number + '周';
- default:
- return number;
- }
- },
- relativeTime: {
- future: '%s后',
- past: '%s前',
- s: '几秒',
- ss: '%d 秒',
- m: '1 分钟',
- mm: '%d 分钟',
- h: '1 小时',
- hh: '%d 小时',
- d: '1 天',
- dd: '%d 天',
- w: '1 周',
- ww: '%d 周',
- M: '1 个月',
- MM: '%d 个月',
- y: '1 年',
- yy: '%d 年',
- },
- week: {
- // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
- dow: 1, // Monday is the first day of the week.
- doy: 4, // The week that contains Jan 4th is the first week of the year.
- },
- });
- return zhCn;
- })));
- /***/ }),
- /***/ 55726:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Chinese (Hong Kong) [zh-hk]
- //! author : Ben : https://github.com/ben-lin
- //! author : Chris Lam : https://github.com/hehachris
- //! author : Konstantin : https://github.com/skfd
- //! author : Anthony : https://github.com/anthonylau
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var zhHk = moment.defineLocale('zh-hk', {
- months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
- '_'
- ),
- monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
- '_'
- ),
- weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
- weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
- weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY/MM/DD',
- LL: 'YYYY年M月D日',
- LLL: 'YYYY年M月D日 HH:mm',
- LLLL: 'YYYY年M月D日dddd HH:mm',
- l: 'YYYY/M/D',
- ll: 'YYYY年M月D日',
- lll: 'YYYY年M月D日 HH:mm',
- llll: 'YYYY年M月D日dddd HH:mm',
- },
- meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
- return hour;
- } else if (meridiem === '中午') {
- return hour >= 11 ? hour : hour + 12;
- } else if (meridiem === '下午' || meridiem === '晚上') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- var hm = hour * 100 + minute;
- if (hm < 600) {
- return '凌晨';
- } else if (hm < 900) {
- return '早上';
- } else if (hm < 1200) {
- return '上午';
- } else if (hm === 1200) {
- return '中午';
- } else if (hm < 1800) {
- return '下午';
- } else {
- return '晚上';
- }
- },
- calendar: {
- sameDay: '[今天]LT',
- nextDay: '[明天]LT',
- nextWeek: '[下]ddddLT',
- lastDay: '[昨天]LT',
- lastWeek: '[上]ddddLT',
- sameElse: 'L',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
- ordinal: function (number, period) {
- switch (period) {
- case 'd':
- case 'D':
- case 'DDD':
- return number + '日';
- case 'M':
- return number + '月';
- case 'w':
- case 'W':
- return number + '週';
- default:
- return number;
- }
- },
- relativeTime: {
- future: '%s後',
- past: '%s前',
- s: '幾秒',
- ss: '%d 秒',
- m: '1 分鐘',
- mm: '%d 分鐘',
- h: '1 小時',
- hh: '%d 小時',
- d: '1 天',
- dd: '%d 天',
- M: '1 個月',
- MM: '%d 個月',
- y: '1 年',
- yy: '%d 年',
- },
- });
- return zhHk;
- })));
- /***/ }),
- /***/ 99807:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Chinese (Macau) [zh-mo]
- //! author : Ben : https://github.com/ben-lin
- //! author : Chris Lam : https://github.com/hehachris
- //! author : Tan Yuanhong : https://github.com/le0tan
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var zhMo = moment.defineLocale('zh-mo', {
- months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
- '_'
- ),
- monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
- '_'
- ),
- weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
- weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
- weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'DD/MM/YYYY',
- LL: 'YYYY年M月D日',
- LLL: 'YYYY年M月D日 HH:mm',
- LLLL: 'YYYY年M月D日dddd HH:mm',
- l: 'D/M/YYYY',
- ll: 'YYYY年M月D日',
- lll: 'YYYY年M月D日 HH:mm',
- llll: 'YYYY年M月D日dddd HH:mm',
- },
- meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
- return hour;
- } else if (meridiem === '中午') {
- return hour >= 11 ? hour : hour + 12;
- } else if (meridiem === '下午' || meridiem === '晚上') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- var hm = hour * 100 + minute;
- if (hm < 600) {
- return '凌晨';
- } else if (hm < 900) {
- return '早上';
- } else if (hm < 1130) {
- return '上午';
- } else if (hm < 1230) {
- return '中午';
- } else if (hm < 1800) {
- return '下午';
- } else {
- return '晚上';
- }
- },
- calendar: {
- sameDay: '[今天] LT',
- nextDay: '[明天] LT',
- nextWeek: '[下]dddd LT',
- lastDay: '[昨天] LT',
- lastWeek: '[上]dddd LT',
- sameElse: 'L',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
- ordinal: function (number, period) {
- switch (period) {
- case 'd':
- case 'D':
- case 'DDD':
- return number + '日';
- case 'M':
- return number + '月';
- case 'w':
- case 'W':
- return number + '週';
- default:
- return number;
- }
- },
- relativeTime: {
- future: '%s內',
- past: '%s前',
- s: '幾秒',
- ss: '%d 秒',
- m: '1 分鐘',
- mm: '%d 分鐘',
- h: '1 小時',
- hh: '%d 小時',
- d: '1 天',
- dd: '%d 天',
- M: '1 個月',
- MM: '%d 個月',
- y: '1 年',
- yy: '%d 年',
- },
- });
- return zhMo;
- })));
- /***/ }),
- /***/ 74152:
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
- //! moment.js locale configuration
- //! locale : Chinese (Taiwan) [zh-tw]
- //! author : Ben : https://github.com/ben-lin
- //! author : Chris Lam : https://github.com/hehachris
- ;(function (global, factory) {
- true ? factory(__webpack_require__(30381)) :
- 0
- }(this, (function (moment) { 'use strict';
- //! moment.js locale configuration
- var zhTw = moment.defineLocale('zh-tw', {
- months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
- '_'
- ),
- monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
- '_'
- ),
- weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
- weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
- weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
- longDateFormat: {
- LT: 'HH:mm',
- LTS: 'HH:mm:ss',
- L: 'YYYY/MM/DD',
- LL: 'YYYY年M月D日',
- LLL: 'YYYY年M月D日 HH:mm',
- LLLL: 'YYYY年M月D日dddd HH:mm',
- l: 'YYYY/M/D',
- ll: 'YYYY年M月D日',
- lll: 'YYYY年M月D日 HH:mm',
- llll: 'YYYY年M月D日dddd HH:mm',
- },
- meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
- meridiemHour: function (hour, meridiem) {
- if (hour === 12) {
- hour = 0;
- }
- if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
- return hour;
- } else if (meridiem === '中午') {
- return hour >= 11 ? hour : hour + 12;
- } else if (meridiem === '下午' || meridiem === '晚上') {
- return hour + 12;
- }
- },
- meridiem: function (hour, minute, isLower) {
- var hm = hour * 100 + minute;
- if (hm < 600) {
- return '凌晨';
- } else if (hm < 900) {
- return '早上';
- } else if (hm < 1130) {
- return '上午';
- } else if (hm < 1230) {
- return '中午';
- } else if (hm < 1800) {
- return '下午';
- } else {
- return '晚上';
- }
- },
- calendar: {
- sameDay: '[今天] LT',
- nextDay: '[明天] LT',
- nextWeek: '[下]dddd LT',
- lastDay: '[昨天] LT',
- lastWeek: '[上]dddd LT',
- sameElse: 'L',
- },
- dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
- ordinal: function (number, period) {
- switch (period) {
- case 'd':
- case 'D':
- case 'DDD':
- return number + '日';
- case 'M':
- return number + '月';
- case 'w':
- case 'W':
- return number + '週';
- default:
- return number;
- }
- },
- relativeTime: {
- future: '%s後',
- past: '%s前',
- s: '幾秒',
- ss: '%d 秒',
- m: '1 分鐘',
- mm: '%d 分鐘',
- h: '1 小時',
- hh: '%d 小時',
- d: '1 天',
- dd: '%d 天',
- M: '1 個月',
- MM: '%d 個月',
- y: '1 年',
- yy: '%d 年',
- },
- });
- return zhTw;
- })));
- /***/ }),
- /***/ 30381:
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- /* module decorator */ module = __webpack_require__.nmd(module);
- //! moment.js
- //! version : 2.29.1
- //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
- //! license : MIT
- //! momentjs.com
- ;(function (global, factory) {
- true ? module.exports = factory() :
- 0
- }(this, (function () { 'use strict';
- var hookCallback;
- function hooks() {
- return hookCallback.apply(null, arguments);
- }
- // This is done to register the method called with moment()
- // without creating circular dependencies.
- function setHookCallback(callback) {
- hookCallback = callback;
- }
- function isArray(input) {
- return (
- input instanceof Array ||
- Object.prototype.toString.call(input) === '[object Array]'
- );
- }
- function isObject(input) {
- // IE8 will treat undefined and null as object if it wasn't for
- // input != null
- return (
- input != null &&
- Object.prototype.toString.call(input) === '[object Object]'
- );
- }
- function hasOwnProp(a, b) {
- return Object.prototype.hasOwnProperty.call(a, b);
- }
- function isObjectEmpty(obj) {
- if (Object.getOwnPropertyNames) {
- return Object.getOwnPropertyNames(obj).length === 0;
- } else {
- var k;
- for (k in obj) {
- if (hasOwnProp(obj, k)) {
- return false;
- }
- }
- return true;
- }
- }
- function isUndefined(input) {
- return input === void 0;
- }
- function isNumber(input) {
- return (
- typeof input === 'number' ||
- Object.prototype.toString.call(input) === '[object Number]'
- );
- }
- function isDate(input) {
- return (
- input instanceof Date ||
- Object.prototype.toString.call(input) === '[object Date]'
- );
- }
- function map(arr, fn) {
- var res = [],
- i;
- for (i = 0; i < arr.length; ++i) {
- res.push(fn(arr[i], i));
- }
- return res;
- }
- function extend(a, b) {
- for (var i in b) {
- if (hasOwnProp(b, i)) {
- a[i] = b[i];
- }
- }
- if (hasOwnProp(b, 'toString')) {
- a.toString = b.toString;
- }
- if (hasOwnProp(b, 'valueOf')) {
- a.valueOf = b.valueOf;
- }
- return a;
- }
- function createUTC(input, format, locale, strict) {
- return createLocalOrUTC(input, format, locale, strict, true).utc();
- }
- function defaultParsingFlags() {
- // We need to deep clone this object.
- return {
- empty: false,
- unusedTokens: [],
- unusedInput: [],
- overflow: -2,
- charsLeftOver: 0,
- nullInput: false,
- invalidEra: null,
- invalidMonth: null,
- invalidFormat: false,
- userInvalidated: false,
- iso: false,
- parsedDateParts: [],
- era: null,
- meridiem: null,
- rfc2822: false,
- weekdayMismatch: false,
- };
- }
- function getParsingFlags(m) {
- if (m._pf == null) {
- m._pf = defaultParsingFlags();
- }
- return m._pf;
- }
- var some;
- if (Array.prototype.some) {
- some = Array.prototype.some;
- } else {
- some = function (fun) {
- var t = Object(this),
- len = t.length >>> 0,
- i;
- for (i = 0; i < len; i++) {
- if (i in t && fun.call(this, t[i], i, t)) {
- return true;
- }
- }
- return false;
- };
- }
- function isValid(m) {
- if (m._isValid == null) {
- var flags = getParsingFlags(m),
- parsedParts = some.call(flags.parsedDateParts, function (i) {
- return i != null;
- }),
- isNowValid =
- !isNaN(m._d.getTime()) &&
- flags.overflow < 0 &&
- !flags.empty &&
- !flags.invalidEra &&
- !flags.invalidMonth &&
- !flags.invalidWeekday &&
- !flags.weekdayMismatch &&
- !flags.nullInput &&
- !flags.invalidFormat &&
- !flags.userInvalidated &&
- (!flags.meridiem || (flags.meridiem && parsedParts));
- if (m._strict) {
- isNowValid =
- isNowValid &&
- flags.charsLeftOver === 0 &&
- flags.unusedTokens.length === 0 &&
- flags.bigHour === undefined;
- }
- if (Object.isFrozen == null || !Object.isFrozen(m)) {
- m._isValid = isNowValid;
- } else {
- return isNowValid;
- }
- }
- return m._isValid;
- }
- function createInvalid(flags) {
- var m = createUTC(NaN);
- if (flags != null) {
- extend(getParsingFlags(m), flags);
- } else {
- getParsingFlags(m).userInvalidated = true;
- }
- return m;
- }
- // Plugins that add properties should also add the key here (null value),
- // so we can properly clone ourselves.
- var momentProperties = (hooks.momentProperties = []),
- updateInProgress = false;
- function copyConfig(to, from) {
- var i, prop, val;
- if (!isUndefined(from._isAMomentObject)) {
- to._isAMomentObject = from._isAMomentObject;
- }
- if (!isUndefined(from._i)) {
- to._i = from._i;
- }
- if (!isUndefined(from._f)) {
- to._f = from._f;
- }
- if (!isUndefined(from._l)) {
- to._l = from._l;
- }
- if (!isUndefined(from._strict)) {
- to._strict = from._strict;
- }
- if (!isUndefined(from._tzm)) {
- to._tzm = from._tzm;
- }
- if (!isUndefined(from._isUTC)) {
- to._isUTC = from._isUTC;
- }
- if (!isUndefined(from._offset)) {
- to._offset = from._offset;
- }
- if (!isUndefined(from._pf)) {
- to._pf = getParsingFlags(from);
- }
- if (!isUndefined(from._locale)) {
- to._locale = from._locale;
- }
- if (momentProperties.length > 0) {
- for (i = 0; i < momentProperties.length; i++) {
- prop = momentProperties[i];
- val = from[prop];
- if (!isUndefined(val)) {
- to[prop] = val;
- }
- }
- }
- return to;
- }
- // Moment prototype object
- function Moment(config) {
- copyConfig(this, config);
- this._d = new Date(config._d != null ? config._d.getTime() : NaN);
- if (!this.isValid()) {
- this._d = new Date(NaN);
- }
- // Prevent infinite loop in case updateOffset creates new moment
- // objects.
- if (updateInProgress === false) {
- updateInProgress = true;
- hooks.updateOffset(this);
- updateInProgress = false;
- }
- }
- function isMoment(obj) {
- return (
- obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
- );
- }
- function warn(msg) {
- if (
- hooks.suppressDeprecationWarnings === false &&
- typeof console !== 'undefined' &&
- console.warn
- ) {
- console.warn('Deprecation warning: ' + msg);
- }
- }
- function deprecate(msg, fn) {
- var firstTime = true;
- return extend(function () {
- if (hooks.deprecationHandler != null) {
- hooks.deprecationHandler(null, msg);
- }
- if (firstTime) {
- var args = [],
- arg,
- i,
- key;
- for (i = 0; i < arguments.length; i++) {
- arg = '';
- if (typeof arguments[i] === 'object') {
- arg += '\n[' + i + '] ';
- for (key in arguments[0]) {
- if (hasOwnProp(arguments[0], key)) {
- arg += key + ': ' + arguments[0][key] + ', ';
- }
- }
- arg = arg.slice(0, -2); // Remove trailing comma and space
- } else {
- arg = arguments[i];
- }
- args.push(arg);
- }
- warn(
- msg +
- '\nArguments: ' +
- Array.prototype.slice.call(args).join('') +
- '\n' +
- new Error().stack
- );
- firstTime = false;
- }
- return fn.apply(this, arguments);
- }, fn);
- }
- var deprecations = {};
- function deprecateSimple(name, msg) {
- if (hooks.deprecationHandler != null) {
- hooks.deprecationHandler(name, msg);
- }
- if (!deprecations[name]) {
- warn(msg);
- deprecations[name] = true;
- }
- }
- hooks.suppressDeprecationWarnings = false;
- hooks.deprecationHandler = null;
- function isFunction(input) {
- return (
- (typeof Function !== 'undefined' && input instanceof Function) ||
- Object.prototype.toString.call(input) === '[object Function]'
- );
- }
- function set(config) {
- var prop, i;
- for (i in config) {
- if (hasOwnProp(config, i)) {
- prop = config[i];
- if (isFunction(prop)) {
- this[i] = prop;
- } else {
- this['_' + i] = prop;
- }
- }
- }
- this._config = config;
- // Lenient ordinal parsing accepts just a number in addition to
- // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
- // TODO: Remove "ordinalParse" fallback in next major release.
- this._dayOfMonthOrdinalParseLenient = new RegExp(
- (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
- '|' +
- /\d{1,2}/.source
- );
- }
- function mergeConfigs(parentConfig, childConfig) {
- var res = extend({}, parentConfig),
- prop;
- for (prop in childConfig) {
- if (hasOwnProp(childConfig, prop)) {
- if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
- res[prop] = {};
- extend(res[prop], parentConfig[prop]);
- extend(res[prop], childConfig[prop]);
- } else if (childConfig[prop] != null) {
- res[prop] = childConfig[prop];
- } else {
- delete res[prop];
- }
- }
- }
- for (prop in parentConfig) {
- if (
- hasOwnProp(parentConfig, prop) &&
- !hasOwnProp(childConfig, prop) &&
- isObject(parentConfig[prop])
- ) {
- // make sure changes to properties don't modify parent config
- res[prop] = extend({}, res[prop]);
- }
- }
- return res;
- }
- function Locale(config) {
- if (config != null) {
- this.set(config);
- }
- }
- var keys;
- if (Object.keys) {
- keys = Object.keys;
- } else {
- keys = function (obj) {
- var i,
- res = [];
- for (i in obj) {
- if (hasOwnProp(obj, i)) {
- res.push(i);
- }
- }
- return res;
- };
- }
- var defaultCalendar = {
- sameDay: '[Today at] LT',
- nextDay: '[Tomorrow at] LT',
- nextWeek: 'dddd [at] LT',
- lastDay: '[Yesterday at] LT',
- lastWeek: '[Last] dddd [at] LT',
- sameElse: 'L',
- };
- function calendar(key, mom, now) {
- var output = this._calendar[key] || this._calendar['sameElse'];
- return isFunction(output) ? output.call(mom, now) : output;
- }
- function zeroFill(number, targetLength, forceSign) {
- var absNumber = '' + Math.abs(number),
- zerosToFill = targetLength - absNumber.length,
- sign = number >= 0;
- return (
- (sign ? (forceSign ? '+' : '') : '-') +
- Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
- absNumber
- );
- }
- var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
- localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
- formatFunctions = {},
- formatTokenFunctions = {};
- // token: 'M'
- // padded: ['MM', 2]
- // ordinal: 'Mo'
- // callback: function () { this.month() + 1 }
- function addFormatToken(token, padded, ordinal, callback) {
- var func = callback;
- if (typeof callback === 'string') {
- func = function () {
- return this[callback]();
- };
- }
- if (token) {
- formatTokenFunctions[token] = func;
- }
- if (padded) {
- formatTokenFunctions[padded[0]] = function () {
- return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
- };
- }
- if (ordinal) {
- formatTokenFunctions[ordinal] = function () {
- return this.localeData().ordinal(
- func.apply(this, arguments),
- token
- );
- };
- }
- }
- function removeFormattingTokens(input) {
- if (input.match(/\[[\s\S]/)) {
- return input.replace(/^\[|\]$/g, '');
- }
- return input.replace(/\\/g, '');
- }
- function makeFormatFunction(format) {
- var array = format.match(formattingTokens),
- i,
- length;
- for (i = 0, length = array.length; i < length; i++) {
- if (formatTokenFunctions[array[i]]) {
- array[i] = formatTokenFunctions[array[i]];
- } else {
- array[i] = removeFormattingTokens(array[i]);
- }
- }
- return function (mom) {
- var output = '',
- i;
- for (i = 0; i < length; i++) {
- output += isFunction(array[i])
- ? array[i].call(mom, format)
- : array[i];
- }
- return output;
- };
- }
- // format date using native date object
- function formatMoment(m, format) {
- if (!m.isValid()) {
- return m.localeData().invalidDate();
- }
- format = expandFormat(format, m.localeData());
- formatFunctions[format] =
- formatFunctions[format] || makeFormatFunction(format);
- return formatFunctions[format](m);
- }
- function expandFormat(format, locale) {
- var i = 5;
- function replaceLongDateFormatTokens(input) {
- return locale.longDateFormat(input) || input;
- }
- localFormattingTokens.lastIndex = 0;
- while (i >= 0 && localFormattingTokens.test(format)) {
- format = format.replace(
- localFormattingTokens,
- replaceLongDateFormatTokens
- );
- localFormattingTokens.lastIndex = 0;
- i -= 1;
- }
- return format;
- }
- var defaultLongDateFormat = {
- LTS: 'h:mm:ss A',
- LT: 'h:mm A',
- L: 'MM/DD/YYYY',
- LL: 'MMMM D, YYYY',
- LLL: 'MMMM D, YYYY h:mm A',
- LLLL: 'dddd, MMMM D, YYYY h:mm A',
- };
- function longDateFormat(key) {
- var format = this._longDateFormat[key],
- formatUpper = this._longDateFormat[key.toUpperCase()];
- if (format || !formatUpper) {
- return format;
- }
- this._longDateFormat[key] = formatUpper
- .match(formattingTokens)
- .map(function (tok) {
- if (
- tok === 'MMMM' ||
- tok === 'MM' ||
- tok === 'DD' ||
- tok === 'dddd'
- ) {
- return tok.slice(1);
- }
- return tok;
- })
- .join('');
- return this._longDateFormat[key];
- }
- var defaultInvalidDate = 'Invalid date';
- function invalidDate() {
- return this._invalidDate;
- }
- var defaultOrdinal = '%d',
- defaultDayOfMonthOrdinalParse = /\d{1,2}/;
- function ordinal(number) {
- return this._ordinal.replace('%d', number);
- }
- var defaultRelativeTime = {
- future: 'in %s',
- past: '%s ago',
- s: 'a few seconds',
- ss: '%d seconds',
- m: 'a minute',
- mm: '%d minutes',
- h: 'an hour',
- hh: '%d hours',
- d: 'a day',
- dd: '%d days',
- w: 'a week',
- ww: '%d weeks',
- M: 'a month',
- MM: '%d months',
- y: 'a year',
- yy: '%d years',
- };
- function relativeTime(number, withoutSuffix, string, isFuture) {
- var output = this._relativeTime[string];
- return isFunction(output)
- ? output(number, withoutSuffix, string, isFuture)
- : output.replace(/%d/i, number);
- }
- function pastFuture(diff, output) {
- var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
- return isFunction(format) ? format(output) : format.replace(/%s/i, output);
- }
- var aliases = {};
- function addUnitAlias(unit, shorthand) {
- var lowerCase = unit.toLowerCase();
- aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
- }
- function normalizeUnits(units) {
- return typeof units === 'string'
- ? aliases[units] || aliases[units.toLowerCase()]
- : undefined;
- }
- function normalizeObjectUnits(inputObject) {
- var normalizedInput = {},
- normalizedProp,
- prop;
- for (prop in inputObject) {
- if (hasOwnProp(inputObject, prop)) {
- normalizedProp = normalizeUnits(prop);
- if (normalizedProp) {
- normalizedInput[normalizedProp] = inputObject[prop];
- }
- }
- }
- return normalizedInput;
- }
- var priorities = {};
- function addUnitPriority(unit, priority) {
- priorities[unit] = priority;
- }
- function getPrioritizedUnits(unitsObj) {
- var units = [],
- u;
- for (u in unitsObj) {
- if (hasOwnProp(unitsObj, u)) {
- units.push({ unit: u, priority: priorities[u] });
- }
- }
- units.sort(function (a, b) {
- return a.priority - b.priority;
- });
- return units;
- }
- function isLeapYear(year) {
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
- }
- function absFloor(number) {
- if (number < 0) {
- // -0 -> 0
- return Math.ceil(number) || 0;
- } else {
- return Math.floor(number);
- }
- }
- function toInt(argumentForCoercion) {
- var coercedNumber = +argumentForCoercion,
- value = 0;
- if (coercedNumber !== 0 && isFinite(coercedNumber)) {
- value = absFloor(coercedNumber);
- }
- return value;
- }
- function makeGetSet(unit, keepTime) {
- return function (value) {
- if (value != null) {
- set$1(this, unit, value);
- hooks.updateOffset(this, keepTime);
- return this;
- } else {
- return get(this, unit);
- }
- };
- }
- function get(mom, unit) {
- return mom.isValid()
- ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
- : NaN;
- }
- function set$1(mom, unit, value) {
- if (mom.isValid() && !isNaN(value)) {
- if (
- unit === 'FullYear' &&
- isLeapYear(mom.year()) &&
- mom.month() === 1 &&
- mom.date() === 29
- ) {
- value = toInt(value);
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
- value,
- mom.month(),
- daysInMonth(value, mom.month())
- );
- } else {
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
- }
- }
- }
- // MOMENTS
- function stringGet(units) {
- units = normalizeUnits(units);
- if (isFunction(this[units])) {
- return this[units]();
- }
- return this;
- }
- function stringSet(units, value) {
- if (typeof units === 'object') {
- units = normalizeObjectUnits(units);
- var prioritized = getPrioritizedUnits(units),
- i;
- for (i = 0; i < prioritized.length; i++) {
- this[prioritized[i].unit](units[prioritized[i].unit]);
- }
- } else {
- units = normalizeUnits(units);
- if (isFunction(this[units])) {
- return this[units](value);
- }
- }
- return this;
- }
- var match1 = /\d/, // 0 - 9
- match2 = /\d\d/, // 00 - 99
- match3 = /\d{3}/, // 000 - 999
- match4 = /\d{4}/, // 0000 - 9999
- match6 = /[+-]?\d{6}/, // -999999 - 999999
- match1to2 = /\d\d?/, // 0 - 99
- match3to4 = /\d\d\d\d?/, // 999 - 9999
- match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999
- match1to3 = /\d{1,3}/, // 0 - 999
- match1to4 = /\d{1,4}/, // 0 - 9999
- match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
- matchUnsigned = /\d+/, // 0 - inf
- matchSigned = /[+-]?\d+/, // -inf - inf
- matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
- matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
- matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
- // any word (or two) characters or numbers including two/three word month in arabic.
- // includes scottish gaelic two word and hyphenated months
- matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
- regexes;
- regexes = {};
- function addRegexToken(token, regex, strictRegex) {
- regexes[token] = isFunction(regex)
- ? regex
- : function (isStrict, localeData) {
- return isStrict && strictRegex ? strictRegex : regex;
- };
- }
- function getParseRegexForToken(token, config) {
- if (!hasOwnProp(regexes, token)) {
- return new RegExp(unescapeFormat(token));
- }
- return regexes[token](config._strict, config._locale);
- }
- // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
- function unescapeFormat(s) {
- return regexEscape(
- s
- .replace('\\', '')
- .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
- matched,
- p1,
- p2,
- p3,
- p4
- ) {
- return p1 || p2 || p3 || p4;
- })
- );
- }
- function regexEscape(s) {
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
- }
- var tokens = {};
- function addParseToken(token, callback) {
- var i,
- func = callback;
- if (typeof token === 'string') {
- token = [token];
- }
- if (isNumber(callback)) {
- func = function (input, array) {
- array[callback] = toInt(input);
- };
- }
- for (i = 0; i < token.length; i++) {
- tokens[token[i]] = func;
- }
- }
- function addWeekParseToken(token, callback) {
- addParseToken(token, function (input, array, config, token) {
- config._w = config._w || {};
- callback(input, config._w, config, token);
- });
- }
- function addTimeToArrayFromToken(token, input, config) {
- if (input != null && hasOwnProp(tokens, token)) {
- tokens[token](input, config._a, config, token);
- }
- }
- var YEAR = 0,
- MONTH = 1,
- DATE = 2,
- HOUR = 3,
- MINUTE = 4,
- SECOND = 5,
- MILLISECOND = 6,
- WEEK = 7,
- WEEKDAY = 8;
- function mod(n, x) {
- return ((n % x) + x) % x;
- }
- var indexOf;
- if (Array.prototype.indexOf) {
- indexOf = Array.prototype.indexOf;
- } else {
- indexOf = function (o) {
- // I know
- var i;
- for (i = 0; i < this.length; ++i) {
- if (this[i] === o) {
- return i;
- }
- }
- return -1;
- };
- }
- function daysInMonth(year, month) {
- if (isNaN(year) || isNaN(month)) {
- return NaN;
- }
- var modMonth = mod(month, 12);
- year += (month - modMonth) / 12;
- return modMonth === 1
- ? isLeapYear(year)
- ? 29
- : 28
- : 31 - ((modMonth % 7) % 2);
- }
- // FORMATTING
- addFormatToken('M', ['MM', 2], 'Mo', function () {
- return this.month() + 1;
- });
- addFormatToken('MMM', 0, 0, function (format) {
- return this.localeData().monthsShort(this, format);
- });
- addFormatToken('MMMM', 0, 0, function (format) {
- return this.localeData().months(this, format);
- });
- // ALIASES
- addUnitAlias('month', 'M');
- // PRIORITY
- addUnitPriority('month', 8);
- // PARSING
- addRegexToken('M', match1to2);
- addRegexToken('MM', match1to2, match2);
- addRegexToken('MMM', function (isStrict, locale) {
- return locale.monthsShortRegex(isStrict);
- });
- addRegexToken('MMMM', function (isStrict, locale) {
- return locale.monthsRegex(isStrict);
- });
- addParseToken(['M', 'MM'], function (input, array) {
- array[MONTH] = toInt(input) - 1;
- });
- addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
- var month = config._locale.monthsParse(input, token, config._strict);
- // if we didn't find a month name, mark the date as invalid.
- if (month != null) {
- array[MONTH] = month;
- } else {
- getParsingFlags(config).invalidMonth = input;
- }
- });
- // LOCALES
- var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
- '_'
- ),
- defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
- '_'
- ),
- MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
- defaultMonthsShortRegex = matchWord,
- defaultMonthsRegex = matchWord;
- function localeMonths(m, format) {
- if (!m) {
- return isArray(this._months)
- ? this._months
- : this._months['standalone'];
- }
- return isArray(this._months)
- ? this._months[m.month()]
- : this._months[
- (this._months.isFormat || MONTHS_IN_FORMAT).test(format)
- ? 'format'
- : 'standalone'
- ][m.month()];
- }
- function localeMonthsShort(m, format) {
- if (!m) {
- return isArray(this._monthsShort)
- ? this._monthsShort
- : this._monthsShort['standalone'];
- }
- return isArray(this._monthsShort)
- ? this._monthsShort[m.month()]
- : this._monthsShort[
- MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
- ][m.month()];
- }
- function handleStrictParse(monthName, format, strict) {
- var i,
- ii,
- mom,
- llc = monthName.toLocaleLowerCase();
- if (!this._monthsParse) {
- // this is not used
- this._monthsParse = [];
- this._longMonthsParse = [];
- this._shortMonthsParse = [];
- for (i = 0; i < 12; ++i) {
- mom = createUTC([2000, i]);
- this._shortMonthsParse[i] = this.monthsShort(
- mom,
- ''
- ).toLocaleLowerCase();
- this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
- }
- }
- if (strict) {
- if (format === 'MMM') {
- ii = indexOf.call(this._shortMonthsParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf.call(this._longMonthsParse, llc);
- return ii !== -1 ? ii : null;
- }
- } else {
- if (format === 'MMM') {
- ii = indexOf.call(this._shortMonthsParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._longMonthsParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf.call(this._longMonthsParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._shortMonthsParse, llc);
- return ii !== -1 ? ii : null;
- }
- }
- }
- function localeMonthsParse(monthName, format, strict) {
- var i, mom, regex;
- if (this._monthsParseExact) {
- return handleStrictParse.call(this, monthName, format, strict);
- }
- if (!this._monthsParse) {
- this._monthsParse = [];
- this._longMonthsParse = [];
- this._shortMonthsParse = [];
- }
- // TODO: add sorting
- // Sorting makes sure if one month (or abbr) is a prefix of another
- // see sorting in computeMonthsParse
- for (i = 0; i < 12; i++) {
- // make the regex if we don't have it already
- mom = createUTC([2000, i]);
- if (strict && !this._longMonthsParse[i]) {
- this._longMonthsParse[i] = new RegExp(
- '^' + this.months(mom, '').replace('.', '') + '$',
- 'i'
- );
- this._shortMonthsParse[i] = new RegExp(
- '^' + this.monthsShort(mom, '').replace('.', '') + '$',
- 'i'
- );
- }
- if (!strict && !this._monthsParse[i]) {
- regex =
- '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
- this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
- }
- // test the regex
- if (
- strict &&
- format === 'MMMM' &&
- this._longMonthsParse[i].test(monthName)
- ) {
- return i;
- } else if (
- strict &&
- format === 'MMM' &&
- this._shortMonthsParse[i].test(monthName)
- ) {
- return i;
- } else if (!strict && this._monthsParse[i].test(monthName)) {
- return i;
- }
- }
- }
- // MOMENTS
- function setMonth(mom, value) {
- var dayOfMonth;
- if (!mom.isValid()) {
- // No op
- return mom;
- }
- if (typeof value === 'string') {
- if (/^\d+$/.test(value)) {
- value = toInt(value);
- } else {
- value = mom.localeData().monthsParse(value);
- // TODO: Another silent failure?
- if (!isNumber(value)) {
- return mom;
- }
- }
- }
- dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
- return mom;
- }
- function getSetMonth(value) {
- if (value != null) {
- setMonth(this, value);
- hooks.updateOffset(this, true);
- return this;
- } else {
- return get(this, 'Month');
- }
- }
- function getDaysInMonth() {
- return daysInMonth(this.year(), this.month());
- }
- function monthsShortRegex(isStrict) {
- if (this._monthsParseExact) {
- if (!hasOwnProp(this, '_monthsRegex')) {
- computeMonthsParse.call(this);
- }
- if (isStrict) {
- return this._monthsShortStrictRegex;
- } else {
- return this._monthsShortRegex;
- }
- } else {
- if (!hasOwnProp(this, '_monthsShortRegex')) {
- this._monthsShortRegex = defaultMonthsShortRegex;
- }
- return this._monthsShortStrictRegex && isStrict
- ? this._monthsShortStrictRegex
- : this._monthsShortRegex;
- }
- }
- function monthsRegex(isStrict) {
- if (this._monthsParseExact) {
- if (!hasOwnProp(this, '_monthsRegex')) {
- computeMonthsParse.call(this);
- }
- if (isStrict) {
- return this._monthsStrictRegex;
- } else {
- return this._monthsRegex;
- }
- } else {
- if (!hasOwnProp(this, '_monthsRegex')) {
- this._monthsRegex = defaultMonthsRegex;
- }
- return this._monthsStrictRegex && isStrict
- ? this._monthsStrictRegex
- : this._monthsRegex;
- }
- }
- function computeMonthsParse() {
- function cmpLenRev(a, b) {
- return b.length - a.length;
- }
- var shortPieces = [],
- longPieces = [],
- mixedPieces = [],
- i,
- mom;
- for (i = 0; i < 12; i++) {
- // make the regex if we don't have it already
- mom = createUTC([2000, i]);
- shortPieces.push(this.monthsShort(mom, ''));
- longPieces.push(this.months(mom, ''));
- mixedPieces.push(this.months(mom, ''));
- mixedPieces.push(this.monthsShort(mom, ''));
- }
- // Sorting makes sure if one month (or abbr) is a prefix of another it
- // will match the longer piece.
- shortPieces.sort(cmpLenRev);
- longPieces.sort(cmpLenRev);
- mixedPieces.sort(cmpLenRev);
- for (i = 0; i < 12; i++) {
- shortPieces[i] = regexEscape(shortPieces[i]);
- longPieces[i] = regexEscape(longPieces[i]);
- }
- for (i = 0; i < 24; i++) {
- mixedPieces[i] = regexEscape(mixedPieces[i]);
- }
- this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
- this._monthsShortRegex = this._monthsRegex;
- this._monthsStrictRegex = new RegExp(
- '^(' + longPieces.join('|') + ')',
- 'i'
- );
- this._monthsShortStrictRegex = new RegExp(
- '^(' + shortPieces.join('|') + ')',
- 'i'
- );
- }
- // FORMATTING
- addFormatToken('Y', 0, 0, function () {
- var y = this.year();
- return y <= 9999 ? zeroFill(y, 4) : '+' + y;
- });
- addFormatToken(0, ['YY', 2], 0, function () {
- return this.year() % 100;
- });
- addFormatToken(0, ['YYYY', 4], 0, 'year');
- addFormatToken(0, ['YYYYY', 5], 0, 'year');
- addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
- // ALIASES
- addUnitAlias('year', 'y');
- // PRIORITIES
- addUnitPriority('year', 1);
- // PARSING
- addRegexToken('Y', matchSigned);
- addRegexToken('YY', match1to2, match2);
- addRegexToken('YYYY', match1to4, match4);
- addRegexToken('YYYYY', match1to6, match6);
- addRegexToken('YYYYYY', match1to6, match6);
- addParseToken(['YYYYY', 'YYYYYY'], YEAR);
- addParseToken('YYYY', function (input, array) {
- array[YEAR] =
- input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
- });
- addParseToken('YY', function (input, array) {
- array[YEAR] = hooks.parseTwoDigitYear(input);
- });
- addParseToken('Y', function (input, array) {
- array[YEAR] = parseInt(input, 10);
- });
- // HELPERS
- function daysInYear(year) {
- return isLeapYear(year) ? 366 : 365;
- }
- // HOOKS
- hooks.parseTwoDigitYear = function (input) {
- return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
- };
- // MOMENTS
- var getSetYear = makeGetSet('FullYear', true);
- function getIsLeapYear() {
- return isLeapYear(this.year());
- }
- function createDate(y, m, d, h, M, s, ms) {
- // can't just apply() to create a date:
- // https://stackoverflow.com/q/181348
- var date;
- // the date constructor remaps years 0-99 to 1900-1999
- if (y < 100 && y >= 0) {
- // preserve leap years using a full 400 year cycle, then reset
- date = new Date(y + 400, m, d, h, M, s, ms);
- if (isFinite(date.getFullYear())) {
- date.setFullYear(y);
- }
- } else {
- date = new Date(y, m, d, h, M, s, ms);
- }
- return date;
- }
- function createUTCDate(y) {
- var date, args;
- // the Date.UTC function remaps years 0-99 to 1900-1999
- if (y < 100 && y >= 0) {
- args = Array.prototype.slice.call(arguments);
- // preserve leap years using a full 400 year cycle, then reset
- args[0] = y + 400;
- date = new Date(Date.UTC.apply(null, args));
- if (isFinite(date.getUTCFullYear())) {
- date.setUTCFullYear(y);
- }
- } else {
- date = new Date(Date.UTC.apply(null, arguments));
- }
- return date;
- }
- // start-of-first-week - start-of-year
- function firstWeekOffset(year, dow, doy) {
- var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
- fwd = 7 + dow - doy,
- // first-week day local weekday -- which local weekday is fwd
- fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
- return -fwdlw + fwd - 1;
- }
- // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
- function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
- var localWeekday = (7 + weekday - dow) % 7,
- weekOffset = firstWeekOffset(year, dow, doy),
- dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
- resYear,
- resDayOfYear;
- if (dayOfYear <= 0) {
- resYear = year - 1;
- resDayOfYear = daysInYear(resYear) + dayOfYear;
- } else if (dayOfYear > daysInYear(year)) {
- resYear = year + 1;
- resDayOfYear = dayOfYear - daysInYear(year);
- } else {
- resYear = year;
- resDayOfYear = dayOfYear;
- }
- return {
- year: resYear,
- dayOfYear: resDayOfYear,
- };
- }
- function weekOfYear(mom, dow, doy) {
- var weekOffset = firstWeekOffset(mom.year(), dow, doy),
- week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
- resWeek,
- resYear;
- if (week < 1) {
- resYear = mom.year() - 1;
- resWeek = week + weeksInYear(resYear, dow, doy);
- } else if (week > weeksInYear(mom.year(), dow, doy)) {
- resWeek = week - weeksInYear(mom.year(), dow, doy);
- resYear = mom.year() + 1;
- } else {
- resYear = mom.year();
- resWeek = week;
- }
- return {
- week: resWeek,
- year: resYear,
- };
- }
- function weeksInYear(year, dow, doy) {
- var weekOffset = firstWeekOffset(year, dow, doy),
- weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
- return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
- }
- // FORMATTING
- addFormatToken('w', ['ww', 2], 'wo', 'week');
- addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
- // ALIASES
- addUnitAlias('week', 'w');
- addUnitAlias('isoWeek', 'W');
- // PRIORITIES
- addUnitPriority('week', 5);
- addUnitPriority('isoWeek', 5);
- // PARSING
- addRegexToken('w', match1to2);
- addRegexToken('ww', match1to2, match2);
- addRegexToken('W', match1to2);
- addRegexToken('WW', match1to2, match2);
- addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
- input,
- week,
- config,
- token
- ) {
- week[token.substr(0, 1)] = toInt(input);
- });
- // HELPERS
- // LOCALES
- function localeWeek(mom) {
- return weekOfYear(mom, this._week.dow, this._week.doy).week;
- }
- var defaultLocaleWeek = {
- dow: 0, // Sunday is the first day of the week.
- doy: 6, // The week that contains Jan 6th is the first week of the year.
- };
- function localeFirstDayOfWeek() {
- return this._week.dow;
- }
- function localeFirstDayOfYear() {
- return this._week.doy;
- }
- // MOMENTS
- function getSetWeek(input) {
- var week = this.localeData().week(this);
- return input == null ? week : this.add((input - week) * 7, 'd');
- }
- function getSetISOWeek(input) {
- var week = weekOfYear(this, 1, 4).week;
- return input == null ? week : this.add((input - week) * 7, 'd');
- }
- // FORMATTING
- addFormatToken('d', 0, 'do', 'day');
- addFormatToken('dd', 0, 0, function (format) {
- return this.localeData().weekdaysMin(this, format);
- });
- addFormatToken('ddd', 0, 0, function (format) {
- return this.localeData().weekdaysShort(this, format);
- });
- addFormatToken('dddd', 0, 0, function (format) {
- return this.localeData().weekdays(this, format);
- });
- addFormatToken('e', 0, 0, 'weekday');
- addFormatToken('E', 0, 0, 'isoWeekday');
- // ALIASES
- addUnitAlias('day', 'd');
- addUnitAlias('weekday', 'e');
- addUnitAlias('isoWeekday', 'E');
- // PRIORITY
- addUnitPriority('day', 11);
- addUnitPriority('weekday', 11);
- addUnitPriority('isoWeekday', 11);
- // PARSING
- addRegexToken('d', match1to2);
- addRegexToken('e', match1to2);
- addRegexToken('E', match1to2);
- addRegexToken('dd', function (isStrict, locale) {
- return locale.weekdaysMinRegex(isStrict);
- });
- addRegexToken('ddd', function (isStrict, locale) {
- return locale.weekdaysShortRegex(isStrict);
- });
- addRegexToken('dddd', function (isStrict, locale) {
- return locale.weekdaysRegex(isStrict);
- });
- addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
- var weekday = config._locale.weekdaysParse(input, token, config._strict);
- // if we didn't get a weekday name, mark the date as invalid
- if (weekday != null) {
- week.d = weekday;
- } else {
- getParsingFlags(config).invalidWeekday = input;
- }
- });
- addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
- week[token] = toInt(input);
- });
- // HELPERS
- function parseWeekday(input, locale) {
- if (typeof input !== 'string') {
- return input;
- }
- if (!isNaN(input)) {
- return parseInt(input, 10);
- }
- input = locale.weekdaysParse(input);
- if (typeof input === 'number') {
- return input;
- }
- return null;
- }
- function parseIsoWeekday(input, locale) {
- if (typeof input === 'string') {
- return locale.weekdaysParse(input) % 7 || 7;
- }
- return isNaN(input) ? null : input;
- }
- // LOCALES
- function shiftWeekdays(ws, n) {
- return ws.slice(n, 7).concat(ws.slice(0, n));
- }
- var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
- '_'
- ),
- defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
- defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- defaultWeekdaysRegex = matchWord,
- defaultWeekdaysShortRegex = matchWord,
- defaultWeekdaysMinRegex = matchWord;
- function localeWeekdays(m, format) {
- var weekdays = isArray(this._weekdays)
- ? this._weekdays
- : this._weekdays[
- m && m !== true && this._weekdays.isFormat.test(format)
- ? 'format'
- : 'standalone'
- ];
- return m === true
- ? shiftWeekdays(weekdays, this._week.dow)
- : m
- ? weekdays[m.day()]
- : weekdays;
- }
- function localeWeekdaysShort(m) {
- return m === true
- ? shiftWeekdays(this._weekdaysShort, this._week.dow)
- : m
- ? this._weekdaysShort[m.day()]
- : this._weekdaysShort;
- }
- function localeWeekdaysMin(m) {
- return m === true
- ? shiftWeekdays(this._weekdaysMin, this._week.dow)
- : m
- ? this._weekdaysMin[m.day()]
- : this._weekdaysMin;
- }
- function handleStrictParse$1(weekdayName, format, strict) {
- var i,
- ii,
- mom,
- llc = weekdayName.toLocaleLowerCase();
- if (!this._weekdaysParse) {
- this._weekdaysParse = [];
- this._shortWeekdaysParse = [];
- this._minWeekdaysParse = [];
- for (i = 0; i < 7; ++i) {
- mom = createUTC([2000, 1]).day(i);
- this._minWeekdaysParse[i] = this.weekdaysMin(
- mom,
- ''
- ).toLocaleLowerCase();
- this._shortWeekdaysParse[i] = this.weekdaysShort(
- mom,
- ''
- ).toLocaleLowerCase();
- this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
- }
- }
- if (strict) {
- if (format === 'dddd') {
- ii = indexOf.call(this._weekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else if (format === 'ddd') {
- ii = indexOf.call(this._shortWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf.call(this._minWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- }
- } else {
- if (format === 'dddd') {
- ii = indexOf.call(this._weekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._shortWeekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._minWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else if (format === 'ddd') {
- ii = indexOf.call(this._shortWeekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._weekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._minWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf.call(this._minWeekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._weekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._shortWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- }
- }
- }
- function localeWeekdaysParse(weekdayName, format, strict) {
- var i, mom, regex;
- if (this._weekdaysParseExact) {
- return handleStrictParse$1.call(this, weekdayName, format, strict);
- }
- if (!this._weekdaysParse) {
- this._weekdaysParse = [];
- this._minWeekdaysParse = [];
- this._shortWeekdaysParse = [];
- this._fullWeekdaysParse = [];
- }
- for (i = 0; i < 7; i++) {
- // make the regex if we don't have it already
- mom = createUTC([2000, 1]).day(i);
- if (strict && !this._fullWeekdaysParse[i]) {
- this._fullWeekdaysParse[i] = new RegExp(
- '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
- 'i'
- );
- this._shortWeekdaysParse[i] = new RegExp(
- '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
- 'i'
- );
- this._minWeekdaysParse[i] = new RegExp(
- '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
- 'i'
- );
- }
- if (!this._weekdaysParse[i]) {
- regex =
- '^' +
- this.weekdays(mom, '') +
- '|^' +
- this.weekdaysShort(mom, '') +
- '|^' +
- this.weekdaysMin(mom, '');
- this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
- }
- // test the regex
- if (
- strict &&
- format === 'dddd' &&
- this._fullWeekdaysParse[i].test(weekdayName)
- ) {
- return i;
- } else if (
- strict &&
- format === 'ddd' &&
- this._shortWeekdaysParse[i].test(weekdayName)
- ) {
- return i;
- } else if (
- strict &&
- format === 'dd' &&
- this._minWeekdaysParse[i].test(weekdayName)
- ) {
- return i;
- } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
- return i;
- }
- }
- }
- // MOMENTS
- function getSetDayOfWeek(input) {
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
- var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
- if (input != null) {
- input = parseWeekday(input, this.localeData());
- return this.add(input - day, 'd');
- } else {
- return day;
- }
- }
- function getSetLocaleDayOfWeek(input) {
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
- var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
- return input == null ? weekday : this.add(input - weekday, 'd');
- }
- function getSetISODayOfWeek(input) {
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
- // behaves the same as moment#day except
- // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
- // as a setter, sunday should belong to the previous week.
- if (input != null) {
- var weekday = parseIsoWeekday(input, this.localeData());
- return this.day(this.day() % 7 ? weekday : weekday - 7);
- } else {
- return this.day() || 7;
- }
- }
- function weekdaysRegex(isStrict) {
- if (this._weekdaysParseExact) {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- computeWeekdaysParse.call(this);
- }
- if (isStrict) {
- return this._weekdaysStrictRegex;
- } else {
- return this._weekdaysRegex;
- }
- } else {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- this._weekdaysRegex = defaultWeekdaysRegex;
- }
- return this._weekdaysStrictRegex && isStrict
- ? this._weekdaysStrictRegex
- : this._weekdaysRegex;
- }
- }
- function weekdaysShortRegex(isStrict) {
- if (this._weekdaysParseExact) {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- computeWeekdaysParse.call(this);
- }
- if (isStrict) {
- return this._weekdaysShortStrictRegex;
- } else {
- return this._weekdaysShortRegex;
- }
- } else {
- if (!hasOwnProp(this, '_weekdaysShortRegex')) {
- this._weekdaysShortRegex = defaultWeekdaysShortRegex;
- }
- return this._weekdaysShortStrictRegex && isStrict
- ? this._weekdaysShortStrictRegex
- : this._weekdaysShortRegex;
- }
- }
- function weekdaysMinRegex(isStrict) {
- if (this._weekdaysParseExact) {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- computeWeekdaysParse.call(this);
- }
- if (isStrict) {
- return this._weekdaysMinStrictRegex;
- } else {
- return this._weekdaysMinRegex;
- }
- } else {
- if (!hasOwnProp(this, '_weekdaysMinRegex')) {
- this._weekdaysMinRegex = defaultWeekdaysMinRegex;
- }
- return this._weekdaysMinStrictRegex && isStrict
- ? this._weekdaysMinStrictRegex
- : this._weekdaysMinRegex;
- }
- }
- function computeWeekdaysParse() {
- function cmpLenRev(a, b) {
- return b.length - a.length;
- }
- var minPieces = [],
- shortPieces = [],
- longPieces = [],
- mixedPieces = [],
- i,
- mom,
- minp,
- shortp,
- longp;
- for (i = 0; i < 7; i++) {
- // make the regex if we don't have it already
- mom = createUTC([2000, 1]).day(i);
- minp = regexEscape(this.weekdaysMin(mom, ''));
- shortp = regexEscape(this.weekdaysShort(mom, ''));
- longp = regexEscape(this.weekdays(mom, ''));
- minPieces.push(minp);
- shortPieces.push(shortp);
- longPieces.push(longp);
- mixedPieces.push(minp);
- mixedPieces.push(shortp);
- mixedPieces.push(longp);
- }
- // Sorting makes sure if one weekday (or abbr) is a prefix of another it
- // will match the longer piece.
- minPieces.sort(cmpLenRev);
- shortPieces.sort(cmpLenRev);
- longPieces.sort(cmpLenRev);
- mixedPieces.sort(cmpLenRev);
- this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
- this._weekdaysShortRegex = this._weekdaysRegex;
- this._weekdaysMinRegex = this._weekdaysRegex;
- this._weekdaysStrictRegex = new RegExp(
- '^(' + longPieces.join('|') + ')',
- 'i'
- );
- this._weekdaysShortStrictRegex = new RegExp(
- '^(' + shortPieces.join('|') + ')',
- 'i'
- );
- this._weekdaysMinStrictRegex = new RegExp(
- '^(' + minPieces.join('|') + ')',
- 'i'
- );
- }
- // FORMATTING
- function hFormat() {
- return this.hours() % 12 || 12;
- }
- function kFormat() {
- return this.hours() || 24;
- }
- addFormatToken('H', ['HH', 2], 0, 'hour');
- addFormatToken('h', ['hh', 2], 0, hFormat);
- addFormatToken('k', ['kk', 2], 0, kFormat);
- addFormatToken('hmm', 0, 0, function () {
- return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
- });
- addFormatToken('hmmss', 0, 0, function () {
- return (
- '' +
- hFormat.apply(this) +
- zeroFill(this.minutes(), 2) +
- zeroFill(this.seconds(), 2)
- );
- });
- addFormatToken('Hmm', 0, 0, function () {
- return '' + this.hours() + zeroFill(this.minutes(), 2);
- });
- addFormatToken('Hmmss', 0, 0, function () {
- return (
- '' +
- this.hours() +
- zeroFill(this.minutes(), 2) +
- zeroFill(this.seconds(), 2)
- );
- });
- function meridiem(token, lowercase) {
- addFormatToken(token, 0, 0, function () {
- return this.localeData().meridiem(
- this.hours(),
- this.minutes(),
- lowercase
- );
- });
- }
- meridiem('a', true);
- meridiem('A', false);
- // ALIASES
- addUnitAlias('hour', 'h');
- // PRIORITY
- addUnitPriority('hour', 13);
- // PARSING
- function matchMeridiem(isStrict, locale) {
- return locale._meridiemParse;
- }
- addRegexToken('a', matchMeridiem);
- addRegexToken('A', matchMeridiem);
- addRegexToken('H', match1to2);
- addRegexToken('h', match1to2);
- addRegexToken('k', match1to2);
- addRegexToken('HH', match1to2, match2);
- addRegexToken('hh', match1to2, match2);
- addRegexToken('kk', match1to2, match2);
- addRegexToken('hmm', match3to4);
- addRegexToken('hmmss', match5to6);
- addRegexToken('Hmm', match3to4);
- addRegexToken('Hmmss', match5to6);
- addParseToken(['H', 'HH'], HOUR);
- addParseToken(['k', 'kk'], function (input, array, config) {
- var kInput = toInt(input);
- array[HOUR] = kInput === 24 ? 0 : kInput;
- });
- addParseToken(['a', 'A'], function (input, array, config) {
- config._isPm = config._locale.isPM(input);
- config._meridiem = input;
- });
- addParseToken(['h', 'hh'], function (input, array, config) {
- array[HOUR] = toInt(input);
- getParsingFlags(config).bigHour = true;
- });
- addParseToken('hmm', function (input, array, config) {
- var pos = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos));
- array[MINUTE] = toInt(input.substr(pos));
- getParsingFlags(config).bigHour = true;
- });
- addParseToken('hmmss', function (input, array, config) {
- var pos1 = input.length - 4,
- pos2 = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos1));
- array[MINUTE] = toInt(input.substr(pos1, 2));
- array[SECOND] = toInt(input.substr(pos2));
- getParsingFlags(config).bigHour = true;
- });
- addParseToken('Hmm', function (input, array, config) {
- var pos = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos));
- array[MINUTE] = toInt(input.substr(pos));
- });
- addParseToken('Hmmss', function (input, array, config) {
- var pos1 = input.length - 4,
- pos2 = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos1));
- array[MINUTE] = toInt(input.substr(pos1, 2));
- array[SECOND] = toInt(input.substr(pos2));
- });
- // LOCALES
- function localeIsPM(input) {
- // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
- // Using charAt should be more compatible.
- return (input + '').toLowerCase().charAt(0) === 'p';
- }
- var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
- // Setting the hour should keep the time, because the user explicitly
- // specified which hour they want. So trying to maintain the same hour (in
- // a new timezone) makes sense. Adding/subtracting hours does not follow
- // this rule.
- getSetHour = makeGetSet('Hours', true);
- function localeMeridiem(hours, minutes, isLower) {
- if (hours > 11) {
- return isLower ? 'pm' : 'PM';
- } else {
- return isLower ? 'am' : 'AM';
- }
- }
- var baseConfig = {
- calendar: defaultCalendar,
- longDateFormat: defaultLongDateFormat,
- invalidDate: defaultInvalidDate,
- ordinal: defaultOrdinal,
- dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
- relativeTime: defaultRelativeTime,
- months: defaultLocaleMonths,
- monthsShort: defaultLocaleMonthsShort,
- week: defaultLocaleWeek,
- weekdays: defaultLocaleWeekdays,
- weekdaysMin: defaultLocaleWeekdaysMin,
- weekdaysShort: defaultLocaleWeekdaysShort,
- meridiemParse: defaultLocaleMeridiemParse,
- };
- // internal storage for locale config files
- var locales = {},
- localeFamilies = {},
- globalLocale;
- function commonPrefix(arr1, arr2) {
- var i,
- minl = Math.min(arr1.length, arr2.length);
- for (i = 0; i < minl; i += 1) {
- if (arr1[i] !== arr2[i]) {
- return i;
- }
- }
- return minl;
- }
- function normalizeLocale(key) {
- return key ? key.toLowerCase().replace('_', '-') : key;
- }
- // pick the locale from the array
- // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
- // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
- function chooseLocale(names) {
- var i = 0,
- j,
- next,
- locale,
- split;
- while (i < names.length) {
- split = normalizeLocale(names[i]).split('-');
- j = split.length;
- next = normalizeLocale(names[i + 1]);
- next = next ? next.split('-') : null;
- while (j > 0) {
- locale = loadLocale(split.slice(0, j).join('-'));
- if (locale) {
- return locale;
- }
- if (
- next &&
- next.length >= j &&
- commonPrefix(split, next) >= j - 1
- ) {
- //the next array item is better than a shallower substring of this one
- break;
- }
- j--;
- }
- i++;
- }
- return globalLocale;
- }
- function loadLocale(name) {
- var oldLocale = null,
- aliasedRequire;
- // TODO: Find a better way to register and load all the locales in Node
- if (
- locales[name] === undefined &&
- "object" !== 'undefined' &&
- module &&
- module.exports
- ) {
- try {
- oldLocale = globalLocale._abbr;
- aliasedRequire = undefined;
- __webpack_require__(46700)("./" + name);
- getSetGlobalLocale(oldLocale);
- } catch (e) {
- // mark as not found to avoid repeating expensive file require call causing high CPU
- // when trying to find en-US, en_US, en-us for every format call
- locales[name] = null; // null means not found
- }
- }
- return locales[name];
- }
- // This function will load locale and then set the global locale. If
- // no arguments are passed in, it will simply return the current global
- // locale key.
- function getSetGlobalLocale(key, values) {
- var data;
- if (key) {
- if (isUndefined(values)) {
- data = getLocale(key);
- } else {
- data = defineLocale(key, values);
- }
- if (data) {
- // moment.duration._locale = moment._locale = data;
- globalLocale = data;
- } else {
- if (typeof console !== 'undefined' && console.warn) {
- //warn user if arguments are passed but the locale could not be set
- console.warn(
- 'Locale ' + key + ' not found. Did you forget to load it?'
- );
- }
- }
- }
- return globalLocale._abbr;
- }
- function defineLocale(name, config) {
- if (config !== null) {
- var locale,
- parentConfig = baseConfig;
- config.abbr = name;
- if (locales[name] != null) {
- deprecateSimple(
- 'defineLocaleOverride',
- 'use moment.updateLocale(localeName, config) to change ' +
- 'an existing locale. moment.defineLocale(localeName, ' +
- 'config) should only be used for creating a new locale ' +
- 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
- );
- parentConfig = locales[name]._config;
- } else if (config.parentLocale != null) {
- if (locales[config.parentLocale] != null) {
- parentConfig = locales[config.parentLocale]._config;
- } else {
- locale = loadLocale(config.parentLocale);
- if (locale != null) {
- parentConfig = locale._config;
- } else {
- if (!localeFamilies[config.parentLocale]) {
- localeFamilies[config.parentLocale] = [];
- }
- localeFamilies[config.parentLocale].push({
- name: name,
- config: config,
- });
- return null;
- }
- }
- }
- locales[name] = new Locale(mergeConfigs(parentConfig, config));
- if (localeFamilies[name]) {
- localeFamilies[name].forEach(function (x) {
- defineLocale(x.name, x.config);
- });
- }
- // backwards compat for now: also set the locale
- // make sure we set the locale AFTER all child locales have been
- // created, so we won't end up with the child locale set.
- getSetGlobalLocale(name);
- return locales[name];
- } else {
- // useful for testing
- delete locales[name];
- return null;
- }
- }
- function updateLocale(name, config) {
- if (config != null) {
- var locale,
- tmpLocale,
- parentConfig = baseConfig;
- if (locales[name] != null && locales[name].parentLocale != null) {
- // Update existing child locale in-place to avoid memory-leaks
- locales[name].set(mergeConfigs(locales[name]._config, config));
- } else {
- // MERGE
- tmpLocale = loadLocale(name);
- if (tmpLocale != null) {
- parentConfig = tmpLocale._config;
- }
- config = mergeConfigs(parentConfig, config);
- if (tmpLocale == null) {
- // updateLocale is called for creating a new locale
- // Set abbr so it will have a name (getters return
- // undefined otherwise).
- config.abbr = name;
- }
- locale = new Locale(config);
- locale.parentLocale = locales[name];
- locales[name] = locale;
- }
- // backwards compat for now: also set the locale
- getSetGlobalLocale(name);
- } else {
- // pass null for config to unupdate, useful for tests
- if (locales[name] != null) {
- if (locales[name].parentLocale != null) {
- locales[name] = locales[name].parentLocale;
- if (name === getSetGlobalLocale()) {
- getSetGlobalLocale(name);
- }
- } else if (locales[name] != null) {
- delete locales[name];
- }
- }
- }
- return locales[name];
- }
- // returns locale data
- function getLocale(key) {
- var locale;
- if (key && key._locale && key._locale._abbr) {
- key = key._locale._abbr;
- }
- if (!key) {
- return globalLocale;
- }
- if (!isArray(key)) {
- //short-circuit everything else
- locale = loadLocale(key);
- if (locale) {
- return locale;
- }
- key = [key];
- }
- return chooseLocale(key);
- }
- function listLocales() {
- return keys(locales);
- }
- function checkOverflow(m) {
- var overflow,
- a = m._a;
- if (a && getParsingFlags(m).overflow === -2) {
- overflow =
- a[MONTH] < 0 || a[MONTH] > 11
- ? MONTH
- : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
- ? DATE
- : a[HOUR] < 0 ||
- a[HOUR] > 24 ||
- (a[HOUR] === 24 &&
- (a[MINUTE] !== 0 ||
- a[SECOND] !== 0 ||
- a[MILLISECOND] !== 0))
- ? HOUR
- : a[MINUTE] < 0 || a[MINUTE] > 59
- ? MINUTE
- : a[SECOND] < 0 || a[SECOND] > 59
- ? SECOND
- : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
- ? MILLISECOND
- : -1;
- if (
- getParsingFlags(m)._overflowDayOfYear &&
- (overflow < YEAR || overflow > DATE)
- ) {
- overflow = DATE;
- }
- if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
- overflow = WEEK;
- }
- if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
- overflow = WEEKDAY;
- }
- getParsingFlags(m).overflow = overflow;
- }
- return m;
- }
- // iso 8601 regex
- // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
- var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
- basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
- tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
- isoDates = [
- ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
- ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
- ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
- ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
- ['YYYY-DDD', /\d{4}-\d{3}/],
- ['YYYY-MM', /\d{4}-\d\d/, false],
- ['YYYYYYMMDD', /[+-]\d{10}/],
- ['YYYYMMDD', /\d{8}/],
- ['GGGG[W]WWE', /\d{4}W\d{3}/],
- ['GGGG[W]WW', /\d{4}W\d{2}/, false],
- ['YYYYDDD', /\d{7}/],
- ['YYYYMM', /\d{6}/, false],
- ['YYYY', /\d{4}/, false],
- ],
- // iso time formats and regexes
- isoTimes = [
- ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
- ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
- ['HH:mm:ss', /\d\d:\d\d:\d\d/],
- ['HH:mm', /\d\d:\d\d/],
- ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
- ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
- ['HHmmss', /\d\d\d\d\d\d/],
- ['HHmm', /\d\d\d\d/],
- ['HH', /\d\d/],
- ],
- aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
- // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
- rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
- obsOffsets = {
- UT: 0,
- GMT: 0,
- EDT: -4 * 60,
- EST: -5 * 60,
- CDT: -5 * 60,
- CST: -6 * 60,
- MDT: -6 * 60,
- MST: -7 * 60,
- PDT: -7 * 60,
- PST: -8 * 60,
- };
- // date from iso format
- function configFromISO(config) {
- var i,
- l,
- string = config._i,
- match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
- allowTime,
- dateFormat,
- timeFormat,
- tzFormat;
- if (match) {
- getParsingFlags(config).iso = true;
- for (i = 0, l = isoDates.length; i < l; i++) {
- if (isoDates[i][1].exec(match[1])) {
- dateFormat = isoDates[i][0];
- allowTime = isoDates[i][2] !== false;
- break;
- }
- }
- if (dateFormat == null) {
- config._isValid = false;
- return;
- }
- if (match[3]) {
- for (i = 0, l = isoTimes.length; i < l; i++) {
- if (isoTimes[i][1].exec(match[3])) {
- // match[2] should be 'T' or space
- timeFormat = (match[2] || ' ') + isoTimes[i][0];
- break;
- }
- }
- if (timeFormat == null) {
- config._isValid = false;
- return;
- }
- }
- if (!allowTime && timeFormat != null) {
- config._isValid = false;
- return;
- }
- if (match[4]) {
- if (tzRegex.exec(match[4])) {
- tzFormat = 'Z';
- } else {
- config._isValid = false;
- return;
- }
- }
- config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
- configFromStringAndFormat(config);
- } else {
- config._isValid = false;
- }
- }
- function extractFromRFC2822Strings(
- yearStr,
- monthStr,
- dayStr,
- hourStr,
- minuteStr,
- secondStr
- ) {
- var result = [
- untruncateYear(yearStr),
- defaultLocaleMonthsShort.indexOf(monthStr),
- parseInt(dayStr, 10),
- parseInt(hourStr, 10),
- parseInt(minuteStr, 10),
- ];
- if (secondStr) {
- result.push(parseInt(secondStr, 10));
- }
- return result;
- }
- function untruncateYear(yearStr) {
- var year = parseInt(yearStr, 10);
- if (year <= 49) {
- return 2000 + year;
- } else if (year <= 999) {
- return 1900 + year;
- }
- return year;
- }
- function preprocessRFC2822(s) {
- // Remove comments and folding whitespace and replace multiple-spaces with a single space
- return s
- .replace(/\([^)]*\)|[\n\t]/g, ' ')
- .replace(/(\s\s+)/g, ' ')
- .replace(/^\s\s*/, '')
- .replace(/\s\s*$/, '');
- }
- function checkWeekday(weekdayStr, parsedInput, config) {
- if (weekdayStr) {
- // TODO: Replace the vanilla JS Date object with an independent day-of-week check.
- var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
- weekdayActual = new Date(
- parsedInput[0],
- parsedInput[1],
- parsedInput[2]
- ).getDay();
- if (weekdayProvided !== weekdayActual) {
- getParsingFlags(config).weekdayMismatch = true;
- config._isValid = false;
- return false;
- }
- }
- return true;
- }
- function calculateOffset(obsOffset, militaryOffset, numOffset) {
- if (obsOffset) {
- return obsOffsets[obsOffset];
- } else if (militaryOffset) {
- // the only allowed military tz is Z
- return 0;
- } else {
- var hm = parseInt(numOffset, 10),
- m = hm % 100,
- h = (hm - m) / 100;
- return h * 60 + m;
- }
- }
- // date and time from ref 2822 format
- function configFromRFC2822(config) {
- var match = rfc2822.exec(preprocessRFC2822(config._i)),
- parsedArray;
- if (match) {
- parsedArray = extractFromRFC2822Strings(
- match[4],
- match[3],
- match[2],
- match[5],
- match[6],
- match[7]
- );
- if (!checkWeekday(match[1], parsedArray, config)) {
- return;
- }
- config._a = parsedArray;
- config._tzm = calculateOffset(match[8], match[9], match[10]);
- config._d = createUTCDate.apply(null, config._a);
- config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
- getParsingFlags(config).rfc2822 = true;
- } else {
- config._isValid = false;
- }
- }
- // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
- function configFromString(config) {
- var matched = aspNetJsonRegex.exec(config._i);
- if (matched !== null) {
- config._d = new Date(+matched[1]);
- return;
- }
- configFromISO(config);
- if (config._isValid === false) {
- delete config._isValid;
- } else {
- return;
- }
- configFromRFC2822(config);
- if (config._isValid === false) {
- delete config._isValid;
- } else {
- return;
- }
- if (config._strict) {
- config._isValid = false;
- } else {
- // Final attempt, use Input Fallback
- hooks.createFromInputFallback(config);
- }
- }
- hooks.createFromInputFallback = deprecate(
- 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
- 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
- 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',
- function (config) {
- config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
- }
- );
- // Pick the first defined of two or three arguments.
- function defaults(a, b, c) {
- if (a != null) {
- return a;
- }
- if (b != null) {
- return b;
- }
- return c;
- }
- function currentDateArray(config) {
- // hooks is actually the exported moment object
- var nowValue = new Date(hooks.now());
- if (config._useUTC) {
- return [
- nowValue.getUTCFullYear(),
- nowValue.getUTCMonth(),
- nowValue.getUTCDate(),
- ];
- }
- return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
- }
- // convert an array to a date.
- // the array should mirror the parameters below
- // note: all values past the year are optional and will default to the lowest possible value.
- // [year, month, day , hour, minute, second, millisecond]
- function configFromArray(config) {
- var i,
- date,
- input = [],
- currentDate,
- expectedWeekday,
- yearToUse;
- if (config._d) {
- return;
- }
- currentDate = currentDateArray(config);
- //compute day of the year from weeks and weekdays
- if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
- dayOfYearFromWeekInfo(config);
- }
- //if the day of the year is set, figure out what it is
- if (config._dayOfYear != null) {
- yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
- if (
- config._dayOfYear > daysInYear(yearToUse) ||
- config._dayOfYear === 0
- ) {
- getParsingFlags(config)._overflowDayOfYear = true;
- }
- date = createUTCDate(yearToUse, 0, config._dayOfYear);
- config._a[MONTH] = date.getUTCMonth();
- config._a[DATE] = date.getUTCDate();
- }
- // Default to current date.
- // * if no year, month, day of month are given, default to today
- // * if day of month is given, default month and year
- // * if month is given, default only year
- // * if year is given, don't default anything
- for (i = 0; i < 3 && config._a[i] == null; ++i) {
- config._a[i] = input[i] = currentDate[i];
- }
- // Zero out whatever was not defaulted, including time
- for (; i < 7; i++) {
- config._a[i] = input[i] =
- config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
- }
- // Check for 24:00:00.000
- if (
- config._a[HOUR] === 24 &&
- config._a[MINUTE] === 0 &&
- config._a[SECOND] === 0 &&
- config._a[MILLISECOND] === 0
- ) {
- config._nextDay = true;
- config._a[HOUR] = 0;
- }
- config._d = (config._useUTC ? createUTCDate : createDate).apply(
- null,
- input
- );
- expectedWeekday = config._useUTC
- ? config._d.getUTCDay()
- : config._d.getDay();
- // Apply timezone offset from input. The actual utcOffset can be changed
- // with parseZone.
- if (config._tzm != null) {
- config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
- }
- if (config._nextDay) {
- config._a[HOUR] = 24;
- }
- // check for mismatching day of week
- if (
- config._w &&
- typeof config._w.d !== 'undefined' &&
- config._w.d !== expectedWeekday
- ) {
- getParsingFlags(config).weekdayMismatch = true;
- }
- }
- function dayOfYearFromWeekInfo(config) {
- var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
- w = config._w;
- if (w.GG != null || w.W != null || w.E != null) {
- dow = 1;
- doy = 4;
- // TODO: We need to take the current isoWeekYear, but that depends on
- // how we interpret now (local, utc, fixed offset). So create
- // a now version of current config (take local/utc/offset flags, and
- // create now).
- weekYear = defaults(
- w.GG,
- config._a[YEAR],
- weekOfYear(createLocal(), 1, 4).year
- );
- week = defaults(w.W, 1);
- weekday = defaults(w.E, 1);
- if (weekday < 1 || weekday > 7) {
- weekdayOverflow = true;
- }
- } else {
- dow = config._locale._week.dow;
- doy = config._locale._week.doy;
- curWeek = weekOfYear(createLocal(), dow, doy);
- weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
- // Default to current week.
- week = defaults(w.w, curWeek.week);
- if (w.d != null) {
- // weekday -- low day numbers are considered next week
- weekday = w.d;
- if (weekday < 0 || weekday > 6) {
- weekdayOverflow = true;
- }
- } else if (w.e != null) {
- // local weekday -- counting starts from beginning of week
- weekday = w.e + dow;
- if (w.e < 0 || w.e > 6) {
- weekdayOverflow = true;
- }
- } else {
- // default to beginning of week
- weekday = dow;
- }
- }
- if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
- getParsingFlags(config)._overflowWeeks = true;
- } else if (weekdayOverflow != null) {
- getParsingFlags(config)._overflowWeekday = true;
- } else {
- temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
- config._a[YEAR] = temp.year;
- config._dayOfYear = temp.dayOfYear;
- }
- }
- // constant that refers to the ISO standard
- hooks.ISO_8601 = function () {};
- // constant that refers to the RFC 2822 form
- hooks.RFC_2822 = function () {};
- // date from string and format string
- function configFromStringAndFormat(config) {
- // TODO: Move this to another part of the creation flow to prevent circular deps
- if (config._f === hooks.ISO_8601) {
- configFromISO(config);
- return;
- }
- if (config._f === hooks.RFC_2822) {
- configFromRFC2822(config);
- return;
- }
- config._a = [];
- getParsingFlags(config).empty = true;
- // This array is used to make a Date, either with `new Date` or `Date.UTC`
- var string = '' + config._i,
- i,
- parsedInput,
- tokens,
- token,
- skipped,
- stringLength = string.length,
- totalParsedInputLength = 0,
- era;
- tokens =
- expandFormat(config._f, config._locale).match(formattingTokens) || [];
- for (i = 0; i < tokens.length; i++) {
- token = tokens[i];
- parsedInput = (string.match(getParseRegexForToken(token, config)) ||
- [])[0];
- if (parsedInput) {
- skipped = string.substr(0, string.indexOf(parsedInput));
- if (skipped.length > 0) {
- getParsingFlags(config).unusedInput.push(skipped);
- }
- string = string.slice(
- string.indexOf(parsedInput) + parsedInput.length
- );
- totalParsedInputLength += parsedInput.length;
- }
- // don't parse if it's not a known token
- if (formatTokenFunctions[token]) {
- if (parsedInput) {
- getParsingFlags(config).empty = false;
- } else {
- getParsingFlags(config).unusedTokens.push(token);
- }
- addTimeToArrayFromToken(token, parsedInput, config);
- } else if (config._strict && !parsedInput) {
- getParsingFlags(config).unusedTokens.push(token);
- }
- }
- // add remaining unparsed input length to the string
- getParsingFlags(config).charsLeftOver =
- stringLength - totalParsedInputLength;
- if (string.length > 0) {
- getParsingFlags(config).unusedInput.push(string);
- }
- // clear _12h flag if hour is <= 12
- if (
- config._a[HOUR] <= 12 &&
- getParsingFlags(config).bigHour === true &&
- config._a[HOUR] > 0
- ) {
- getParsingFlags(config).bigHour = undefined;
- }
- getParsingFlags(config).parsedDateParts = config._a.slice(0);
- getParsingFlags(config).meridiem = config._meridiem;
- // handle meridiem
- config._a[HOUR] = meridiemFixWrap(
- config._locale,
- config._a[HOUR],
- config._meridiem
- );
- // handle era
- era = getParsingFlags(config).era;
- if (era !== null) {
- config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
- }
- configFromArray(config);
- checkOverflow(config);
- }
- function meridiemFixWrap(locale, hour, meridiem) {
- var isPm;
- if (meridiem == null) {
- // nothing to do
- return hour;
- }
- if (locale.meridiemHour != null) {
- return locale.meridiemHour(hour, meridiem);
- } else if (locale.isPM != null) {
- // Fallback
- isPm = locale.isPM(meridiem);
- if (isPm && hour < 12) {
- hour += 12;
- }
- if (!isPm && hour === 12) {
- hour = 0;
- }
- return hour;
- } else {
- // this is not supposed to happen
- return hour;
- }
- }
- // date from string and array of format strings
- function configFromStringAndArray(config) {
- var tempConfig,
- bestMoment,
- scoreToBeat,
- i,
- currentScore,
- validFormatFound,
- bestFormatIsValid = false;
- if (config._f.length === 0) {
- getParsingFlags(config).invalidFormat = true;
- config._d = new Date(NaN);
- return;
- }
- for (i = 0; i < config._f.length; i++) {
- currentScore = 0;
- validFormatFound = false;
- tempConfig = copyConfig({}, config);
- if (config._useUTC != null) {
- tempConfig._useUTC = config._useUTC;
- }
- tempConfig._f = config._f[i];
- configFromStringAndFormat(tempConfig);
- if (isValid(tempConfig)) {
- validFormatFound = true;
- }
- // if there is any input that was not parsed add a penalty for that format
- currentScore += getParsingFlags(tempConfig).charsLeftOver;
- //or tokens
- currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
- getParsingFlags(tempConfig).score = currentScore;
- if (!bestFormatIsValid) {
- if (
- scoreToBeat == null ||
- currentScore < scoreToBeat ||
- validFormatFound
- ) {
- scoreToBeat = currentScore;
- bestMoment = tempConfig;
- if (validFormatFound) {
- bestFormatIsValid = true;
- }
- }
- } else {
- if (currentScore < scoreToBeat) {
- scoreToBeat = currentScore;
- bestMoment = tempConfig;
- }
- }
- }
- extend(config, bestMoment || tempConfig);
- }
- function configFromObject(config) {
- if (config._d) {
- return;
- }
- var i = normalizeObjectUnits(config._i),
- dayOrDate = i.day === undefined ? i.date : i.day;
- config._a = map(
- [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
- function (obj) {
- return obj && parseInt(obj, 10);
- }
- );
- configFromArray(config);
- }
- function createFromConfig(config) {
- var res = new Moment(checkOverflow(prepareConfig(config)));
- if (res._nextDay) {
- // Adding is smart enough around DST
- res.add(1, 'd');
- res._nextDay = undefined;
- }
- return res;
- }
- function prepareConfig(config) {
- var input = config._i,
- format = config._f;
- config._locale = config._locale || getLocale(config._l);
- if (input === null || (format === undefined && input === '')) {
- return createInvalid({ nullInput: true });
- }
- if (typeof input === 'string') {
- config._i = input = config._locale.preparse(input);
- }
- if (isMoment(input)) {
- return new Moment(checkOverflow(input));
- } else if (isDate(input)) {
- config._d = input;
- } else if (isArray(format)) {
- configFromStringAndArray(config);
- } else if (format) {
- configFromStringAndFormat(config);
- } else {
- configFromInput(config);
- }
- if (!isValid(config)) {
- config._d = null;
- }
- return config;
- }
- function configFromInput(config) {
- var input = config._i;
- if (isUndefined(input)) {
- config._d = new Date(hooks.now());
- } else if (isDate(input)) {
- config._d = new Date(input.valueOf());
- } else if (typeof input === 'string') {
- configFromString(config);
- } else if (isArray(input)) {
- config._a = map(input.slice(0), function (obj) {
- return parseInt(obj, 10);
- });
- configFromArray(config);
- } else if (isObject(input)) {
- configFromObject(config);
- } else if (isNumber(input)) {
- // from milliseconds
- config._d = new Date(input);
- } else {
- hooks.createFromInputFallback(config);
- }
- }
- function createLocalOrUTC(input, format, locale, strict, isUTC) {
- var c = {};
- if (format === true || format === false) {
- strict = format;
- format = undefined;
- }
- if (locale === true || locale === false) {
- strict = locale;
- locale = undefined;
- }
- if (
- (isObject(input) && isObjectEmpty(input)) ||
- (isArray(input) && input.length === 0)
- ) {
- input = undefined;
- }
- // object construction must be done this way.
- // https://github.com/moment/moment/issues/1423
- c._isAMomentObject = true;
- c._useUTC = c._isUTC = isUTC;
- c._l = locale;
- c._i = input;
- c._f = format;
- c._strict = strict;
- return createFromConfig(c);
- }
- function createLocal(input, format, locale, strict) {
- return createLocalOrUTC(input, format, locale, strict, false);
- }
- var prototypeMin = deprecate(
- 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
- function () {
- var other = createLocal.apply(null, arguments);
- if (this.isValid() && other.isValid()) {
- return other < this ? this : other;
- } else {
- return createInvalid();
- }
- }
- ),
- prototypeMax = deprecate(
- 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
- function () {
- var other = createLocal.apply(null, arguments);
- if (this.isValid() && other.isValid()) {
- return other > this ? this : other;
- } else {
- return createInvalid();
- }
- }
- );
- // Pick a moment m from moments so that m[fn](other) is true for all
- // other. This relies on the function fn to be transitive.
- //
- // moments should either be an array of moment objects or an array, whose
- // first element is an array of moment objects.
- function pickBy(fn, moments) {
- var res, i;
- if (moments.length === 1 && isArray(moments[0])) {
- moments = moments[0];
- }
- if (!moments.length) {
- return createLocal();
- }
- res = moments[0];
- for (i = 1; i < moments.length; ++i) {
- if (!moments[i].isValid() || moments[i][fn](res)) {
- res = moments[i];
- }
- }
- return res;
- }
- // TODO: Use [].sort instead?
- function min() {
- var args = [].slice.call(arguments, 0);
- return pickBy('isBefore', args);
- }
- function max() {
- var args = [].slice.call(arguments, 0);
- return pickBy('isAfter', args);
- }
- var now = function () {
- return Date.now ? Date.now() : +new Date();
- };
- var ordering = [
- 'year',
- 'quarter',
- 'month',
- 'week',
- 'day',
- 'hour',
- 'minute',
- 'second',
- 'millisecond',
- ];
- function isDurationValid(m) {
- var key,
- unitHasDecimal = false,
- i;
- for (key in m) {
- if (
- hasOwnProp(m, key) &&
- !(
- indexOf.call(ordering, key) !== -1 &&
- (m[key] == null || !isNaN(m[key]))
- )
- ) {
- return false;
- }
- }
- for (i = 0; i < ordering.length; ++i) {
- if (m[ordering[i]]) {
- if (unitHasDecimal) {
- return false; // only allow non-integers for smallest unit
- }
- if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
- unitHasDecimal = true;
- }
- }
- }
- return true;
- }
- function isValid$1() {
- return this._isValid;
- }
- function createInvalid$1() {
- return createDuration(NaN);
- }
- function Duration(duration) {
- var normalizedInput = normalizeObjectUnits(duration),
- years = normalizedInput.year || 0,
- quarters = normalizedInput.quarter || 0,
- months = normalizedInput.month || 0,
- weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
- days = normalizedInput.day || 0,
- hours = normalizedInput.hour || 0,
- minutes = normalizedInput.minute || 0,
- seconds = normalizedInput.second || 0,
- milliseconds = normalizedInput.millisecond || 0;
- this._isValid = isDurationValid(normalizedInput);
- // representation for dateAddRemove
- this._milliseconds =
- +milliseconds +
- seconds * 1e3 + // 1000
- minutes * 6e4 + // 1000 * 60
- hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
- // Because of dateAddRemove treats 24 hours as different from a
- // day when working around DST, we need to store them separately
- this._days = +days + weeks * 7;
- // It is impossible to translate months into days without knowing
- // which months you are are talking about, so we have to store
- // it separately.
- this._months = +months + quarters * 3 + years * 12;
- this._data = {};
- this._locale = getLocale();
- this._bubble();
- }
- function isDuration(obj) {
- return obj instanceof Duration;
- }
- function absRound(number) {
- if (number < 0) {
- return Math.round(-1 * number) * -1;
- } else {
- return Math.round(number);
- }
- }
- // compare two arrays, return the number of differences
- function compareArrays(array1, array2, dontConvert) {
- var len = Math.min(array1.length, array2.length),
- lengthDiff = Math.abs(array1.length - array2.length),
- diffs = 0,
- i;
- for (i = 0; i < len; i++) {
- if (
- (dontConvert && array1[i] !== array2[i]) ||
- (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
- ) {
- diffs++;
- }
- }
- return diffs + lengthDiff;
- }
- // FORMATTING
- function offset(token, separator) {
- addFormatToken(token, 0, 0, function () {
- var offset = this.utcOffset(),
- sign = '+';
- if (offset < 0) {
- offset = -offset;
- sign = '-';
- }
- return (
- sign +
- zeroFill(~~(offset / 60), 2) +
- separator +
- zeroFill(~~offset % 60, 2)
- );
- });
- }
- offset('Z', ':');
- offset('ZZ', '');
- // PARSING
- addRegexToken('Z', matchShortOffset);
- addRegexToken('ZZ', matchShortOffset);
- addParseToken(['Z', 'ZZ'], function (input, array, config) {
- config._useUTC = true;
- config._tzm = offsetFromString(matchShortOffset, input);
- });
- // HELPERS
- // timezone chunker
- // '+10:00' > ['10', '00']
- // '-1530' > ['-15', '30']
- var chunkOffset = /([\+\-]|\d\d)/gi;
- function offsetFromString(matcher, string) {
- var matches = (string || '').match(matcher),
- chunk,
- parts,
- minutes;
- if (matches === null) {
- return null;
- }
- chunk = matches[matches.length - 1] || [];
- parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
- minutes = +(parts[1] * 60) + toInt(parts[2]);
- return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
- }
- // Return a moment from input, that is local/utc/zone equivalent to model.
- function cloneWithOffset(input, model) {
- var res, diff;
- if (model._isUTC) {
- res = model.clone();
- diff =
- (isMoment(input) || isDate(input)
- ? input.valueOf()
- : createLocal(input).valueOf()) - res.valueOf();
- // Use low-level api, because this fn is low-level api.
- res._d.setTime(res._d.valueOf() + diff);
- hooks.updateOffset(res, false);
- return res;
- } else {
- return createLocal(input).local();
- }
- }
- function getDateOffset(m) {
- // On Firefox.24 Date#getTimezoneOffset returns a floating point.
- // https://github.com/moment/moment/pull/1871
- return -Math.round(m._d.getTimezoneOffset());
- }
- // HOOKS
- // This function will be called whenever a moment is mutated.
- // It is intended to keep the offset in sync with the timezone.
- hooks.updateOffset = function () {};
- // MOMENTS
- // keepLocalTime = true means only change the timezone, without
- // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
- // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
- // +0200, so we adjust the time as needed, to be valid.
- //
- // Keeping the time actually adds/subtracts (one hour)
- // from the actual represented time. That is why we call updateOffset
- // a second time. In case it wants us to change the offset again
- // _changeInProgress == true case, then we have to adjust, because
- // there is no such time in the given timezone.
- function getSetOffset(input, keepLocalTime, keepMinutes) {
- var offset = this._offset || 0,
- localAdjust;
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
- if (input != null) {
- if (typeof input === 'string') {
- input = offsetFromString(matchShortOffset, input);
- if (input === null) {
- return this;
- }
- } else if (Math.abs(input) < 16 && !keepMinutes) {
- input = input * 60;
- }
- if (!this._isUTC && keepLocalTime) {
- localAdjust = getDateOffset(this);
- }
- this._offset = input;
- this._isUTC = true;
- if (localAdjust != null) {
- this.add(localAdjust, 'm');
- }
- if (offset !== input) {
- if (!keepLocalTime || this._changeInProgress) {
- addSubtract(
- this,
- createDuration(input - offset, 'm'),
- 1,
- false
- );
- } else if (!this._changeInProgress) {
- this._changeInProgress = true;
- hooks.updateOffset(this, true);
- this._changeInProgress = null;
- }
- }
- return this;
- } else {
- return this._isUTC ? offset : getDateOffset(this);
- }
- }
- function getSetZone(input, keepLocalTime) {
- if (input != null) {
- if (typeof input !== 'string') {
- input = -input;
- }
- this.utcOffset(input, keepLocalTime);
- return this;
- } else {
- return -this.utcOffset();
- }
- }
- function setOffsetToUTC(keepLocalTime) {
- return this.utcOffset(0, keepLocalTime);
- }
- function setOffsetToLocal(keepLocalTime) {
- if (this._isUTC) {
- this.utcOffset(0, keepLocalTime);
- this._isUTC = false;
- if (keepLocalTime) {
- this.subtract(getDateOffset(this), 'm');
- }
- }
- return this;
- }
- function setOffsetToParsedOffset() {
- if (this._tzm != null) {
- this.utcOffset(this._tzm, false, true);
- } else if (typeof this._i === 'string') {
- var tZone = offsetFromString(matchOffset, this._i);
- if (tZone != null) {
- this.utcOffset(tZone);
- } else {
- this.utcOffset(0, true);
- }
- }
- return this;
- }
- function hasAlignedHourOffset(input) {
- if (!this.isValid()) {
- return false;
- }
- input = input ? createLocal(input).utcOffset() : 0;
- return (this.utcOffset() - input) % 60 === 0;
- }
- function isDaylightSavingTime() {
- return (
- this.utcOffset() > this.clone().month(0).utcOffset() ||
- this.utcOffset() > this.clone().month(5).utcOffset()
- );
- }
- function isDaylightSavingTimeShifted() {
- if (!isUndefined(this._isDSTShifted)) {
- return this._isDSTShifted;
- }
- var c = {},
- other;
- copyConfig(c, this);
- c = prepareConfig(c);
- if (c._a) {
- other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
- this._isDSTShifted =
- this.isValid() && compareArrays(c._a, other.toArray()) > 0;
- } else {
- this._isDSTShifted = false;
- }
- return this._isDSTShifted;
- }
- function isLocal() {
- return this.isValid() ? !this._isUTC : false;
- }
- function isUtcOffset() {
- return this.isValid() ? this._isUTC : false;
- }
- function isUtc() {
- return this.isValid() ? this._isUTC && this._offset === 0 : false;
- }
- // ASP.NET json date format regex
- var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
- // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
- // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
- // and further modified to allow for strings containing both week and day
- isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
- function createDuration(input, key) {
- var duration = input,
- // matching against regexp is expensive, do it on demand
- match = null,
- sign,
- ret,
- diffRes;
- if (isDuration(input)) {
- duration = {
- ms: input._milliseconds,
- d: input._days,
- M: input._months,
- };
- } else if (isNumber(input) || !isNaN(+input)) {
- duration = {};
- if (key) {
- duration[key] = +input;
- } else {
- duration.milliseconds = +input;
- }
- } else if ((match = aspNetRegex.exec(input))) {
- sign = match[1] === '-' ? -1 : 1;
- duration = {
- y: 0,
- d: toInt(match[DATE]) * sign,
- h: toInt(match[HOUR]) * sign,
- m: toInt(match[MINUTE]) * sign,
- s: toInt(match[SECOND]) * sign,
- ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
- };
- } else if ((match = isoRegex.exec(input))) {
- sign = match[1] === '-' ? -1 : 1;
- duration = {
- y: parseIso(match[2], sign),
- M: parseIso(match[3], sign),
- w: parseIso(match[4], sign),
- d: parseIso(match[5], sign),
- h: parseIso(match[6], sign),
- m: parseIso(match[7], sign),
- s: parseIso(match[8], sign),
- };
- } else if (duration == null) {
- // checks for null or undefined
- duration = {};
- } else if (
- typeof duration === 'object' &&
- ('from' in duration || 'to' in duration)
- ) {
- diffRes = momentsDifference(
- createLocal(duration.from),
- createLocal(duration.to)
- );
- duration = {};
- duration.ms = diffRes.milliseconds;
- duration.M = diffRes.months;
- }
- ret = new Duration(duration);
- if (isDuration(input) && hasOwnProp(input, '_locale')) {
- ret._locale = input._locale;
- }
- if (isDuration(input) && hasOwnProp(input, '_isValid')) {
- ret._isValid = input._isValid;
- }
- return ret;
- }
- createDuration.fn = Duration.prototype;
- createDuration.invalid = createInvalid$1;
- function parseIso(inp, sign) {
- // We'd normally use ~~inp for this, but unfortunately it also
- // converts floats to ints.
- // inp may be undefined, so careful calling replace on it.
- var res = inp && parseFloat(inp.replace(',', '.'));
- // apply sign while we're at it
- return (isNaN(res) ? 0 : res) * sign;
- }
- function positiveMomentsDifference(base, other) {
- var res = {};
- res.months =
- other.month() - base.month() + (other.year() - base.year()) * 12;
- if (base.clone().add(res.months, 'M').isAfter(other)) {
- --res.months;
- }
- res.milliseconds = +other - +base.clone().add(res.months, 'M');
- return res;
- }
- function momentsDifference(base, other) {
- var res;
- if (!(base.isValid() && other.isValid())) {
- return { milliseconds: 0, months: 0 };
- }
- other = cloneWithOffset(other, base);
- if (base.isBefore(other)) {
- res = positiveMomentsDifference(base, other);
- } else {
- res = positiveMomentsDifference(other, base);
- res.milliseconds = -res.milliseconds;
- res.months = -res.months;
- }
- return res;
- }
- // TODO: remove 'name' arg after deprecation is removed
- function createAdder(direction, name) {
- return function (val, period) {
- var dur, tmp;
- //invert the arguments, but complain about it
- if (period !== null && !isNaN(+period)) {
- deprecateSimple(
- name,
- 'moment().' +
- name +
- '(period, number) is deprecated. Please use moment().' +
- name +
- '(number, period). ' +
- 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
- );
- tmp = val;
- val = period;
- period = tmp;
- }
- dur = createDuration(val, period);
- addSubtract(this, dur, direction);
- return this;
- };
- }
- function addSubtract(mom, duration, isAdding, updateOffset) {
- var milliseconds = duration._milliseconds,
- days = absRound(duration._days),
- months = absRound(duration._months);
- if (!mom.isValid()) {
- // No op
- return;
- }
- updateOffset = updateOffset == null ? true : updateOffset;
- if (months) {
- setMonth(mom, get(mom, 'Month') + months * isAdding);
- }
- if (days) {
- set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
- }
- if (milliseconds) {
- mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
- }
- if (updateOffset) {
- hooks.updateOffset(mom, days || months);
- }
- }
- var add = createAdder(1, 'add'),
- subtract = createAdder(-1, 'subtract');
- function isString(input) {
- return typeof input === 'string' || input instanceof String;
- }
- // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
- function isMomentInput(input) {
- return (
- isMoment(input) ||
- isDate(input) ||
- isString(input) ||
- isNumber(input) ||
- isNumberOrStringArray(input) ||
- isMomentInputObject(input) ||
- input === null ||
- input === undefined
- );
- }
- function isMomentInputObject(input) {
- var objectTest = isObject(input) && !isObjectEmpty(input),
- propertyTest = false,
- properties = [
- 'years',
- 'year',
- 'y',
- 'months',
- 'month',
- 'M',
- 'days',
- 'day',
- 'd',
- 'dates',
- 'date',
- 'D',
- 'hours',
- 'hour',
- 'h',
- 'minutes',
- 'minute',
- 'm',
- 'seconds',
- 'second',
- 's',
- 'milliseconds',
- 'millisecond',
- 'ms',
- ],
- i,
- property;
- for (i = 0; i < properties.length; i += 1) {
- property = properties[i];
- propertyTest = propertyTest || hasOwnProp(input, property);
- }
- return objectTest && propertyTest;
- }
- function isNumberOrStringArray(input) {
- var arrayTest = isArray(input),
- dataTypeTest = false;
- if (arrayTest) {
- dataTypeTest =
- input.filter(function (item) {
- return !isNumber(item) && isString(input);
- }).length === 0;
- }
- return arrayTest && dataTypeTest;
- }
- function isCalendarSpec(input) {
- var objectTest = isObject(input) && !isObjectEmpty(input),
- propertyTest = false,
- properties = [
- 'sameDay',
- 'nextDay',
- 'lastDay',
- 'nextWeek',
- 'lastWeek',
- 'sameElse',
- ],
- i,
- property;
- for (i = 0; i < properties.length; i += 1) {
- property = properties[i];
- propertyTest = propertyTest || hasOwnProp(input, property);
- }
- return objectTest && propertyTest;
- }
- function getCalendarFormat(myMoment, now) {
- var diff = myMoment.diff(now, 'days', true);
- return diff < -6
- ? 'sameElse'
- : diff < -1
- ? 'lastWeek'
- : diff < 0
- ? 'lastDay'
- : diff < 1
- ? 'sameDay'
- : diff < 2
- ? 'nextDay'
- : diff < 7
- ? 'nextWeek'
- : 'sameElse';
- }
- function calendar$1(time, formats) {
- // Support for single parameter, formats only overload to the calendar function
- if (arguments.length === 1) {
- if (!arguments[0]) {
- time = undefined;
- formats = undefined;
- } else if (isMomentInput(arguments[0])) {
- time = arguments[0];
- formats = undefined;
- } else if (isCalendarSpec(arguments[0])) {
- formats = arguments[0];
- time = undefined;
- }
- }
- // We want to compare the start of today, vs this.
- // Getting start-of-today depends on whether we're local/utc/offset or not.
- var now = time || createLocal(),
- sod = cloneWithOffset(now, this).startOf('day'),
- format = hooks.calendarFormat(this, sod) || 'sameElse',
- output =
- formats &&
- (isFunction(formats[format])
- ? formats[format].call(this, now)
- : formats[format]);
- return this.format(
- output || this.localeData().calendar(format, this, createLocal(now))
- );
- }
- function clone() {
- return new Moment(this);
- }
- function isAfter(input, units) {
- var localInput = isMoment(input) ? input : createLocal(input);
- if (!(this.isValid() && localInput.isValid())) {
- return false;
- }
- units = normalizeUnits(units) || 'millisecond';
- if (units === 'millisecond') {
- return this.valueOf() > localInput.valueOf();
- } else {
- return localInput.valueOf() < this.clone().startOf(units).valueOf();
- }
- }
- function isBefore(input, units) {
- var localInput = isMoment(input) ? input : createLocal(input);
- if (!(this.isValid() && localInput.isValid())) {
- return false;
- }
- units = normalizeUnits(units) || 'millisecond';
- if (units === 'millisecond') {
- return this.valueOf() < localInput.valueOf();
- } else {
- return this.clone().endOf(units).valueOf() < localInput.valueOf();
- }
- }
- function isBetween(from, to, units, inclusivity) {
- var localFrom = isMoment(from) ? from : createLocal(from),
- localTo = isMoment(to) ? to : createLocal(to);
- if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
- return false;
- }
- inclusivity = inclusivity || '()';
- return (
- (inclusivity[0] === '('
- ? this.isAfter(localFrom, units)
- : !this.isBefore(localFrom, units)) &&
- (inclusivity[1] === ')'
- ? this.isBefore(localTo, units)
- : !this.isAfter(localTo, units))
- );
- }
- function isSame(input, units) {
- var localInput = isMoment(input) ? input : createLocal(input),
- inputMs;
- if (!(this.isValid() && localInput.isValid())) {
- return false;
- }
- units = normalizeUnits(units) || 'millisecond';
- if (units === 'millisecond') {
- return this.valueOf() === localInput.valueOf();
- } else {
- inputMs = localInput.valueOf();
- return (
- this.clone().startOf(units).valueOf() <= inputMs &&
- inputMs <= this.clone().endOf(units).valueOf()
- );
- }
- }
- function isSameOrAfter(input, units) {
- return this.isSame(input, units) || this.isAfter(input, units);
- }
- function isSameOrBefore(input, units) {
- return this.isSame(input, units) || this.isBefore(input, units);
- }
- function diff(input, units, asFloat) {
- var that, zoneDelta, output;
- if (!this.isValid()) {
- return NaN;
- }
- that = cloneWithOffset(input, this);
- if (!that.isValid()) {
- return NaN;
- }
- zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
- units = normalizeUnits(units);
- switch (units) {
- case 'year':
- output = monthDiff(this, that) / 12;
- break;
- case 'month':
- output = monthDiff(this, that);
- break;
- case 'quarter':
- output = monthDiff(this, that) / 3;
- break;
- case 'second':
- output = (this - that) / 1e3;
- break; // 1000
- case 'minute':
- output = (this - that) / 6e4;
- break; // 1000 * 60
- case 'hour':
- output = (this - that) / 36e5;
- break; // 1000 * 60 * 60
- case 'day':
- output = (this - that - zoneDelta) / 864e5;
- break; // 1000 * 60 * 60 * 24, negate dst
- case 'week':
- output = (this - that - zoneDelta) / 6048e5;
- break; // 1000 * 60 * 60 * 24 * 7, negate dst
- default:
- output = this - that;
- }
- return asFloat ? output : absFloor(output);
- }
- function monthDiff(a, b) {
- if (a.date() < b.date()) {
- // end-of-month calculations work correct when the start month has more
- // days than the end month.
- return -monthDiff(b, a);
- }
- // difference in months
- var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
- // b is in (anchor - 1 month, anchor + 1 month)
- anchor = a.clone().add(wholeMonthDiff, 'months'),
- anchor2,
- adjust;
- if (b - anchor < 0) {
- anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
- // linear across the month
- adjust = (b - anchor) / (anchor - anchor2);
- } else {
- anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
- // linear across the month
- adjust = (b - anchor) / (anchor2 - anchor);
- }
- //check for negative zero, return zero if negative zero
- return -(wholeMonthDiff + adjust) || 0;
- }
- hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
- hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
- function toString() {
- return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
- }
- function toISOString(keepOffset) {
- if (!this.isValid()) {
- return null;
- }
- var utc = keepOffset !== true,
- m = utc ? this.clone().utc() : this;
- if (m.year() < 0 || m.year() > 9999) {
- return formatMoment(
- m,
- utc
- ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
- : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
- );
- }
- if (isFunction(Date.prototype.toISOString)) {
- // native implementation is ~50x faster, use it when we can
- if (utc) {
- return this.toDate().toISOString();
- } else {
- return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
- .toISOString()
- .replace('Z', formatMoment(m, 'Z'));
- }
- }
- return formatMoment(
- m,
- utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
- );
- }
- /**
- * Return a human readable representation of a moment that can
- * also be evaluated to get a new moment which is the same
- *
- * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
- */
- function inspect() {
- if (!this.isValid()) {
- return 'moment.invalid(/* ' + this._i + ' */)';
- }
- var func = 'moment',
- zone = '',
- prefix,
- year,
- datetime,
- suffix;
- if (!this.isLocal()) {
- func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
- zone = 'Z';
- }
- prefix = '[' + func + '("]';
- year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
- datetime = '-MM-DD[T]HH:mm:ss.SSS';
- suffix = zone + '[")]';
- return this.format(prefix + year + datetime + suffix);
- }
- function format(inputString) {
- if (!inputString) {
- inputString = this.isUtc()
- ? hooks.defaultFormatUtc
- : hooks.defaultFormat;
- }
- var output = formatMoment(this, inputString);
- return this.localeData().postformat(output);
- }
- function from(time, withoutSuffix) {
- if (
- this.isValid() &&
- ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
- ) {
- return createDuration({ to: this, from: time })
- .locale(this.locale())
- .humanize(!withoutSuffix);
- } else {
- return this.localeData().invalidDate();
- }
- }
- function fromNow(withoutSuffix) {
- return this.from(createLocal(), withoutSuffix);
- }
- function to(time, withoutSuffix) {
- if (
- this.isValid() &&
- ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
- ) {
- return createDuration({ from: this, to: time })
- .locale(this.locale())
- .humanize(!withoutSuffix);
- } else {
- return this.localeData().invalidDate();
- }
- }
- function toNow(withoutSuffix) {
- return this.to(createLocal(), withoutSuffix);
- }
- // If passed a locale key, it will set the locale for this
- // instance. Otherwise, it will return the locale configuration
- // variables for this instance.
- function locale(key) {
- var newLocaleData;
- if (key === undefined) {
- return this._locale._abbr;
- } else {
- newLocaleData = getLocale(key);
- if (newLocaleData != null) {
- this._locale = newLocaleData;
- }
- return this;
- }
- }
- var lang = deprecate(
- 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
- function (key) {
- if (key === undefined) {
- return this.localeData();
- } else {
- return this.locale(key);
- }
- }
- );
- function localeData() {
- return this._locale;
- }
- var MS_PER_SECOND = 1000,
- MS_PER_MINUTE = 60 * MS_PER_SECOND,
- MS_PER_HOUR = 60 * MS_PER_MINUTE,
- MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
- // actual modulo - handles negative numbers (for dates before 1970):
- function mod$1(dividend, divisor) {
- return ((dividend % divisor) + divisor) % divisor;
- }
- function localStartOfDate(y, m, d) {
- // the date constructor remaps years 0-99 to 1900-1999
- if (y < 100 && y >= 0) {
- // preserve leap years using a full 400 year cycle, then reset
- return new Date(y + 400, m, d) - MS_PER_400_YEARS;
- } else {
- return new Date(y, m, d).valueOf();
- }
- }
- function utcStartOfDate(y, m, d) {
- // Date.UTC remaps years 0-99 to 1900-1999
- if (y < 100 && y >= 0) {
- // preserve leap years using a full 400 year cycle, then reset
- return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
- } else {
- return Date.UTC(y, m, d);
- }
- }
- function startOf(units) {
- var time, startOfDate;
- units = normalizeUnits(units);
- if (units === undefined || units === 'millisecond' || !this.isValid()) {
- return this;
- }
- startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
- switch (units) {
- case 'year':
- time = startOfDate(this.year(), 0, 1);
- break;
- case 'quarter':
- time = startOfDate(
- this.year(),
- this.month() - (this.month() % 3),
- 1
- );
- break;
- case 'month':
- time = startOfDate(this.year(), this.month(), 1);
- break;
- case 'week':
- time = startOfDate(
- this.year(),
- this.month(),
- this.date() - this.weekday()
- );
- break;
- case 'isoWeek':
- time = startOfDate(
- this.year(),
- this.month(),
- this.date() - (this.isoWeekday() - 1)
- );
- break;
- case 'day':
- case 'date':
- time = startOfDate(this.year(), this.month(), this.date());
- break;
- case 'hour':
- time = this._d.valueOf();
- time -= mod$1(
- time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
- MS_PER_HOUR
- );
- break;
- case 'minute':
- time = this._d.valueOf();
- time -= mod$1(time, MS_PER_MINUTE);
- break;
- case 'second':
- time = this._d.valueOf();
- time -= mod$1(time, MS_PER_SECOND);
- break;
- }
- this._d.setTime(time);
- hooks.updateOffset(this, true);
- return this;
- }
- function endOf(units) {
- var time, startOfDate;
- units = normalizeUnits(units);
- if (units === undefined || units === 'millisecond' || !this.isValid()) {
- return this;
- }
- startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
- switch (units) {
- case 'year':
- time = startOfDate(this.year() + 1, 0, 1) - 1;
- break;
- case 'quarter':
- time =
- startOfDate(
- this.year(),
- this.month() - (this.month() % 3) + 3,
- 1
- ) - 1;
- break;
- case 'month':
- time = startOfDate(this.year(), this.month() + 1, 1) - 1;
- break;
- case 'week':
- time =
- startOfDate(
- this.year(),
- this.month(),
- this.date() - this.weekday() + 7
- ) - 1;
- break;
- case 'isoWeek':
- time =
- startOfDate(
- this.year(),
- this.month(),
- this.date() - (this.isoWeekday() - 1) + 7
- ) - 1;
- break;
- case 'day':
- case 'date':
- time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
- break;
- case 'hour':
- time = this._d.valueOf();
- time +=
- MS_PER_HOUR -
- mod$1(
- time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
- MS_PER_HOUR
- ) -
- 1;
- break;
- case 'minute':
- time = this._d.valueOf();
- time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
- break;
- case 'second':
- time = this._d.valueOf();
- time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
- break;
- }
- this._d.setTime(time);
- hooks.updateOffset(this, true);
- return this;
- }
- function valueOf() {
- return this._d.valueOf() - (this._offset || 0) * 60000;
- }
- function unix() {
- return Math.floor(this.valueOf() / 1000);
- }
- function toDate() {
- return new Date(this.valueOf());
- }
- function toArray() {
- var m = this;
- return [
- m.year(),
- m.month(),
- m.date(),
- m.hour(),
- m.minute(),
- m.second(),
- m.millisecond(),
- ];
- }
- function toObject() {
- var m = this;
- return {
- years: m.year(),
- months: m.month(),
- date: m.date(),
- hours: m.hours(),
- minutes: m.minutes(),
- seconds: m.seconds(),
- milliseconds: m.milliseconds(),
- };
- }
- function toJSON() {
- // new Date(NaN).toJSON() === null
- return this.isValid() ? this.toISOString() : null;
- }
- function isValid$2() {
- return isValid(this);
- }
- function parsingFlags() {
- return extend({}, getParsingFlags(this));
- }
- function invalidAt() {
- return getParsingFlags(this).overflow;
- }
- function creationData() {
- return {
- input: this._i,
- format: this._f,
- locale: this._locale,
- isUTC: this._isUTC,
- strict: this._strict,
- };
- }
- addFormatToken('N', 0, 0, 'eraAbbr');
- addFormatToken('NN', 0, 0, 'eraAbbr');
- addFormatToken('NNN', 0, 0, 'eraAbbr');
- addFormatToken('NNNN', 0, 0, 'eraName');
- addFormatToken('NNNNN', 0, 0, 'eraNarrow');
- addFormatToken('y', ['y', 1], 'yo', 'eraYear');
- addFormatToken('y', ['yy', 2], 0, 'eraYear');
- addFormatToken('y', ['yyy', 3], 0, 'eraYear');
- addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
- addRegexToken('N', matchEraAbbr);
- addRegexToken('NN', matchEraAbbr);
- addRegexToken('NNN', matchEraAbbr);
- addRegexToken('NNNN', matchEraName);
- addRegexToken('NNNNN', matchEraNarrow);
- addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
- input,
- array,
- config,
- token
- ) {
- var era = config._locale.erasParse(input, token, config._strict);
- if (era) {
- getParsingFlags(config).era = era;
- } else {
- getParsingFlags(config).invalidEra = input;
- }
- });
- addRegexToken('y', matchUnsigned);
- addRegexToken('yy', matchUnsigned);
- addRegexToken('yyy', matchUnsigned);
- addRegexToken('yyyy', matchUnsigned);
- addRegexToken('yo', matchEraYearOrdinal);
- addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
- addParseToken(['yo'], function (input, array, config, token) {
- var match;
- if (config._locale._eraYearOrdinalRegex) {
- match = input.match(config._locale._eraYearOrdinalRegex);
- }
- if (config._locale.eraYearOrdinalParse) {
- array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
- } else {
- array[YEAR] = parseInt(input, 10);
- }
- });
- function localeEras(m, format) {
- var i,
- l,
- date,
- eras = this._eras || getLocale('en')._eras;
- for (i = 0, l = eras.length; i < l; ++i) {
- switch (typeof eras[i].since) {
- case 'string':
- // truncate time
- date = hooks(eras[i].since).startOf('day');
- eras[i].since = date.valueOf();
- break;
- }
- switch (typeof eras[i].until) {
- case 'undefined':
- eras[i].until = +Infinity;
- break;
- case 'string':
- // truncate time
- date = hooks(eras[i].until).startOf('day').valueOf();
- eras[i].until = date.valueOf();
- break;
- }
- }
- return eras;
- }
- function localeErasParse(eraName, format, strict) {
- var i,
- l,
- eras = this.eras(),
- name,
- abbr,
- narrow;
- eraName = eraName.toUpperCase();
- for (i = 0, l = eras.length; i < l; ++i) {
- name = eras[i].name.toUpperCase();
- abbr = eras[i].abbr.toUpperCase();
- narrow = eras[i].narrow.toUpperCase();
- if (strict) {
- switch (format) {
- case 'N':
- case 'NN':
- case 'NNN':
- if (abbr === eraName) {
- return eras[i];
- }
- break;
- case 'NNNN':
- if (name === eraName) {
- return eras[i];
- }
- break;
- case 'NNNNN':
- if (narrow === eraName) {
- return eras[i];
- }
- break;
- }
- } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
- return eras[i];
- }
- }
- }
- function localeErasConvertYear(era, year) {
- var dir = era.since <= era.until ? +1 : -1;
- if (year === undefined) {
- return hooks(era.since).year();
- } else {
- return hooks(era.since).year() + (year - era.offset) * dir;
- }
- }
- function getEraName() {
- var i,
- l,
- val,
- eras = this.localeData().eras();
- for (i = 0, l = eras.length; i < l; ++i) {
- // truncate time
- val = this.clone().startOf('day').valueOf();
- if (eras[i].since <= val && val <= eras[i].until) {
- return eras[i].name;
- }
- if (eras[i].until <= val && val <= eras[i].since) {
- return eras[i].name;
- }
- }
- return '';
- }
- function getEraNarrow() {
- var i,
- l,
- val,
- eras = this.localeData().eras();
- for (i = 0, l = eras.length; i < l; ++i) {
- // truncate time
- val = this.clone().startOf('day').valueOf();
- if (eras[i].since <= val && val <= eras[i].until) {
- return eras[i].narrow;
- }
- if (eras[i].until <= val && val <= eras[i].since) {
- return eras[i].narrow;
- }
- }
- return '';
- }
- function getEraAbbr() {
- var i,
- l,
- val,
- eras = this.localeData().eras();
- for (i = 0, l = eras.length; i < l; ++i) {
- // truncate time
- val = this.clone().startOf('day').valueOf();
- if (eras[i].since <= val && val <= eras[i].until) {
- return eras[i].abbr;
- }
- if (eras[i].until <= val && val <= eras[i].since) {
- return eras[i].abbr;
- }
- }
- return '';
- }
- function getEraYear() {
- var i,
- l,
- dir,
- val,
- eras = this.localeData().eras();
- for (i = 0, l = eras.length; i < l; ++i) {
- dir = eras[i].since <= eras[i].until ? +1 : -1;
- // truncate time
- val = this.clone().startOf('day').valueOf();
- if (
- (eras[i].since <= val && val <= eras[i].until) ||
- (eras[i].until <= val && val <= eras[i].since)
- ) {
- return (
- (this.year() - hooks(eras[i].since).year()) * dir +
- eras[i].offset
- );
- }
- }
- return this.year();
- }
- function erasNameRegex(isStrict) {
- if (!hasOwnProp(this, '_erasNameRegex')) {
- computeErasParse.call(this);
- }
- return isStrict ? this._erasNameRegex : this._erasRegex;
- }
- function erasAbbrRegex(isStrict) {
- if (!hasOwnProp(this, '_erasAbbrRegex')) {
- computeErasParse.call(this);
- }
- return isStrict ? this._erasAbbrRegex : this._erasRegex;
- }
- function erasNarrowRegex(isStrict) {
- if (!hasOwnProp(this, '_erasNarrowRegex')) {
- computeErasParse.call(this);
- }
- return isStrict ? this._erasNarrowRegex : this._erasRegex;
- }
- function matchEraAbbr(isStrict, locale) {
- return locale.erasAbbrRegex(isStrict);
- }
- function matchEraName(isStrict, locale) {
- return locale.erasNameRegex(isStrict);
- }
- function matchEraNarrow(isStrict, locale) {
- return locale.erasNarrowRegex(isStrict);
- }
- function matchEraYearOrdinal(isStrict, locale) {
- return locale._eraYearOrdinalRegex || matchUnsigned;
- }
- function computeErasParse() {
- var abbrPieces = [],
- namePieces = [],
- narrowPieces = [],
- mixedPieces = [],
- i,
- l,
- eras = this.eras();
- for (i = 0, l = eras.length; i < l; ++i) {
- namePieces.push(regexEscape(eras[i].name));
- abbrPieces.push(regexEscape(eras[i].abbr));
- narrowPieces.push(regexEscape(eras[i].narrow));
- mixedPieces.push(regexEscape(eras[i].name));
- mixedPieces.push(regexEscape(eras[i].abbr));
- mixedPieces.push(regexEscape(eras[i].narrow));
- }
- this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
- this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
- this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
- this._erasNarrowRegex = new RegExp(
- '^(' + narrowPieces.join('|') + ')',
- 'i'
- );
- }
- // FORMATTING
- addFormatToken(0, ['gg', 2], 0, function () {
- return this.weekYear() % 100;
- });
- addFormatToken(0, ['GG', 2], 0, function () {
- return this.isoWeekYear() % 100;
- });
- function addWeekYearFormatToken(token, getter) {
- addFormatToken(0, [token, token.length], 0, getter);
- }
- addWeekYearFormatToken('gggg', 'weekYear');
- addWeekYearFormatToken('ggggg', 'weekYear');
- addWeekYearFormatToken('GGGG', 'isoWeekYear');
- addWeekYearFormatToken('GGGGG', 'isoWeekYear');
- // ALIASES
- addUnitAlias('weekYear', 'gg');
- addUnitAlias('isoWeekYear', 'GG');
- // PRIORITY
- addUnitPriority('weekYear', 1);
- addUnitPriority('isoWeekYear', 1);
- // PARSING
- addRegexToken('G', matchSigned);
- addRegexToken('g', matchSigned);
- addRegexToken('GG', match1to2, match2);
- addRegexToken('gg', match1to2, match2);
- addRegexToken('GGGG', match1to4, match4);
- addRegexToken('gggg', match1to4, match4);
- addRegexToken('GGGGG', match1to6, match6);
- addRegexToken('ggggg', match1to6, match6);
- addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
- input,
- week,
- config,
- token
- ) {
- week[token.substr(0, 2)] = toInt(input);
- });
- addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
- week[token] = hooks.parseTwoDigitYear(input);
- });
- // MOMENTS
- function getSetWeekYear(input) {
- return getSetWeekYearHelper.call(
- this,
- input,
- this.week(),
- this.weekday(),
- this.localeData()._week.dow,
- this.localeData()._week.doy
- );
- }
- function getSetISOWeekYear(input) {
- return getSetWeekYearHelper.call(
- this,
- input,
- this.isoWeek(),
- this.isoWeekday(),
- 1,
- 4
- );
- }
- function getISOWeeksInYear() {
- return weeksInYear(this.year(), 1, 4);
- }
- function getISOWeeksInISOWeekYear() {
- return weeksInYear(this.isoWeekYear(), 1, 4);
- }
- function getWeeksInYear() {
- var weekInfo = this.localeData()._week;
- return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
- }
- function getWeeksInWeekYear() {
- var weekInfo = this.localeData()._week;
- return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
- }
- function getSetWeekYearHelper(input, week, weekday, dow, doy) {
- var weeksTarget;
- if (input == null) {
- return weekOfYear(this, dow, doy).year;
- } else {
- weeksTarget = weeksInYear(input, dow, doy);
- if (week > weeksTarget) {
- week = weeksTarget;
- }
- return setWeekAll.call(this, input, week, weekday, dow, doy);
- }
- }
- function setWeekAll(weekYear, week, weekday, dow, doy) {
- var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
- date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
- this.year(date.getUTCFullYear());
- this.month(date.getUTCMonth());
- this.date(date.getUTCDate());
- return this;
- }
- // FORMATTING
- addFormatToken('Q', 0, 'Qo', 'quarter');
- // ALIASES
- addUnitAlias('quarter', 'Q');
- // PRIORITY
- addUnitPriority('quarter', 7);
- // PARSING
- addRegexToken('Q', match1);
- addParseToken('Q', function (input, array) {
- array[MONTH] = (toInt(input) - 1) * 3;
- });
- // MOMENTS
- function getSetQuarter(input) {
- return input == null
- ? Math.ceil((this.month() + 1) / 3)
- : this.month((input - 1) * 3 + (this.month() % 3));
- }
- // FORMATTING
- addFormatToken('D', ['DD', 2], 'Do', 'date');
- // ALIASES
- addUnitAlias('date', 'D');
- // PRIORITY
- addUnitPriority('date', 9);
- // PARSING
- addRegexToken('D', match1to2);
- addRegexToken('DD', match1to2, match2);
- addRegexToken('Do', function (isStrict, locale) {
- // TODO: Remove "ordinalParse" fallback in next major release.
- return isStrict
- ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
- : locale._dayOfMonthOrdinalParseLenient;
- });
- addParseToken(['D', 'DD'], DATE);
- addParseToken('Do', function (input, array) {
- array[DATE] = toInt(input.match(match1to2)[0]);
- });
- // MOMENTS
- var getSetDayOfMonth = makeGetSet('Date', true);
- // FORMATTING
- addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
- // ALIASES
- addUnitAlias('dayOfYear', 'DDD');
- // PRIORITY
- addUnitPriority('dayOfYear', 4);
- // PARSING
- addRegexToken('DDD', match1to3);
- addRegexToken('DDDD', match3);
- addParseToken(['DDD', 'DDDD'], function (input, array, config) {
- config._dayOfYear = toInt(input);
- });
- // HELPERS
- // MOMENTS
- function getSetDayOfYear(input) {
- var dayOfYear =
- Math.round(
- (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
- ) + 1;
- return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
- }
- // FORMATTING
- addFormatToken('m', ['mm', 2], 0, 'minute');
- // ALIASES
- addUnitAlias('minute', 'm');
- // PRIORITY
- addUnitPriority('minute', 14);
- // PARSING
- addRegexToken('m', match1to2);
- addRegexToken('mm', match1to2, match2);
- addParseToken(['m', 'mm'], MINUTE);
- // MOMENTS
- var getSetMinute = makeGetSet('Minutes', false);
- // FORMATTING
- addFormatToken('s', ['ss', 2], 0, 'second');
- // ALIASES
- addUnitAlias('second', 's');
- // PRIORITY
- addUnitPriority('second', 15);
- // PARSING
- addRegexToken('s', match1to2);
- addRegexToken('ss', match1to2, match2);
- addParseToken(['s', 'ss'], SECOND);
- // MOMENTS
- var getSetSecond = makeGetSet('Seconds', false);
- // FORMATTING
- addFormatToken('S', 0, 0, function () {
- return ~~(this.millisecond() / 100);
- });
- addFormatToken(0, ['SS', 2], 0, function () {
- return ~~(this.millisecond() / 10);
- });
- addFormatToken(0, ['SSS', 3], 0, 'millisecond');
- addFormatToken(0, ['SSSS', 4], 0, function () {
- return this.millisecond() * 10;
- });
- addFormatToken(0, ['SSSSS', 5], 0, function () {
- return this.millisecond() * 100;
- });
- addFormatToken(0, ['SSSSSS', 6], 0, function () {
- return this.millisecond() * 1000;
- });
- addFormatToken(0, ['SSSSSSS', 7], 0, function () {
- return this.millisecond() * 10000;
- });
- addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
- return this.millisecond() * 100000;
- });
- addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
- return this.millisecond() * 1000000;
- });
- // ALIASES
- addUnitAlias('millisecond', 'ms');
- // PRIORITY
- addUnitPriority('millisecond', 16);
- // PARSING
- addRegexToken('S', match1to3, match1);
- addRegexToken('SS', match1to3, match2);
- addRegexToken('SSS', match1to3, match3);
- var token, getSetMillisecond;
- for (token = 'SSSS'; token.length <= 9; token += 'S') {
- addRegexToken(token, matchUnsigned);
- }
- function parseMs(input, array) {
- array[MILLISECOND] = toInt(('0.' + input) * 1000);
- }
- for (token = 'S'; token.length <= 9; token += 'S') {
- addParseToken(token, parseMs);
- }
- getSetMillisecond = makeGetSet('Milliseconds', false);
- // FORMATTING
- addFormatToken('z', 0, 0, 'zoneAbbr');
- addFormatToken('zz', 0, 0, 'zoneName');
- // MOMENTS
- function getZoneAbbr() {
- return this._isUTC ? 'UTC' : '';
- }
- function getZoneName() {
- return this._isUTC ? 'Coordinated Universal Time' : '';
- }
- var proto = Moment.prototype;
- proto.add = add;
- proto.calendar = calendar$1;
- proto.clone = clone;
- proto.diff = diff;
- proto.endOf = endOf;
- proto.format = format;
- proto.from = from;
- proto.fromNow = fromNow;
- proto.to = to;
- proto.toNow = toNow;
- proto.get = stringGet;
- proto.invalidAt = invalidAt;
- proto.isAfter = isAfter;
- proto.isBefore = isBefore;
- proto.isBetween = isBetween;
- proto.isSame = isSame;
- proto.isSameOrAfter = isSameOrAfter;
- proto.isSameOrBefore = isSameOrBefore;
- proto.isValid = isValid$2;
- proto.lang = lang;
- proto.locale = locale;
- proto.localeData = localeData;
- proto.max = prototypeMax;
- proto.min = prototypeMin;
- proto.parsingFlags = parsingFlags;
- proto.set = stringSet;
- proto.startOf = startOf;
- proto.subtract = subtract;
- proto.toArray = toArray;
- proto.toObject = toObject;
- proto.toDate = toDate;
- proto.toISOString = toISOString;
- proto.inspect = inspect;
- if (typeof Symbol !== 'undefined' && Symbol.for != null) {
- proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
- return 'Moment<' + this.format() + '>';
- };
- }
- proto.toJSON = toJSON;
- proto.toString = toString;
- proto.unix = unix;
- proto.valueOf = valueOf;
- proto.creationData = creationData;
- proto.eraName = getEraName;
- proto.eraNarrow = getEraNarrow;
- proto.eraAbbr = getEraAbbr;
- proto.eraYear = getEraYear;
- proto.year = getSetYear;
- proto.isLeapYear = getIsLeapYear;
- proto.weekYear = getSetWeekYear;
- proto.isoWeekYear = getSetISOWeekYear;
- proto.quarter = proto.quarters = getSetQuarter;
- proto.month = getSetMonth;
- proto.daysInMonth = getDaysInMonth;
- proto.week = proto.weeks = getSetWeek;
- proto.isoWeek = proto.isoWeeks = getSetISOWeek;
- proto.weeksInYear = getWeeksInYear;
- proto.weeksInWeekYear = getWeeksInWeekYear;
- proto.isoWeeksInYear = getISOWeeksInYear;
- proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
- proto.date = getSetDayOfMonth;
- proto.day = proto.days = getSetDayOfWeek;
- proto.weekday = getSetLocaleDayOfWeek;
- proto.isoWeekday = getSetISODayOfWeek;
- proto.dayOfYear = getSetDayOfYear;
- proto.hour = proto.hours = getSetHour;
- proto.minute = proto.minutes = getSetMinute;
- proto.second = proto.seconds = getSetSecond;
- proto.millisecond = proto.milliseconds = getSetMillisecond;
- proto.utcOffset = getSetOffset;
- proto.utc = setOffsetToUTC;
- proto.local = setOffsetToLocal;
- proto.parseZone = setOffsetToParsedOffset;
- proto.hasAlignedHourOffset = hasAlignedHourOffset;
- proto.isDST = isDaylightSavingTime;
- proto.isLocal = isLocal;
- proto.isUtcOffset = isUtcOffset;
- proto.isUtc = isUtc;
- proto.isUTC = isUtc;
- proto.zoneAbbr = getZoneAbbr;
- proto.zoneName = getZoneName;
- proto.dates = deprecate(
- 'dates accessor is deprecated. Use date instead.',
- getSetDayOfMonth
- );
- proto.months = deprecate(
- 'months accessor is deprecated. Use month instead',
- getSetMonth
- );
- proto.years = deprecate(
- 'years accessor is deprecated. Use year instead',
- getSetYear
- );
- proto.zone = deprecate(
- 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
- getSetZone
- );
- proto.isDSTShifted = deprecate(
- 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
- isDaylightSavingTimeShifted
- );
- function createUnix(input) {
- return createLocal(input * 1000);
- }
- function createInZone() {
- return createLocal.apply(null, arguments).parseZone();
- }
- function preParsePostFormat(string) {
- return string;
- }
- var proto$1 = Locale.prototype;
- proto$1.calendar = calendar;
- proto$1.longDateFormat = longDateFormat;
- proto$1.invalidDate = invalidDate;
- proto$1.ordinal = ordinal;
- proto$1.preparse = preParsePostFormat;
- proto$1.postformat = preParsePostFormat;
- proto$1.relativeTime = relativeTime;
- proto$1.pastFuture = pastFuture;
- proto$1.set = set;
- proto$1.eras = localeEras;
- proto$1.erasParse = localeErasParse;
- proto$1.erasConvertYear = localeErasConvertYear;
- proto$1.erasAbbrRegex = erasAbbrRegex;
- proto$1.erasNameRegex = erasNameRegex;
- proto$1.erasNarrowRegex = erasNarrowRegex;
- proto$1.months = localeMonths;
- proto$1.monthsShort = localeMonthsShort;
- proto$1.monthsParse = localeMonthsParse;
- proto$1.monthsRegex = monthsRegex;
- proto$1.monthsShortRegex = monthsShortRegex;
- proto$1.week = localeWeek;
- proto$1.firstDayOfYear = localeFirstDayOfYear;
- proto$1.firstDayOfWeek = localeFirstDayOfWeek;
- proto$1.weekdays = localeWeekdays;
- proto$1.weekdaysMin = localeWeekdaysMin;
- proto$1.weekdaysShort = localeWeekdaysShort;
- proto$1.weekdaysParse = localeWeekdaysParse;
- proto$1.weekdaysRegex = weekdaysRegex;
- proto$1.weekdaysShortRegex = weekdaysShortRegex;
- proto$1.weekdaysMinRegex = weekdaysMinRegex;
- proto$1.isPM = localeIsPM;
- proto$1.meridiem = localeMeridiem;
- function get$1(format, index, field, setter) {
- var locale = getLocale(),
- utc = createUTC().set(setter, index);
- return locale[field](utc, format);
- }
- function listMonthsImpl(format, index, field) {
- if (isNumber(format)) {
- index = format;
- format = undefined;
- }
- format = format || '';
- if (index != null) {
- return get$1(format, index, field, 'month');
- }
- var i,
- out = [];
- for (i = 0; i < 12; i++) {
- out[i] = get$1(format, i, field, 'month');
- }
- return out;
- }
- // ()
- // (5)
- // (fmt, 5)
- // (fmt)
- // (true)
- // (true, 5)
- // (true, fmt, 5)
- // (true, fmt)
- function listWeekdaysImpl(localeSorted, format, index, field) {
- if (typeof localeSorted === 'boolean') {
- if (isNumber(format)) {
- index = format;
- format = undefined;
- }
- format = format || '';
- } else {
- format = localeSorted;
- index = format;
- localeSorted = false;
- if (isNumber(format)) {
- index = format;
- format = undefined;
- }
- format = format || '';
- }
- var locale = getLocale(),
- shift = localeSorted ? locale._week.dow : 0,
- i,
- out = [];
- if (index != null) {
- return get$1(format, (index + shift) % 7, field, 'day');
- }
- for (i = 0; i < 7; i++) {
- out[i] = get$1(format, (i + shift) % 7, field, 'day');
- }
- return out;
- }
- function listMonths(format, index) {
- return listMonthsImpl(format, index, 'months');
- }
- function listMonthsShort(format, index) {
- return listMonthsImpl(format, index, 'monthsShort');
- }
- function listWeekdays(localeSorted, format, index) {
- return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
- }
- function listWeekdaysShort(localeSorted, format, index) {
- return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
- }
- function listWeekdaysMin(localeSorted, format, index) {
- return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
- }
- getSetGlobalLocale('en', {
- eras: [
- {
- since: '0001-01-01',
- until: +Infinity,
- offset: 1,
- name: 'Anno Domini',
- narrow: 'AD',
- abbr: 'AD',
- },
- {
- since: '0000-12-31',
- until: -Infinity,
- offset: 1,
- name: 'Before Christ',
- narrow: 'BC',
- abbr: 'BC',
- },
- ],
- dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
- ordinal: function (number) {
- var b = number % 10,
- output =
- toInt((number % 100) / 10) === 1
- ? 'th'
- : b === 1
- ? 'st'
- : b === 2
- ? 'nd'
- : b === 3
- ? 'rd'
- : 'th';
- return number + output;
- },
- });
- // Side effect imports
- hooks.lang = deprecate(
- 'moment.lang is deprecated. Use moment.locale instead.',
- getSetGlobalLocale
- );
- hooks.langData = deprecate(
- 'moment.langData is deprecated. Use moment.localeData instead.',
- getLocale
- );
- var mathAbs = Math.abs;
- function abs() {
- var data = this._data;
- this._milliseconds = mathAbs(this._milliseconds);
- this._days = mathAbs(this._days);
- this._months = mathAbs(this._months);
- data.milliseconds = mathAbs(data.milliseconds);
- data.seconds = mathAbs(data.seconds);
- data.minutes = mathAbs(data.minutes);
- data.hours = mathAbs(data.hours);
- data.months = mathAbs(data.months);
- data.years = mathAbs(data.years);
- return this;
- }
- function addSubtract$1(duration, input, value, direction) {
- var other = createDuration(input, value);
- duration._milliseconds += direction * other._milliseconds;
- duration._days += direction * other._days;
- duration._months += direction * other._months;
- return duration._bubble();
- }
- // supports only 2.0-style add(1, 's') or add(duration)
- function add$1(input, value) {
- return addSubtract$1(this, input, value, 1);
- }
- // supports only 2.0-style subtract(1, 's') or subtract(duration)
- function subtract$1(input, value) {
- return addSubtract$1(this, input, value, -1);
- }
- function absCeil(number) {
- if (number < 0) {
- return Math.floor(number);
- } else {
- return Math.ceil(number);
- }
- }
- function bubble() {
- var milliseconds = this._milliseconds,
- days = this._days,
- months = this._months,
- data = this._data,
- seconds,
- minutes,
- hours,
- years,
- monthsFromDays;
- // if we have a mix of positive and negative values, bubble down first
- // check: https://github.com/moment/moment/issues/2166
- if (
- !(
- (milliseconds >= 0 && days >= 0 && months >= 0) ||
- (milliseconds <= 0 && days <= 0 && months <= 0)
- )
- ) {
- milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
- days = 0;
- months = 0;
- }
- // The following code bubbles up values, see the tests for
- // examples of what that means.
- data.milliseconds = milliseconds % 1000;
- seconds = absFloor(milliseconds / 1000);
- data.seconds = seconds % 60;
- minutes = absFloor(seconds / 60);
- data.minutes = minutes % 60;
- hours = absFloor(minutes / 60);
- data.hours = hours % 24;
- days += absFloor(hours / 24);
- // convert days to months
- monthsFromDays = absFloor(daysToMonths(days));
- months += monthsFromDays;
- days -= absCeil(monthsToDays(monthsFromDays));
- // 12 months -> 1 year
- years = absFloor(months / 12);
- months %= 12;
- data.days = days;
- data.months = months;
- data.years = years;
- return this;
- }
- function daysToMonths(days) {
- // 400 years have 146097 days (taking into account leap year rules)
- // 400 years have 12 months === 4800
- return (days * 4800) / 146097;
- }
- function monthsToDays(months) {
- // the reverse of daysToMonths
- return (months * 146097) / 4800;
- }
- function as(units) {
- if (!this.isValid()) {
- return NaN;
- }
- var days,
- months,
- milliseconds = this._milliseconds;
- units = normalizeUnits(units);
- if (units === 'month' || units === 'quarter' || units === 'year') {
- days = this._days + milliseconds / 864e5;
- months = this._months + daysToMonths(days);
- switch (units) {
- case 'month':
- return months;
- case 'quarter':
- return months / 3;
- case 'year':
- return months / 12;
- }
- } else {
- // handle milliseconds separately because of floating point math errors (issue #1867)
- days = this._days + Math.round(monthsToDays(this._months));
- switch (units) {
- case 'week':
- return days / 7 + milliseconds / 6048e5;
- case 'day':
- return days + milliseconds / 864e5;
- case 'hour':
- return days * 24 + milliseconds / 36e5;
- case 'minute':
- return days * 1440 + milliseconds / 6e4;
- case 'second':
- return days * 86400 + milliseconds / 1000;
- // Math.floor prevents floating point math errors here
- case 'millisecond':
- return Math.floor(days * 864e5) + milliseconds;
- default:
- throw new Error('Unknown unit ' + units);
- }
- }
- }
- // TODO: Use this.as('ms')?
- function valueOf$1() {
- if (!this.isValid()) {
- return NaN;
- }
- return (
- this._milliseconds +
- this._days * 864e5 +
- (this._months % 12) * 2592e6 +
- toInt(this._months / 12) * 31536e6
- );
- }
- function makeAs(alias) {
- return function () {
- return this.as(alias);
- };
- }
- var asMilliseconds = makeAs('ms'),
- asSeconds = makeAs('s'),
- asMinutes = makeAs('m'),
- asHours = makeAs('h'),
- asDays = makeAs('d'),
- asWeeks = makeAs('w'),
- asMonths = makeAs('M'),
- asQuarters = makeAs('Q'),
- asYears = makeAs('y');
- function clone$1() {
- return createDuration(this);
- }
- function get$2(units) {
- units = normalizeUnits(units);
- return this.isValid() ? this[units + 's']() : NaN;
- }
- function makeGetter(name) {
- return function () {
- return this.isValid() ? this._data[name] : NaN;
- };
- }
- var milliseconds = makeGetter('milliseconds'),
- seconds = makeGetter('seconds'),
- minutes = makeGetter('minutes'),
- hours = makeGetter('hours'),
- days = makeGetter('days'),
- months = makeGetter('months'),
- years = makeGetter('years');
- function weeks() {
- return absFloor(this.days() / 7);
- }
- var round = Math.round,
- thresholds = {
- ss: 44, // a few seconds to seconds
- s: 45, // seconds to minute
- m: 45, // minutes to hour
- h: 22, // hours to day
- d: 26, // days to month/week
- w: null, // weeks to month
- M: 11, // months to year
- };
- // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
- function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
- return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
- }
- function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
- var duration = createDuration(posNegDuration).abs(),
- seconds = round(duration.as('s')),
- minutes = round(duration.as('m')),
- hours = round(duration.as('h')),
- days = round(duration.as('d')),
- months = round(duration.as('M')),
- weeks = round(duration.as('w')),
- years = round(duration.as('y')),
- a =
- (seconds <= thresholds.ss && ['s', seconds]) ||
- (seconds < thresholds.s && ['ss', seconds]) ||
- (minutes <= 1 && ['m']) ||
- (minutes < thresholds.m && ['mm', minutes]) ||
- (hours <= 1 && ['h']) ||
- (hours < thresholds.h && ['hh', hours]) ||
- (days <= 1 && ['d']) ||
- (days < thresholds.d && ['dd', days]);
- if (thresholds.w != null) {
- a =
- a ||
- (weeks <= 1 && ['w']) ||
- (weeks < thresholds.w && ['ww', weeks]);
- }
- a = a ||
- (months <= 1 && ['M']) ||
- (months < thresholds.M && ['MM', months]) ||
- (years <= 1 && ['y']) || ['yy', years];
- a[2] = withoutSuffix;
- a[3] = +posNegDuration > 0;
- a[4] = locale;
- return substituteTimeAgo.apply(null, a);
- }
- // This function allows you to set the rounding function for relative time strings
- function getSetRelativeTimeRounding(roundingFunction) {
- if (roundingFunction === undefined) {
- return round;
- }
- if (typeof roundingFunction === 'function') {
- round = roundingFunction;
- return true;
- }
- return false;
- }
- // This function allows you to set a threshold for relative time strings
- function getSetRelativeTimeThreshold(threshold, limit) {
- if (thresholds[threshold] === undefined) {
- return false;
- }
- if (limit === undefined) {
- return thresholds[threshold];
- }
- thresholds[threshold] = limit;
- if (threshold === 's') {
- thresholds.ss = limit - 1;
- }
- return true;
- }
- function humanize(argWithSuffix, argThresholds) {
- if (!this.isValid()) {
- return this.localeData().invalidDate();
- }
- var withSuffix = false,
- th = thresholds,
- locale,
- output;
- if (typeof argWithSuffix === 'object') {
- argThresholds = argWithSuffix;
- argWithSuffix = false;
- }
- if (typeof argWithSuffix === 'boolean') {
- withSuffix = argWithSuffix;
- }
- if (typeof argThresholds === 'object') {
- th = Object.assign({}, thresholds, argThresholds);
- if (argThresholds.s != null && argThresholds.ss == null) {
- th.ss = argThresholds.s - 1;
- }
- }
- locale = this.localeData();
- output = relativeTime$1(this, !withSuffix, th, locale);
- if (withSuffix) {
- output = locale.pastFuture(+this, output);
- }
- return locale.postformat(output);
- }
- var abs$1 = Math.abs;
- function sign(x) {
- return (x > 0) - (x < 0) || +x;
- }
- function toISOString$1() {
- // for ISO strings we do not use the normal bubbling rules:
- // * milliseconds bubble up until they become hours
- // * days do not bubble at all
- // * months bubble up until they become years
- // This is because there is no context-free conversion between hours and days
- // (think of clock changes)
- // and also not between days and months (28-31 days per month)
- if (!this.isValid()) {
- return this.localeData().invalidDate();
- }
- var seconds = abs$1(this._milliseconds) / 1000,
- days = abs$1(this._days),
- months = abs$1(this._months),
- minutes,
- hours,
- years,
- s,
- total = this.asSeconds(),
- totalSign,
- ymSign,
- daysSign,
- hmsSign;
- if (!total) {
- // this is the same as C#'s (Noda) and python (isodate)...
- // but not other JS (goog.date)
- return 'P0D';
- }
- // 3600 seconds -> 60 minutes -> 1 hour
- minutes = absFloor(seconds / 60);
- hours = absFloor(minutes / 60);
- seconds %= 60;
- minutes %= 60;
- // 12 months -> 1 year
- years = absFloor(months / 12);
- months %= 12;
- // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
- s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
- totalSign = total < 0 ? '-' : '';
- ymSign = sign(this._months) !== sign(total) ? '-' : '';
- daysSign = sign(this._days) !== sign(total) ? '-' : '';
- hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
- return (
- totalSign +
- 'P' +
- (years ? ymSign + years + 'Y' : '') +
- (months ? ymSign + months + 'M' : '') +
- (days ? daysSign + days + 'D' : '') +
- (hours || minutes || seconds ? 'T' : '') +
- (hours ? hmsSign + hours + 'H' : '') +
- (minutes ? hmsSign + minutes + 'M' : '') +
- (seconds ? hmsSign + s + 'S' : '')
- );
- }
- var proto$2 = Duration.prototype;
- proto$2.isValid = isValid$1;
- proto$2.abs = abs;
- proto$2.add = add$1;
- proto$2.subtract = subtract$1;
- proto$2.as = as;
- proto$2.asMilliseconds = asMilliseconds;
- proto$2.asSeconds = asSeconds;
- proto$2.asMinutes = asMinutes;
- proto$2.asHours = asHours;
- proto$2.asDays = asDays;
- proto$2.asWeeks = asWeeks;
- proto$2.asMonths = asMonths;
- proto$2.asQuarters = asQuarters;
- proto$2.asYears = asYears;
- proto$2.valueOf = valueOf$1;
- proto$2._bubble = bubble;
- proto$2.clone = clone$1;
- proto$2.get = get$2;
- proto$2.milliseconds = milliseconds;
- proto$2.seconds = seconds;
- proto$2.minutes = minutes;
- proto$2.hours = hours;
- proto$2.days = days;
- proto$2.weeks = weeks;
- proto$2.months = months;
- proto$2.years = years;
- proto$2.humanize = humanize;
- proto$2.toISOString = toISOString$1;
- proto$2.toString = toISOString$1;
- proto$2.toJSON = toISOString$1;
- proto$2.locale = locale;
- proto$2.localeData = localeData;
- proto$2.toIsoString = deprecate(
- 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
- toISOString$1
- );
- proto$2.lang = lang;
- // FORMATTING
- addFormatToken('X', 0, 0, 'unix');
- addFormatToken('x', 0, 0, 'valueOf');
- // PARSING
- addRegexToken('x', matchSigned);
- addRegexToken('X', matchTimestamp);
- addParseToken('X', function (input, array, config) {
- config._d = new Date(parseFloat(input) * 1000);
- });
- addParseToken('x', function (input, array, config) {
- config._d = new Date(toInt(input));
- });
- //! moment.js
- hooks.version = '2.29.1';
- setHookCallback(createLocal);
- hooks.fn = proto;
- hooks.min = min;
- hooks.max = max;
- hooks.now = now;
- hooks.utc = createUTC;
- hooks.unix = createUnix;
- hooks.months = listMonths;
- hooks.isDate = isDate;
- hooks.locale = getSetGlobalLocale;
- hooks.invalid = createInvalid;
- hooks.duration = createDuration;
- hooks.isMoment = isMoment;
- hooks.weekdays = listWeekdays;
- hooks.parseZone = createInZone;
- hooks.localeData = getLocale;
- hooks.isDuration = isDuration;
- hooks.monthsShort = listMonthsShort;
- hooks.weekdaysMin = listWeekdaysMin;
- hooks.defineLocale = defineLocale;
- hooks.updateLocale = updateLocale;
- hooks.locales = listLocales;
- hooks.weekdaysShort = listWeekdaysShort;
- hooks.normalizeUnits = normalizeUnits;
- hooks.relativeTimeRounding = getSetRelativeTimeRounding;
- hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
- hooks.calendarFormat = getCalendarFormat;
- hooks.prototype = proto;
- // currently HTML5 input type only supports 24-hour formats
- hooks.HTML5_FMT = {
- DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
- DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
- DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
- DATE: 'YYYY-MM-DD', // <input type="date" />
- TIME: 'HH:mm', // <input type="time" />
- TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
- TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
- WEEK: 'GGGG-[W]WW', // <input type="week" />
- MONTH: 'YYYY-MM', // <input type="month" />
- };
- return hooks;
- })));
- /***/ }),
- /***/ 4366:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var makeIterator = __webpack_require__(54891);
- /**
- * Array filter
- */
- function filter(arr, callback, thisObj) {
- callback = makeIterator(callback, thisObj);
- var results = [];
- if (arr == null) {
- return results;
- }
- var i = -1, len = arr.length, value;
- while (++i < len) {
- value = arr[i];
- if (callback(value, i, arr)) {
- results.push(value);
- }
- }
- return results;
- }
- module.exports = filter;
- /***/ }),
- /***/ 4978:
- /***/ ((module) => {
- /**
- * Array forEach
- */
- function forEach(arr, callback, thisObj) {
- if (arr == null) {
- return;
- }
- var i = -1,
- len = arr.length;
- while (++i < len) {
- // we iterate over sparse items since there is no way to make it
- // work properly on IE 7-8. see #64
- if ( callback.call(thisObj, arr[i], i, arr) === false ) {
- break;
- }
- }
- }
- module.exports = forEach;
- /***/ }),
- /***/ 89451:
- /***/ ((module) => {
- /**
- * Create slice of source array or array-like object
- */
- function slice(arr, start, end){
- var len = arr.length;
- if (start == null) {
- start = 0;
- } else if (start < 0) {
- start = Math.max(len + start, 0);
- } else {
- start = Math.min(start, len);
- }
- if (end == null) {
- end = len;
- } else if (end < 0) {
- end = Math.max(len + end, 0);
- } else {
- end = Math.min(end, len);
- }
- var result = [];
- while (start < end) {
- result.push(arr[start++]);
- }
- return result;
- }
- module.exports = slice;
- /***/ }),
- /***/ 79863:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var filter = __webpack_require__(4366);
- /**
- * @return {array} Array of unique items
- */
- function unique(arr, compare){
- compare = compare || isEqual;
- return filter(arr, function(item, i, arr){
- var n = arr.length;
- while (++i < n) {
- if ( compare(item, arr[i]) ) {
- return false;
- }
- }
- return true;
- });
- }
- function isEqual(a, b){
- return a === b;
- }
- module.exports = unique;
- /***/ }),
- /***/ 84596:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var slice = __webpack_require__(89451);
- /**
- * Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection.
- * @param {Function} fn Function.
- * @param {object} context Execution context.
- * @param {rest} args Arguments (0...n arguments).
- * @return {Function} Wrapped Function.
- */
- function bind(fn, context, args){
- var argsArr = slice(arguments, 2); //curried args
- return function(){
- return fn.apply(context, argsArr.concat(slice(arguments)));
- };
- }
- module.exports = bind;
- /***/ }),
- /***/ 19761:
- /***/ ((module) => {
- /**
- * Returns the first argument provided to it.
- */
- function identity(val){
- return val;
- }
- module.exports = identity;
- /***/ }),
- /***/ 54891:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var identity = __webpack_require__(19761);
- var prop = __webpack_require__(99437);
- var deepMatches = __webpack_require__(28614);
- /**
- * Converts argument into a valid iterator.
- * Used internally on most array/object/collection methods that receives a
- * callback/iterator providing a shortcut syntax.
- */
- function makeIterator(src, thisObj){
- if (src == null) {
- return identity;
- }
- switch(typeof src) {
- case 'function':
- // function is the first to improve perf (most common case)
- // also avoid using `Function#call` if not needed, which boosts
- // perf a lot in some cases
- return (typeof thisObj !== 'undefined')? function(val, i, arr){
- return src.call(thisObj, val, i, arr);
- } : src;
- case 'object':
- return function(val){
- return deepMatches(val, src);
- };
- case 'string':
- case 'number':
- return prop(src);
- }
- }
- module.exports = makeIterator;
- /***/ }),
- /***/ 99437:
- /***/ ((module) => {
- /**
- * Returns a function that gets a property of the passed object
- */
- function prop(name){
- return function(obj){
- return obj[name];
- };
- }
- module.exports = prop;
- /***/ }),
- /***/ 19775:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var isKind = __webpack_require__(52813);
- /**
- */
- var isArray = Array.isArray || function (val) {
- return isKind(val, 'Array');
- };
- module.exports = isArray;
- /***/ }),
- /***/ 52813:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var kindOf = __webpack_require__(96224);
- /**
- * Check if value is from a specific "kind".
- */
- function isKind(val, kind){
- return kindOf(val) === kind;
- }
- module.exports = isKind;
- /***/ }),
- /***/ 96224:
- /***/ ((module) => {
- /**
- * Gets the "kind" of value. (e.g. "String", "Number", etc)
- */
- function kindOf(val) {
- return Object.prototype.toString.call(val).slice(8, -1);
- }
- module.exports = kindOf;
- /***/ }),
- /***/ 4007:
- /***/ ((module) => {
- /**
- * Typecast a value to a String, using an empty string value for null or
- * undefined.
- */
- function toString(val){
- return val == null ? '' : val.toString();
- }
- module.exports = toString;
- /***/ }),
- /***/ 19188:
- /***/ ((module) => {
- /**
- * Clamps value inside range.
- */
- function clamp(val, min, max){
- return val < min? min : (val > max? max : val);
- }
- module.exports = clamp;
- /***/ }),
- /***/ 28614:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var forOwn = __webpack_require__(66463);
- var isArray = __webpack_require__(19775);
- function containsMatch(array, pattern) {
- var i = -1, length = array.length;
- while (++i < length) {
- if (deepMatches(array[i], pattern)) {
- return true;
- }
- }
- return false;
- }
- function matchArray(target, pattern) {
- var i = -1, patternLength = pattern.length;
- while (++i < patternLength) {
- if (!containsMatch(target, pattern[i])) {
- return false;
- }
- }
- return true;
- }
- function matchObject(target, pattern) {
- var result = true;
- forOwn(pattern, function(val, key) {
- if (!deepMatches(target[key], val)) {
- // Return false to break out of forOwn early
- return (result = false);
- }
- });
- return result;
- }
- /**
- * Recursively check if the objects match.
- */
- function deepMatches(target, pattern){
- if (target && typeof target === 'object' &&
- pattern && typeof pattern === 'object') {
- if (isArray(target) && isArray(pattern)) {
- return matchArray(target, pattern);
- } else {
- return matchObject(target, pattern);
- }
- } else {
- return target === pattern;
- }
- }
- module.exports = deepMatches;
- /***/ }),
- /***/ 15473:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var hasOwn = __webpack_require__(12683);
- var _hasDontEnumBug,
- _dontEnums;
- function checkDontEnum(){
- _dontEnums = [
- 'toString',
- 'toLocaleString',
- 'valueOf',
- 'hasOwnProperty',
- 'isPrototypeOf',
- 'propertyIsEnumerable',
- 'constructor'
- ];
- _hasDontEnumBug = true;
- for (var key in {'toString': null}) {
- _hasDontEnumBug = false;
- }
- }
- /**
- * Similar to Array/forEach but works over object properties and fixes Don't
- * Enum bug on IE.
- * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
- */
- function forIn(obj, fn, thisObj){
- var key, i = 0;
- // no need to check if argument is a real object that way we can use
- // it for arrays, functions, date, etc.
- //post-pone check till needed
- if (_hasDontEnumBug == null) checkDontEnum();
- for (key in obj) {
- if (exec(fn, obj, key, thisObj) === false) {
- break;
- }
- }
- if (_hasDontEnumBug) {
- var ctor = obj.constructor,
- isProto = !!ctor && obj === ctor.prototype;
- while (key = _dontEnums[i++]) {
- // For constructor, if it is a prototype object the constructor
- // is always non-enumerable unless defined otherwise (and
- // enumerated above). For non-prototype objects, it will have
- // to be defined on this object, since it cannot be defined on
- // any prototype objects.
- //
- // For other [[DontEnum]] properties, check if the value is
- // different than Object prototype value.
- if (
- (key !== 'constructor' ||
- (!isProto && hasOwn(obj, key))) &&
- obj[key] !== Object.prototype[key]
- ) {
- if (exec(fn, obj, key, thisObj) === false) {
- break;
- }
- }
- }
- }
- }
- function exec(fn, obj, key, thisObj){
- return fn.call(thisObj, obj[key], key, obj);
- }
- module.exports = forIn;
- /***/ }),
- /***/ 66463:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var hasOwn = __webpack_require__(12683);
- var forIn = __webpack_require__(15473);
- /**
- * Similar to Array/forEach but works over object properties and fixes Don't
- * Enum bug on IE.
- * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
- */
- function forOwn(obj, fn, thisObj){
- forIn(obj, function(val, key){
- if (hasOwn(obj, key)) {
- return fn.call(thisObj, obj[key], key, obj);
- }
- });
- }
- module.exports = forOwn;
- /***/ }),
- /***/ 12683:
- /***/ ((module) => {
- /**
- * Safer Object.hasOwnProperty
- */
- function hasOwn(obj, prop){
- return Object.prototype.hasOwnProperty.call(obj, prop);
- }
- module.exports = hasOwn;
- /***/ }),
- /***/ 85407:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- //automatically generated, do not edit!
- //run `node build` instead
- module.exports = {
- 'contains' : __webpack_require__(58169),
- 'decode' : __webpack_require__(96592),
- 'encode' : __webpack_require__(54706),
- 'getParam' : __webpack_require__(39567),
- 'getQuery' : __webpack_require__(80902),
- 'parse' : __webpack_require__(94460),
- 'setParam' : __webpack_require__(5025)
- };
- /***/ }),
- /***/ 58169:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var getQuery = __webpack_require__(80902);
- /**
- * Checks if query string contains parameter.
- */
- function contains(url, paramName) {
- var regex = new RegExp('(\\?|&)'+ paramName +'=', 'g'); //matches `?param=` or `¶m=`
- return regex.test(getQuery(url));
- }
- module.exports = contains;
- /***/ }),
- /***/ 96592:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var typecast = __webpack_require__(37038);
- var isArray = __webpack_require__(19775);
- var hasOwn = __webpack_require__(12683);
- /**
- * Decode query string into an object of keys => vals.
- */
- function decode(queryStr, shouldTypecast) {
- var queryArr = (queryStr || '').replace('?', '').split('&'),
- reg = /([^=]+)=(.+)/,
- i = -1,
- obj = {},
- equalIndex, cur, pValue, pName;
- while ((cur = queryArr[++i])) {
- equalIndex = cur.indexOf('=');
- pName = cur.substring(0, equalIndex);
- pValue = decodeURIComponent(cur.substring(equalIndex + 1));
- if (shouldTypecast !== false) {
- pValue = typecast(pValue);
- }
- if (hasOwn(obj, pName)){
- if(isArray(obj[pName])){
- obj[pName].push(pValue);
- } else {
- obj[pName] = [obj[pName], pValue];
- }
- } else {
- obj[pName] = pValue;
- }
- }
- return obj;
- }
- module.exports = decode;
- /***/ }),
- /***/ 54706:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var forOwn = __webpack_require__(66463);
- var isArray = __webpack_require__(19775);
- var forEach = __webpack_require__(4978);
- /**
- * Encode object into a query string.
- */
- function encode(obj){
- var query = [],
- arrValues, reg;
- forOwn(obj, function (val, key) {
- if (isArray(val)) {
- arrValues = key + '=';
- reg = new RegExp('&'+key+'+=$');
- forEach(val, function (aValue) {
- arrValues += encodeURIComponent(aValue) + '&' + key + '=';
- });
- query.push(arrValues.replace(reg, ''));
- } else {
- query.push(key + '=' + encodeURIComponent(val));
- }
- });
- return (query.length) ? '?' + query.join('&') : '';
- }
- module.exports = encode;
- /***/ }),
- /***/ 39567:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var typecast = __webpack_require__(37038);
- var getQuery = __webpack_require__(80902);
- /**
- * Get query parameter value.
- */
- function getParam(url, param, shouldTypecast){
- var regexp = new RegExp('(\\?|&)'+ param + '=([^&]*)'), //matches `?param=value` or `¶m=value`, value = $2
- result = regexp.exec( getQuery(url) ),
- val = (result && result[2])? result[2] : null;
- return shouldTypecast === false? val : typecast(val);
- }
- module.exports = getParam;
- /***/ }),
- /***/ 80902:
- /***/ ((module) => {
- /**
- * Gets full query as string with all special chars decoded.
- */
- function getQuery(url) {
- // url = url.replace(/#.*\?/, '?'); //removes hash (to avoid getting hash query)
- var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt
- return (queryString)? decodeURIComponent(queryString[0].replace(/\+/g,' ')) : '';
- }
- module.exports = getQuery;
- /***/ }),
- /***/ 94460:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var decode = __webpack_require__(96592);
- var getQuery = __webpack_require__(80902);
- /**
- * Get query string, parses and decodes it.
- */
- function parse(url, shouldTypecast) {
- return decode(getQuery(url), shouldTypecast);
- }
- module.exports = parse;
- /***/ }),
- /***/ 5025:
- /***/ ((module) => {
- /**
- * Set query string parameter value
- */
- function setParam(url, paramName, value){
- url = url || '';
- var re = new RegExp('(\\?|&)'+ paramName +'=[^&]*' );
- var param = paramName +'='+ encodeURIComponent( value );
- if ( re.test(url) ) {
- return url.replace(re, '$1'+ param);
- } else {
- if (url.indexOf('?') === -1) {
- url += '?';
- }
- if (url.indexOf('=') !== -1) {
- url += '&';
- }
- return url + param;
- }
- }
- module.exports = setParam;
- /***/ }),
- /***/ 88723:
- /***/ ((module) => {
- /**
- * Contains all Unicode white-spaces. Taken from
- * http://en.wikipedia.org/wiki/Whitespace_character.
- */
- module.exports = [
- ' ', '\n', '\r', '\t', '\f', '\v', '\u00A0', '\u1680', '\u180E',
- '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006',
- '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F',
- '\u205F', '\u3000'
- ];
- /***/ }),
- /***/ 71047:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toString = __webpack_require__(4007);
- var replaceAccents = __webpack_require__(90568);
- var removeNonWord = __webpack_require__(657);
- var upperCase = __webpack_require__(6608);
- var lowerCase = __webpack_require__(60437);
- /**
- * Convert string to camelCase text.
- */
- function camelCase(str){
- str = toString(str);
- str = replaceAccents(str);
- str = removeNonWord(str)
- .replace(/[\-_]/g, ' '); // convert all hyphens and underscores to spaces
- // handle acronyms
- // matches lowercase chars && uppercase words
- if (/[a-z]/.test(str) && /^|\s[A-Z]+\s|$/.test(str)) {
- // we convert any word that isn't all caps into lowercase
- str = str.replace(/\s(\w+)/g, function(word, m) {
- return /^[A-Z]+$/.test(m) ? word : lowerCase(word);
- });
- } else if (/\s/.test(str)) {
- // if it doesn't contain an acronym and it has spaces we should
- // convert every word to lowercase
- str = lowerCase(str);
- }
- return str
- .replace(/\s[a-z]/g, upperCase) // convert first char of each word to UPPERCASE
- .replace(/^\s*[A-Z]+/g, lowerCase) // convert first word to lowercase
- .replace(/\s+/g, ''); // remove spaces
- }
- module.exports = camelCase;
- /***/ }),
- /***/ 85286:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toString = __webpack_require__(4007);
- /**
- * Searches for a given substring
- */
- function contains(str, substring, fromIndex){
- str = toString(str);
- substring = toString(substring);
- return str.indexOf(substring, fromIndex) !== -1;
- }
- module.exports = contains;
- /***/ }),
- /***/ 60437:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toString = __webpack_require__(4007);
- /**
- * "Safer" String.toLowerCase()
- */
- function lowerCase(str){
- str = toString(str);
- return str.toLowerCase();
- }
- module.exports = lowerCase;
- /***/ }),
- /***/ 82516:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toString = __webpack_require__(4007);
- var WHITE_SPACES = __webpack_require__(88723);
- /**
- * Remove chars from beginning of string.
- */
- function ltrim(str, chars) {
- str = toString(str);
- chars = chars || WHITE_SPACES;
- var start = 0,
- len = str.length,
- charLen = chars.length,
- found = true,
- i, c;
- while (found && start < len) {
- found = false;
- i = -1;
- c = str.charAt(start);
- while (++i < charLen) {
- if (c === chars[i]) {
- found = true;
- start++;
- break;
- }
- }
- }
- return (start >= len) ? '' : str.substr(start, len);
- }
- module.exports = ltrim;
- /***/ }),
- /***/ 657:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toString = __webpack_require__(4007);
- // This pattern is generated by the _build/pattern-removeNonWord.js script
- var PATTERN = /[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g;
- /**
- * Remove non-word chars.
- */
- function removeNonWord(str){
- str = toString(str);
- return str.replace(PATTERN, '');
- }
- module.exports = removeNonWord;
- /***/ }),
- /***/ 90568:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toString = __webpack_require__(4007);
- /**
- * Replaces all accented chars with regular ones
- */
- function replaceAccents(str){
- str = toString(str);
- // verifies if the String has accents and replace them
- if (str.search(/[\xC0-\xFF]/g) > -1) {
- str = str
- .replace(/[\xC0-\xC5]/g, "A")
- .replace(/[\xC6]/g, "AE")
- .replace(/[\xC7]/g, "C")
- .replace(/[\xC8-\xCB]/g, "E")
- .replace(/[\xCC-\xCF]/g, "I")
- .replace(/[\xD0]/g, "D")
- .replace(/[\xD1]/g, "N")
- .replace(/[\xD2-\xD6\xD8]/g, "O")
- .replace(/[\xD9-\xDC]/g, "U")
- .replace(/[\xDD]/g, "Y")
- .replace(/[\xDE]/g, "P")
- .replace(/[\xE0-\xE5]/g, "a")
- .replace(/[\xE6]/g, "ae")
- .replace(/[\xE7]/g, "c")
- .replace(/[\xE8-\xEB]/g, "e")
- .replace(/[\xEC-\xEF]/g, "i")
- .replace(/[\xF1]/g, "n")
- .replace(/[\xF2-\xF6\xF8]/g, "o")
- .replace(/[\xF9-\xFC]/g, "u")
- .replace(/[\xFE]/g, "p")
- .replace(/[\xFD\xFF]/g, "y");
- }
- return str;
- }
- module.exports = replaceAccents;
- /***/ }),
- /***/ 95264:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toString = __webpack_require__(4007);
- var WHITE_SPACES = __webpack_require__(88723);
- /**
- * Remove chars from end of string.
- */
- function rtrim(str, chars) {
- str = toString(str);
- chars = chars || WHITE_SPACES;
- var end = str.length - 1,
- charLen = chars.length,
- found = true,
- i, c;
- while (found && end >= 0) {
- found = false;
- i = -1;
- c = str.charAt(end);
- while (++i < charLen) {
- if (c === chars[i]) {
- found = true;
- end--;
- break;
- }
- }
- }
- return (end >= 0) ? str.substring(0, end + 1) : '';
- }
- module.exports = rtrim;
- /***/ }),
- /***/ 78579:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toString = __webpack_require__(4007);
- var WHITE_SPACES = __webpack_require__(88723);
- var ltrim = __webpack_require__(82516);
- var rtrim = __webpack_require__(95264);
- /**
- * Remove white-spaces from beginning and end of string.
- */
- function trim(str, chars) {
- str = toString(str);
- chars = chars || WHITE_SPACES;
- return ltrim(rtrim(str, chars), chars);
- }
- module.exports = trim;
- /***/ }),
- /***/ 37038:
- /***/ ((module) => {
- var UNDEF;
- /**
- * Parses string and convert it into a native value.
- */
- function typecast(val) {
- var r;
- if ( val === null || val === 'null' ) {
- r = null;
- } else if ( val === 'true' ) {
- r = true;
- } else if ( val === 'false' ) {
- r = false;
- } else if ( val === UNDEF || val === 'undefined' ) {
- r = UNDEF;
- } else if ( val === '' || isNaN(val) ) {
- //isNaN('') returns false
- r = val;
- } else {
- //parseFloat(null || '') returns NaN
- r = parseFloat(val);
- }
- return r;
- }
- module.exports = typecast;
- /***/ }),
- /***/ 6608:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var toString = __webpack_require__(4007);
- /**
- * "Safer" String.toUpperCase()
- */
- function upperCase(str){
- str = toString(str);
- return str.toUpperCase();
- }
- module.exports = upperCase;
- /***/ }),
- /***/ 35666:
- /***/ ((module) => {
- /**
- * Copyright (c) 2014-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
- var runtime = (function (exports) {
- "use strict";
- var Op = Object.prototype;
- var hasOwn = Op.hasOwnProperty;
- var undefined; // More compressible than void 0.
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
- function define(obj, key, value) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- return obj[key];
- }
- try {
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
- define({}, "");
- } catch (err) {
- define = function(obj, key, value) {
- return obj[key] = value;
- };
- }
- function wrap(innerFn, outerFn, self, tryLocsList) {
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
- var generator = Object.create(protoGenerator.prototype);
- var context = new Context(tryLocsList || []);
- // The ._invoke method unifies the implementations of the .next,
- // .throw, and .return methods.
- generator._invoke = makeInvokeMethod(innerFn, self, context);
- return generator;
- }
- exports.wrap = wrap;
- // Try/catch helper to minimize deoptimizations. Returns a completion
- // record like context.tryEntries[i].completion. This interface could
- // have been (and was previously) designed to take a closure to be
- // invoked without arguments, but in all the cases we care about we
- // already have an existing method we want to call, so there's no need
- // to create a new function object. We can even get away with assuming
- // the method takes exactly one argument, since that happens to be true
- // in every case, so we don't have to touch the arguments object. The
- // only additional allocation required is the completion record, which
- // has a stable shape and so hopefully should be cheap to allocate.
- function tryCatch(fn, obj, arg) {
- try {
- return { type: "normal", arg: fn.call(obj, arg) };
- } catch (err) {
- return { type: "throw", arg: err };
- }
- }
- var GenStateSuspendedStart = "suspendedStart";
- var GenStateSuspendedYield = "suspendedYield";
- var GenStateExecuting = "executing";
- var GenStateCompleted = "completed";
- // Returning this object from the innerFn has the same effect as
- // breaking out of the dispatch switch statement.
- var ContinueSentinel = {};
- // Dummy constructor functions that we use as the .constructor and
- // .constructor.prototype properties for functions that return Generator
- // objects. For full spec compliance, you may wish to configure your
- // minifier not to mangle the names of these two functions.
- function Generator() {}
- function GeneratorFunction() {}
- function GeneratorFunctionPrototype() {}
- // This is a polyfill for %IteratorPrototype% for environments that
- // don't natively support it.
- var IteratorPrototype = {};
- IteratorPrototype[iteratorSymbol] = function () {
- return this;
- };
- var getProto = Object.getPrototypeOf;
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
- if (NativeIteratorPrototype &&
- NativeIteratorPrototype !== Op &&
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
- // This environment has a native %IteratorPrototype%; use it instead
- // of the polyfill.
- IteratorPrototype = NativeIteratorPrototype;
- }
- var Gp = GeneratorFunctionPrototype.prototype =
- Generator.prototype = Object.create(IteratorPrototype);
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
- GeneratorFunction.displayName = define(
- GeneratorFunctionPrototype,
- toStringTagSymbol,
- "GeneratorFunction"
- );
- // Helper for defining the .next, .throw, and .return methods of the
- // Iterator interface in terms of a single ._invoke method.
- function defineIteratorMethods(prototype) {
- ["next", "throw", "return"].forEach(function(method) {
- define(prototype, method, function(arg) {
- return this._invoke(method, arg);
- });
- });
- }
- exports.isGeneratorFunction = function(genFun) {
- var ctor = typeof genFun === "function" && genFun.constructor;
- return ctor
- ? ctor === GeneratorFunction ||
- // For the native GeneratorFunction constructor, the best we can
- // do is to check its .name property.
- (ctor.displayName || ctor.name) === "GeneratorFunction"
- : false;
- };
- exports.mark = function(genFun) {
- if (Object.setPrototypeOf) {
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
- } else {
- genFun.__proto__ = GeneratorFunctionPrototype;
- define(genFun, toStringTagSymbol, "GeneratorFunction");
- }
- genFun.prototype = Object.create(Gp);
- return genFun;
- };
- // Within the body of any async function, `await x` is transformed to
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
- // meant to be awaited.
- exports.awrap = function(arg) {
- return { __await: arg };
- };
- function AsyncIterator(generator, PromiseImpl) {
- function invoke(method, arg, resolve, reject) {
- var record = tryCatch(generator[method], generator, arg);
- if (record.type === "throw") {
- reject(record.arg);
- } else {
- var result = record.arg;
- var value = result.value;
- if (value &&
- typeof value === "object" &&
- hasOwn.call(value, "__await")) {
- return PromiseImpl.resolve(value.__await).then(function(value) {
- invoke("next", value, resolve, reject);
- }, function(err) {
- invoke("throw", err, resolve, reject);
- });
- }
- return PromiseImpl.resolve(value).then(function(unwrapped) {
- // When a yielded Promise is resolved, its final value becomes
- // the .value of the Promise<{value,done}> result for the
- // current iteration.
- result.value = unwrapped;
- resolve(result);
- }, function(error) {
- // If a rejected Promise was yielded, throw the rejection back
- // into the async generator function so it can be handled there.
- return invoke("throw", error, resolve, reject);
- });
- }
- }
- var previousPromise;
- function enqueue(method, arg) {
- function callInvokeWithMethodAndArg() {
- return new PromiseImpl(function(resolve, reject) {
- invoke(method, arg, resolve, reject);
- });
- }
- return previousPromise =
- // If enqueue has been called before, then we want to wait until
- // all previous Promises have been resolved before calling invoke,
- // so that results are always delivered in the correct order. If
- // enqueue has not been called before, then it is important to
- // call invoke immediately, without waiting on a callback to fire,
- // so that the async generator function has the opportunity to do
- // any necessary setup in a predictable way. This predictability
- // is why the Promise constructor synchronously invokes its
- // executor callback, and why async functions synchronously
- // execute code before the first await. Since we implement simple
- // async functions in terms of async generators, it is especially
- // important to get this right, even though it requires care.
- previousPromise ? previousPromise.then(
- callInvokeWithMethodAndArg,
- // Avoid propagating failures to Promises returned by later
- // invocations of the iterator.
- callInvokeWithMethodAndArg
- ) : callInvokeWithMethodAndArg();
- }
- // Define the unified helper method that is used to implement .next,
- // .throw, and .return (see defineIteratorMethods).
- this._invoke = enqueue;
- }
- defineIteratorMethods(AsyncIterator.prototype);
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
- return this;
- };
- exports.AsyncIterator = AsyncIterator;
- // Note that simple async functions are implemented on top of
- // AsyncIterator objects; they just return a Promise for the value of
- // the final result produced by the iterator.
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
- if (PromiseImpl === void 0) PromiseImpl = Promise;
- var iter = new AsyncIterator(
- wrap(innerFn, outerFn, self, tryLocsList),
- PromiseImpl
- );
- return exports.isGeneratorFunction(outerFn)
- ? iter // If outerFn is a generator, return the full iterator.
- : iter.next().then(function(result) {
- return result.done ? result.value : iter.next();
- });
- };
- function makeInvokeMethod(innerFn, self, context) {
- var state = GenStateSuspendedStart;
- return function invoke(method, arg) {
- if (state === GenStateExecuting) {
- throw new Error("Generator is already running");
- }
- if (state === GenStateCompleted) {
- if (method === "throw") {
- throw arg;
- }
- // Be forgiving, per 25.3.3.3.3 of the spec:
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
- return doneResult();
- }
- context.method = method;
- context.arg = arg;
- while (true) {
- var delegate = context.delegate;
- if (delegate) {
- var delegateResult = maybeInvokeDelegate(delegate, context);
- if (delegateResult) {
- if (delegateResult === ContinueSentinel) continue;
- return delegateResult;
- }
- }
- if (context.method === "next") {
- // Setting context._sent for legacy support of Babel's
- // function.sent implementation.
- context.sent = context._sent = context.arg;
- } else if (context.method === "throw") {
- if (state === GenStateSuspendedStart) {
- state = GenStateCompleted;
- throw context.arg;
- }
- context.dispatchException(context.arg);
- } else if (context.method === "return") {
- context.abrupt("return", context.arg);
- }
- state = GenStateExecuting;
- var record = tryCatch(innerFn, self, context);
- if (record.type === "normal") {
- // If an exception is thrown from innerFn, we leave state ===
- // GenStateExecuting and loop back for another invocation.
- state = context.done
- ? GenStateCompleted
- : GenStateSuspendedYield;
- if (record.arg === ContinueSentinel) {
- continue;
- }
- return {
- value: record.arg,
- done: context.done
- };
- } else if (record.type === "throw") {
- state = GenStateCompleted;
- // Dispatch the exception by looping back around to the
- // context.dispatchException(context.arg) call above.
- context.method = "throw";
- context.arg = record.arg;
- }
- }
- };
- }
- // Call delegate.iterator[context.method](context.arg) and handle the
- // result, either by returning a { value, done } result from the
- // delegate iterator, or by modifying context.method and context.arg,
- // setting context.delegate to null, and returning the ContinueSentinel.
- function maybeInvokeDelegate(delegate, context) {
- var method = delegate.iterator[context.method];
- if (method === undefined) {
- // A .throw or .return when the delegate iterator has no .throw
- // method always terminates the yield* loop.
- context.delegate = null;
- if (context.method === "throw") {
- // Note: ["return"] must be used for ES3 parsing compatibility.
- if (delegate.iterator["return"]) {
- // If the delegate iterator has a return method, give it a
- // chance to clean up.
- context.method = "return";
- context.arg = undefined;
- maybeInvokeDelegate(delegate, context);
- if (context.method === "throw") {
- // If maybeInvokeDelegate(context) changed context.method from
- // "return" to "throw", let that override the TypeError below.
- return ContinueSentinel;
- }
- }
- context.method = "throw";
- context.arg = new TypeError(
- "The iterator does not provide a 'throw' method");
- }
- return ContinueSentinel;
- }
- var record = tryCatch(method, delegate.iterator, context.arg);
- if (record.type === "throw") {
- context.method = "throw";
- context.arg = record.arg;
- context.delegate = null;
- return ContinueSentinel;
- }
- var info = record.arg;
- if (! info) {
- context.method = "throw";
- context.arg = new TypeError("iterator result is not an object");
- context.delegate = null;
- return ContinueSentinel;
- }
- if (info.done) {
- // Assign the result of the finished delegate to the temporary
- // variable specified by delegate.resultName (see delegateYield).
- context[delegate.resultName] = info.value;
- // Resume execution at the desired location (see delegateYield).
- context.next = delegate.nextLoc;
- // If context.method was "throw" but the delegate handled the
- // exception, let the outer generator proceed normally. If
- // context.method was "next", forget context.arg since it has been
- // "consumed" by the delegate iterator. If context.method was
- // "return", allow the original .return call to continue in the
- // outer generator.
- if (context.method !== "return") {
- context.method = "next";
- context.arg = undefined;
- }
- } else {
- // Re-yield the result returned by the delegate method.
- return info;
- }
- // The delegate iterator is finished, so forget it and continue with
- // the outer generator.
- context.delegate = null;
- return ContinueSentinel;
- }
- // Define Generator.prototype.{next,throw,return} in terms of the
- // unified ._invoke helper method.
- defineIteratorMethods(Gp);
- define(Gp, toStringTagSymbol, "Generator");
- // A Generator should always return itself as the iterator object when the
- // @@iterator function is called on it. Some browsers' implementations of the
- // iterator prototype chain incorrectly implement this, causing the Generator
- // object to not be returned from this call. This ensures that doesn't happen.
- // See https://github.com/facebook/regenerator/issues/274 for more details.
- Gp[iteratorSymbol] = function() {
- return this;
- };
- Gp.toString = function() {
- return "[object Generator]";
- };
- function pushTryEntry(locs) {
- var entry = { tryLoc: locs[0] };
- if (1 in locs) {
- entry.catchLoc = locs[1];
- }
- if (2 in locs) {
- entry.finallyLoc = locs[2];
- entry.afterLoc = locs[3];
- }
- this.tryEntries.push(entry);
- }
- function resetTryEntry(entry) {
- var record = entry.completion || {};
- record.type = "normal";
- delete record.arg;
- entry.completion = record;
- }
- function Context(tryLocsList) {
- // The root entry object (effectively a try statement without a catch
- // or a finally block) gives us a place to store values thrown from
- // locations where there is no enclosing try statement.
- this.tryEntries = [{ tryLoc: "root" }];
- tryLocsList.forEach(pushTryEntry, this);
- this.reset(true);
- }
- exports.keys = function(object) {
- var keys = [];
- for (var key in object) {
- keys.push(key);
- }
- keys.reverse();
- // Rather than returning an object with a next method, we keep
- // things simple and return the next function itself.
- return function next() {
- while (keys.length) {
- var key = keys.pop();
- if (key in object) {
- next.value = key;
- next.done = false;
- return next;
- }
- }
- // To avoid creating an additional object, we just hang the .value
- // and .done properties off the next function object itself. This
- // also ensures that the minifier will not anonymize the function.
- next.done = true;
- return next;
- };
- };
- function values(iterable) {
- if (iterable) {
- var iteratorMethod = iterable[iteratorSymbol];
- if (iteratorMethod) {
- return iteratorMethod.call(iterable);
- }
- if (typeof iterable.next === "function") {
- return iterable;
- }
- if (!isNaN(iterable.length)) {
- var i = -1, next = function next() {
- while (++i < iterable.length) {
- if (hasOwn.call(iterable, i)) {
- next.value = iterable[i];
- next.done = false;
- return next;
- }
- }
- next.value = undefined;
- next.done = true;
- return next;
- };
- return next.next = next;
- }
- }
- // Return an iterator with no values.
- return { next: doneResult };
- }
- exports.values = values;
- function doneResult() {
- return { value: undefined, done: true };
- }
- Context.prototype = {
- constructor: Context,
- reset: function(skipTempReset) {
- this.prev = 0;
- this.next = 0;
- // Resetting context._sent for legacy support of Babel's
- // function.sent implementation.
- this.sent = this._sent = undefined;
- this.done = false;
- this.delegate = null;
- this.method = "next";
- this.arg = undefined;
- this.tryEntries.forEach(resetTryEntry);
- if (!skipTempReset) {
- for (var name in this) {
- // Not sure about the optimal order of these conditions:
- if (name.charAt(0) === "t" &&
- hasOwn.call(this, name) &&
- !isNaN(+name.slice(1))) {
- this[name] = undefined;
- }
- }
- }
- },
- stop: function() {
- this.done = true;
- var rootEntry = this.tryEntries[0];
- var rootRecord = rootEntry.completion;
- if (rootRecord.type === "throw") {
- throw rootRecord.arg;
- }
- return this.rval;
- },
- dispatchException: function(exception) {
- if (this.done) {
- throw exception;
- }
- var context = this;
- function handle(loc, caught) {
- record.type = "throw";
- record.arg = exception;
- context.next = loc;
- if (caught) {
- // If the dispatched exception was caught by a catch block,
- // then let that catch block handle the exception normally.
- context.method = "next";
- context.arg = undefined;
- }
- return !! caught;
- }
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- var record = entry.completion;
- if (entry.tryLoc === "root") {
- // Exception thrown outside of any try block that could handle
- // it, so set the completion value of the entire function to
- // throw the exception.
- return handle("end");
- }
- if (entry.tryLoc <= this.prev) {
- var hasCatch = hasOwn.call(entry, "catchLoc");
- var hasFinally = hasOwn.call(entry, "finallyLoc");
- if (hasCatch && hasFinally) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- } else if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
- } else if (hasCatch) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- }
- } else if (hasFinally) {
- if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
- } else {
- throw new Error("try statement without catch or finally");
- }
- }
- }
- },
- abrupt: function(type, arg) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc <= this.prev &&
- hasOwn.call(entry, "finallyLoc") &&
- this.prev < entry.finallyLoc) {
- var finallyEntry = entry;
- break;
- }
- }
- if (finallyEntry &&
- (type === "break" ||
- type === "continue") &&
- finallyEntry.tryLoc <= arg &&
- arg <= finallyEntry.finallyLoc) {
- // Ignore the finally entry if control is not jumping to a
- // location outside the try/catch block.
- finallyEntry = null;
- }
- var record = finallyEntry ? finallyEntry.completion : {};
- record.type = type;
- record.arg = arg;
- if (finallyEntry) {
- this.method = "next";
- this.next = finallyEntry.finallyLoc;
- return ContinueSentinel;
- }
- return this.complete(record);
- },
- complete: function(record, afterLoc) {
- if (record.type === "throw") {
- throw record.arg;
- }
- if (record.type === "break" ||
- record.type === "continue") {
- this.next = record.arg;
- } else if (record.type === "return") {
- this.rval = this.arg = record.arg;
- this.method = "return";
- this.next = "end";
- } else if (record.type === "normal" && afterLoc) {
- this.next = afterLoc;
- }
- return ContinueSentinel;
- },
- finish: function(finallyLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.finallyLoc === finallyLoc) {
- this.complete(entry.completion, entry.afterLoc);
- resetTryEntry(entry);
- return ContinueSentinel;
- }
- }
- },
- "catch": function(tryLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc === tryLoc) {
- var record = entry.completion;
- if (record.type === "throw") {
- var thrown = record.arg;
- resetTryEntry(entry);
- }
- return thrown;
- }
- }
- // The context.catch method must only be called with a location
- // argument that corresponds to a known catch block.
- throw new Error("illegal catch attempt");
- },
- delegateYield: function(iterable, resultName, nextLoc) {
- this.delegate = {
- iterator: values(iterable),
- resultName: resultName,
- nextLoc: nextLoc
- };
- if (this.method === "next") {
- // Deliberately forget the last sent value so that we don't
- // accidentally pass it on to the delegate.
- this.arg = undefined;
- }
- return ContinueSentinel;
- }
- };
- // Regardless of whether this script is executing as a CommonJS module
- // or not, return the runtime object so that we can declare the variable
- // regeneratorRuntime in the outer scope, which allows this module to be
- // injected easily by `bin/regenerator --include-runtime script.js`.
- return exports;
- }(
- // If this script is executing as a CommonJS module, use module.exports
- // as the regeneratorRuntime namespace. Otherwise create a new empty
- // object. Either way, the resulting object will be used to initialize
- // the regeneratorRuntime variable at the top of this file.
- true ? module.exports : 0
- ));
- try {
- regeneratorRuntime = runtime;
- } catch (accidentalStrictMode) {
- // This module should not be running in strict mode, so the above
- // assignment should always work unless something is misconfigured. Just
- // in case runtime.js accidentally runs in strict mode, we can escape
- // strict mode using a global Function call. This could conceivably fail
- // if a Content Security Policy forbids using Function, but in that case
- // the proper solution is to fix the accidental strict mode problem. If
- // you've misconfigured your bundler to force strict mode and applied a
- // CSP to forbid Function, and you're not willing to fix either of those
- // problems, please detail your unique predicament in a GitHub issue.
- Function("r", "regeneratorRuntime = r")(runtime);
- }
- /***/ }),
- /***/ 25703:
- /***/ (function(module, exports, __webpack_require__) {
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
- * selectize.js (v0.12.6)
- * Copyright (c) 2013–2015 Brian Reavis & contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
- * file except in compliance with the License. You may obtain a copy of the License at:
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
- * ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- *
- * @author Brian Reavis <brian@thirdroute.com>
- */
- /*jshint curly:false */
- /*jshint browser:true */
- (function(root, factory) {
- if (true) {
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(65311),__webpack_require__(55069),__webpack_require__(76252)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
- }(this, function($, Sifter, MicroPlugin) {
- 'use strict';
- var highlight = function($element, pattern) {
- if (typeof pattern === 'string' && !pattern.length) return;
- var regex = (typeof pattern === 'string') ? new RegExp(pattern, 'i') : pattern;
-
- var highlight = function(node) {
- var skip = 0;
- // Wrap matching part of text node with highlighting <span>, e.g.
- // Soccer -> <span class="highlight">Soc</span>cer for regex = /soc/i
- if (node.nodeType === 3) {
- var pos = node.data.search(regex);
- if (pos >= 0 && node.data.length > 0) {
- var match = node.data.match(regex);
- var spannode = document.createElement('span');
- spannode.className = 'highlight';
- var middlebit = node.splitText(pos);
- var endbit = middlebit.splitText(match[0].length);
- var middleclone = middlebit.cloneNode(true);
- spannode.appendChild(middleclone);
- middlebit.parentNode.replaceChild(spannode, middlebit);
- skip = 1;
- }
- }
- // Recurse element node, looking for child text nodes to highlight, unless element
- // is childless, <script>, <style>, or already highlighted: <span class="hightlight">
- else if (node.nodeType === 1 && node.childNodes && !/(script|style)/i.test(node.tagName) && ( node.className !== 'highlight' || node.tagName !== 'SPAN' )) {
- for (var i = 0; i < node.childNodes.length; ++i) {
- i += highlight(node.childNodes[i]);
- }
- }
- return skip;
- };
-
- return $element.each(function() {
- highlight(this);
- });
- };
-
- /**
- * removeHighlight fn copied from highlight v5 and
- * edited to remove with() and pass js strict mode
- */
- $.fn.removeHighlight = function() {
- return this.find("span.highlight").each(function() {
- this.parentNode.firstChild.nodeName;
- var parent = this.parentNode;
- parent.replaceChild(this.firstChild, this);
- parent.normalize();
- }).end();
- };
-
-
- var MicroEvent = function() {};
- MicroEvent.prototype = {
- on: function(event, fct){
- this._events = this._events || {};
- this._events[event] = this._events[event] || [];
- this._events[event].push(fct);
- },
- off: function(event, fct){
- var n = arguments.length;
- if (n === 0) return delete this._events;
- if (n === 1) return delete this._events[event];
-
- this._events = this._events || {};
- if (event in this._events === false) return;
- this._events[event].splice(this._events[event].indexOf(fct), 1);
- },
- trigger: function(event /* , args... */){
- this._events = this._events || {};
- if (event in this._events === false) return;
- for (var i = 0; i < this._events[event].length; i++){
- this._events[event][i].apply(this, Array.prototype.slice.call(arguments, 1));
- }
- }
- };
-
- /**
- * Mixin will delegate all MicroEvent.js function in the destination object.
- *
- * - MicroEvent.mixin(Foobar) will make Foobar able to use MicroEvent
- *
- * @param {object} the object which will support MicroEvent
- */
- MicroEvent.mixin = function(destObject){
- var props = ['on', 'off', 'trigger'];
- for (var i = 0; i < props.length; i++){
- destObject.prototype[props[i]] = MicroEvent.prototype[props[i]];
- }
- };
-
- var IS_MAC = /Mac/.test(navigator.userAgent);
-
- var KEY_A = 65;
- var KEY_COMMA = 188;
- var KEY_RETURN = 13;
- var KEY_ESC = 27;
- var KEY_LEFT = 37;
- var KEY_UP = 38;
- var KEY_P = 80;
- var KEY_RIGHT = 39;
- var KEY_DOWN = 40;
- var KEY_N = 78;
- var KEY_BACKSPACE = 8;
- var KEY_DELETE = 46;
- var KEY_SHIFT = 16;
- var KEY_CMD = IS_MAC ? 91 : 17;
- var KEY_CTRL = IS_MAC ? 18 : 17;
- var KEY_TAB = 9;
-
- var TAG_SELECT = 1;
- var TAG_INPUT = 2;
-
- // for now, android support in general is too spotty to support validity
- var SUPPORTS_VALIDITY_API = !/android/i.test(window.navigator.userAgent) && !!document.createElement('input').validity;
-
-
- var isset = function(object) {
- return typeof object !== 'undefined';
- };
-
- /**
- * Converts a scalar to its best string representation
- * for hash keys and HTML attribute values.
- *
- * Transformations:
- * 'str' -> 'str'
- * null -> ''
- * undefined -> ''
- * true -> '1'
- * false -> '0'
- * 0 -> '0'
- * 1 -> '1'
- *
- * @param {string} value
- * @returns {string|null}
- */
- var hash_key = function(value) {
- if (typeof value === 'undefined' || value === null) return null;
- if (typeof value === 'boolean') return value ? '1' : '0';
- return value + '';
- };
-
- /**
- * Escapes a string for use within HTML.
- *
- * @param {string} str
- * @returns {string}
- */
- var escape_html = function(str) {
- return (str + '')
- .replace(/&/g, '&')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/"/g, '"');
- };
-
- /**
- * Escapes "$" characters in replacement strings.
- *
- * @param {string} str
- * @returns {string}
- */
- var escape_replace = function(str) {
- return (str + '').replace(/\$/g, '$$$$');
- };
-
- var hook = {};
-
- /**
- * Wraps `method` on `self` so that `fn`
- * is invoked before the original method.
- *
- * @param {object} self
- * @param {string} method
- * @param {function} fn
- */
- hook.before = function(self, method, fn) {
- var original = self[method];
- self[method] = function() {
- fn.apply(self, arguments);
- return original.apply(self, arguments);
- };
- };
-
- /**
- * Wraps `method` on `self` so that `fn`
- * is invoked after the original method.
- *
- * @param {object} self
- * @param {string} method
- * @param {function} fn
- */
- hook.after = function(self, method, fn) {
- var original = self[method];
- self[method] = function() {
- var result = original.apply(self, arguments);
- fn.apply(self, arguments);
- return result;
- };
- };
-
- /**
- * Wraps `fn` so that it can only be invoked once.
- *
- * @param {function} fn
- * @returns {function}
- */
- var once = function(fn) {
- var called = false;
- return function() {
- if (called) return;
- called = true;
- fn.apply(this, arguments);
- };
- };
-
- /**
- * Wraps `fn` so that it can only be called once
- * every `delay` milliseconds (invoked on the falling edge).
- *
- * @param {function} fn
- * @param {int} delay
- * @returns {function}
- */
- var debounce = function(fn, delay) {
- var timeout;
- return function() {
- var self = this;
- var args = arguments;
- window.clearTimeout(timeout);
- timeout = window.setTimeout(function() {
- fn.apply(self, args);
- }, delay);
- };
- };
-
- /**
- * Debounce all fired events types listed in `types`
- * while executing the provided `fn`.
- *
- * @param {object} self
- * @param {array} types
- * @param {function} fn
- */
- var debounce_events = function(self, types, fn) {
- var type;
- var trigger = self.trigger;
- var event_args = {};
-
- // override trigger method
- self.trigger = function() {
- var type = arguments[0];
- if (types.indexOf(type) !== -1) {
- event_args[type] = arguments;
- } else {
- return trigger.apply(self, arguments);
- }
- };
-
- // invoke provided function
- fn.apply(self, []);
- self.trigger = trigger;
-
- // trigger queued events
- for (type in event_args) {
- if (event_args.hasOwnProperty(type)) {
- trigger.apply(self, event_args[type]);
- }
- }
- };
-
- /**
- * A workaround for http://bugs.jquery.com/ticket/6696
- *
- * @param {object} $parent - Parent element to listen on.
- * @param {string} event - Event name.
- * @param {string} selector - Descendant selector to filter by.
- * @param {function} fn - Event handler.
- */
- var watchChildEvent = function($parent, event, selector, fn) {
- $parent.on(event, selector, function(e) {
- var child = e.target;
- while (child && child.parentNode !== $parent[0]) {
- child = child.parentNode;
- }
- e.currentTarget = child;
- return fn.apply(this, [e]);
- });
- };
-
- /**
- * Determines the current selection within a text input control.
- * Returns an object containing:
- * - start
- * - length
- *
- * @param {object} input
- * @returns {object}
- */
- var getSelection = function(input) {
- var result = {};
- if ('selectionStart' in input) {
- result.start = input.selectionStart;
- result.length = input.selectionEnd - result.start;
- } else if (document.selection) {
- input.focus();
- var sel = document.selection.createRange();
- var selLen = document.selection.createRange().text.length;
- sel.moveStart('character', -input.value.length);
- result.start = sel.text.length - selLen;
- result.length = selLen;
- }
- return result;
- };
-
- /**
- * Copies CSS properties from one element to another.
- *
- * @param {object} $from
- * @param {object} $to
- * @param {array} properties
- */
- var transferStyles = function($from, $to, properties) {
- var i, n, styles = {};
- if (properties) {
- for (i = 0, n = properties.length; i < n; i++) {
- styles[properties[i]] = $from.css(properties[i]);
- }
- } else {
- styles = $from.css();
- }
- $to.css(styles);
- };
-
- /**
- * Measures the width of a string within a
- * parent element (in pixels).
- *
- * @param {string} str
- * @param {object} $parent
- * @returns {int}
- */
- var measureString = function(str, $parent) {
- if (!str) {
- return 0;
- }
-
- if (!Selectize.$testInput) {
- Selectize.$testInput = $('<span />').css({
- position: 'absolute',
- top: -99999,
- left: -99999,
- width: 'auto',
- padding: 0,
- whiteSpace: 'pre'
- }).appendTo('body');
- }
-
- Selectize.$testInput.text(str);
-
- transferStyles($parent, Selectize.$testInput, [
- 'letterSpacing',
- 'fontSize',
- 'fontFamily',
- 'fontWeight',
- 'textTransform'
- ]);
-
- return Selectize.$testInput.width();
- };
-
- /**
- * Sets up an input to grow horizontally as the user
- * types. If the value is changed manually, you can
- * trigger the "update" handler to resize:
- *
- * $input.trigger('update');
- *
- * @param {object} $input
- */
- var autoGrow = function($input) {
- var currentWidth = null;
-
- var update = function(e, options) {
- var value, keyCode, printable, placeholder, width;
- var shift, character, selection;
- e = e || window.event || {};
- options = options || {};
-
- if (e.metaKey || e.altKey) return;
- if (!options.force && $input.data('grow') === false) return;
-
- value = $input.val();
- if (e.type && e.type.toLowerCase() === 'keydown') {
- keyCode = e.keyCode;
- printable = (
- (keyCode >= 48 && keyCode <= 57) || // 0-9
- (keyCode >= 65 && keyCode <= 90) || // a-z
- (keyCode >= 96 && keyCode <= 111) || // numpad 0-9, numeric operators
- (keyCode >= 186 && keyCode <= 222) || // semicolon, equal, comma, dash, etc.
- keyCode === 32 // space
- );
-
- if (keyCode === KEY_DELETE || keyCode === KEY_BACKSPACE) {
- selection = getSelection($input[0]);
- if (selection.length) {
- value = value.substring(0, selection.start) + value.substring(selection.start + selection.length);
- } else if (keyCode === KEY_BACKSPACE && selection.start) {
- value = value.substring(0, selection.start - 1) + value.substring(selection.start + 1);
- } else if (keyCode === KEY_DELETE && typeof selection.start !== 'undefined') {
- value = value.substring(0, selection.start) + value.substring(selection.start + 1);
- }
- } else if (printable) {
- shift = e.shiftKey;
- character = String.fromCharCode(e.keyCode);
- if (shift) character = character.toUpperCase();
- else character = character.toLowerCase();
- value += character;
- }
- }
-
- placeholder = $input.attr('placeholder');
- if (!value && placeholder) {
- value = placeholder;
- }
-
- width = measureString(value, $input) + 4;
- if (width !== currentWidth) {
- currentWidth = width;
- $input.width(width);
- $input.triggerHandler('resize');
- }
- };
-
- $input.on('keydown keyup update blur', update);
- update();
- };
-
- var domToString = function(d) {
- var tmp = document.createElement('div');
-
- tmp.appendChild(d.cloneNode(true));
-
- return tmp.innerHTML;
- };
-
- var logError = function(message, options){
- if(!options) options = {};
- var component = "Selectize";
-
- console.error(component + ": " + message)
-
- if(options.explanation){
- // console.group is undefined in <IE11
- if(console.group) console.group();
- console.error(options.explanation);
- if(console.group) console.groupEnd();
- }
- }
-
-
- var Selectize = function($input, settings) {
- var key, i, n, dir, input, self = this;
- input = $input[0];
- input.selectize = self;
-
- // detect rtl environment
- var computedStyle = window.getComputedStyle && window.getComputedStyle(input, null);
- dir = computedStyle ? computedStyle.getPropertyValue('direction') : input.currentStyle && input.currentStyle.direction;
- dir = dir || $input.parents('[dir]:first').attr('dir') || '';
-
- // setup default state
- $.extend(self, {
- order : 0,
- settings : settings,
- $input : $input,
- tabIndex : $input.attr('tabindex') || '',
- tagType : input.tagName.toLowerCase() === 'select' ? TAG_SELECT : TAG_INPUT,
- rtl : /rtl/i.test(dir),
-
- eventNS : '.selectize' + (++Selectize.count),
- highlightedValue : null,
- isBlurring : false,
- isOpen : false,
- isDisabled : false,
- isRequired : $input.is('[required]'),
- isInvalid : false,
- isLocked : false,
- isFocused : false,
- isInputHidden : false,
- isSetup : false,
- isShiftDown : false,
- isCmdDown : false,
- isCtrlDown : false,
- ignoreFocus : false,
- ignoreBlur : false,
- ignoreHover : false,
- hasOptions : false,
- currentResults : null,
- lastValue : '',
- caretPos : 0,
- loading : 0,
- loadedSearches : {},
-
- $activeOption : null,
- $activeItems : [],
-
- optgroups : {},
- options : {},
- userOptions : {},
- items : [],
- renderCache : {},
- onSearchChange : settings.loadThrottle === null ? self.onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
- });
-
- // search system
- self.sifter = new Sifter(this.options, {diacritics: settings.diacritics});
-
- // build options table
- if (self.settings.options) {
- for (i = 0, n = self.settings.options.length; i < n; i++) {
- self.registerOption(self.settings.options[i]);
- }
- delete self.settings.options;
- }
-
- // build optgroup table
- if (self.settings.optgroups) {
- for (i = 0, n = self.settings.optgroups.length; i < n; i++) {
- self.registerOptionGroup(self.settings.optgroups[i]);
- }
- delete self.settings.optgroups;
- }
-
- // option-dependent defaults
- self.settings.mode = self.settings.mode || (self.settings.maxItems === 1 ? 'single' : 'multi');
- if (typeof self.settings.hideSelected !== 'boolean') {
- self.settings.hideSelected = self.settings.mode === 'multi';
- }
-
- self.initializePlugins(self.settings.plugins);
- self.setupCallbacks();
- self.setupTemplates();
- self.setup();
- };
-
- // mixins
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- MicroEvent.mixin(Selectize);
-
- if(typeof MicroPlugin !== "undefined"){
- MicroPlugin.mixin(Selectize);
- }else{
- logError("Dependency MicroPlugin is missing",
- {explanation:
- "Make sure you either: (1) are using the \"standalone\" "+
- "version of Selectize, or (2) require MicroPlugin before you "+
- "load Selectize."}
- );
- }
-
-
- // methods
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- $.extend(Selectize.prototype, {
-
- /**
- * Creates all elements and sets up event bindings.
- */
- setup: function() {
- var self = this;
- var settings = self.settings;
- var eventNS = self.eventNS;
- var $window = $(window);
- var $document = $(document);
- var $input = self.$input;
-
- var $wrapper;
- var $control;
- var $control_input;
- var $dropdown;
- var $dropdown_content;
- var $dropdown_parent;
- var inputMode;
- var timeout_blur;
- var timeout_focus;
- var classes;
- var classes_plugins;
- var inputId;
-
- inputMode = self.settings.mode;
- classes = $input.attr('class') || '';
-
- $wrapper = $('<div>').addClass(settings.wrapperClass).addClass(classes).addClass(inputMode);
- $control = $('<div>').addClass(settings.inputClass).addClass('items').appendTo($wrapper);
- $control_input = $('<input type="text" autocomplete="off" />').appendTo($control).attr('tabindex', $input.is(':disabled') ? '-1' : self.tabIndex);
- $dropdown_parent = $(settings.dropdownParent || $wrapper);
- $dropdown = $('<div>').addClass(settings.dropdownClass).addClass(inputMode).hide().appendTo($dropdown_parent);
- $dropdown_content = $('<div>').addClass(settings.dropdownContentClass).appendTo($dropdown);
-
- if(inputId = $input.attr('id')) {
- $control_input.attr('id', inputId + '-selectized');
- $("label[for='"+inputId+"']").attr('for', inputId + '-selectized');
- }
-
- if(self.settings.copyClassesToDropdown) {
- $dropdown.addClass(classes);
- }
-
- $wrapper.css({
- width: $input[0].style.width
- });
-
- if (self.plugins.names.length) {
- classes_plugins = 'plugin-' + self.plugins.names.join(' plugin-');
- $wrapper.addClass(classes_plugins);
- $dropdown.addClass(classes_plugins);
- }
-
- if ((settings.maxItems === null || settings.maxItems > 1) && self.tagType === TAG_SELECT) {
- $input.attr('multiple', 'multiple');
- }
-
- if (self.settings.placeholder) {
- $control_input.attr('placeholder', settings.placeholder);
- }
-
- // if splitOn was not passed in, construct it from the delimiter to allow pasting universally
- if (!self.settings.splitOn && self.settings.delimiter) {
- var delimiterEscaped = self.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
- self.settings.splitOn = new RegExp('\\s*' + delimiterEscaped + '+\\s*');
- }
-
- if ($input.attr('autocorrect')) {
- $control_input.attr('autocorrect', $input.attr('autocorrect'));
- }
-
- if ($input.attr('autocapitalize')) {
- $control_input.attr('autocapitalize', $input.attr('autocapitalize'));
- }
- $control_input[0].type = $input[0].type;
-
- self.$wrapper = $wrapper;
- self.$control = $control;
- self.$control_input = $control_input;
- self.$dropdown = $dropdown;
- self.$dropdown_content = $dropdown_content;
-
- $dropdown.on('mouseenter mousedown click', '[data-disabled]>[data-selectable]', function(e) { e.stopImmediatePropagation(); });
- $dropdown.on('mouseenter', '[data-selectable]', function() { return self.onOptionHover.apply(self, arguments); });
- $dropdown.on('mousedown click', '[data-selectable]', function() { return self.onOptionSelect.apply(self, arguments); });
- watchChildEvent($control, 'mousedown', '*:not(input)', function() { return self.onItemSelect.apply(self, arguments); });
- autoGrow($control_input);
-
- $control.on({
- mousedown : function() { return self.onMouseDown.apply(self, arguments); },
- click : function() { return self.onClick.apply(self, arguments); }
- });
-
- $control_input.on({
- mousedown : function(e) { e.stopPropagation(); },
- keydown : function() { return self.onKeyDown.apply(self, arguments); },
- keyup : function() { return self.onKeyUp.apply(self, arguments); },
- keypress : function() { return self.onKeyPress.apply(self, arguments); },
- resize : function() { self.positionDropdown.apply(self, []); },
- blur : function() { return self.onBlur.apply(self, arguments); },
- focus : function() { self.ignoreBlur = false; return self.onFocus.apply(self, arguments); },
- paste : function() { return self.onPaste.apply(self, arguments); }
- });
-
- $document.on('keydown' + eventNS, function(e) {
- self.isCmdDown = e[IS_MAC ? 'metaKey' : 'ctrlKey'];
- self.isCtrlDown = e[IS_MAC ? 'altKey' : 'ctrlKey'];
- self.isShiftDown = e.shiftKey;
- });
-
- $document.on('keyup' + eventNS, function(e) {
- if (e.keyCode === KEY_CTRL) self.isCtrlDown = false;
- if (e.keyCode === KEY_SHIFT) self.isShiftDown = false;
- if (e.keyCode === KEY_CMD) self.isCmdDown = false;
- });
-
- $document.on('mousedown' + eventNS, function(e) {
- if (self.isFocused) {
- // prevent events on the dropdown scrollbar from causing the control to blur
- if (e.target === self.$dropdown[0] || e.target.parentNode === self.$dropdown[0]) {
- return false;
- }
- // blur on click outside
- if (!self.$control.has(e.target).length && e.target !== self.$control[0]) {
- self.blur(e.target);
- }
- }
- });
-
- $window.on(['scroll' + eventNS, 'resize' + eventNS].join(' '), function() {
- if (self.isOpen) {
- self.positionDropdown.apply(self, arguments);
- }
- });
- $window.on('mousemove' + eventNS, function() {
- self.ignoreHover = false;
- });
-
- // store original children and tab index so that they can be
- // restored when the destroy() method is called.
- this.revertSettings = {
- $children : $input.children().detach(),
- tabindex : $input.attr('tabindex')
- };
-
- $input.attr('tabindex', -1).hide().after(self.$wrapper);
-
- if ($.isArray(settings.items)) {
- self.setValue(settings.items);
- delete settings.items;
- }
-
- // feature detect for the validation API
- if (SUPPORTS_VALIDITY_API) {
- $input.on('invalid' + eventNS, function(e) {
- e.preventDefault();
- self.isInvalid = true;
- self.refreshState();
- });
- }
-
- self.updateOriginalInput();
- self.refreshItems();
- self.refreshState();
- self.updatePlaceholder();
- self.isSetup = true;
-
- if ($input.is(':disabled')) {
- self.disable();
- }
-
- self.on('change', this.onChange);
-
- $input.data('selectize', self);
- $input.addClass('selectized');
- self.trigger('initialize');
-
- // preload options
- if (settings.preload === true) {
- self.onSearchChange('');
- }
-
- },
-
- /**
- * Sets up default rendering functions.
- */
- setupTemplates: function() {
- var self = this;
- var field_label = self.settings.labelField;
- var field_optgroup = self.settings.optgroupLabelField;
-
- var templates = {
- 'optgroup': function(data) {
- return '<div class="optgroup">' + data.html + '</div>';
- },
- 'optgroup_header': function(data, escape) {
- return '<div class="optgroup-header">' + escape(data[field_optgroup]) + '</div>';
- },
- 'option': function(data, escape) {
- return '<div class="option">' + escape(data[field_label]) + '</div>';
- },
- 'item': function(data, escape) {
- return '<div class="item">' + escape(data[field_label]) + '</div>';
- },
- 'option_create': function(data, escape) {
- return '<div class="create">Add <strong>' + escape(data.input) + '</strong>…</div>';
- }
- };
-
- self.settings.render = $.extend({}, templates, self.settings.render);
- },
-
- /**
- * Maps fired events to callbacks provided
- * in the settings used when creating the control.
- */
- setupCallbacks: function() {
- var key, fn, callbacks = {
- 'initialize' : 'onInitialize',
- 'change' : 'onChange',
- 'item_add' : 'onItemAdd',
- 'item_remove' : 'onItemRemove',
- 'clear' : 'onClear',
- 'option_add' : 'onOptionAdd',
- 'option_remove' : 'onOptionRemove',
- 'option_clear' : 'onOptionClear',
- 'optgroup_add' : 'onOptionGroupAdd',
- 'optgroup_remove' : 'onOptionGroupRemove',
- 'optgroup_clear' : 'onOptionGroupClear',
- 'dropdown_open' : 'onDropdownOpen',
- 'dropdown_close' : 'onDropdownClose',
- 'type' : 'onType',
- 'load' : 'onLoad',
- 'focus' : 'onFocus',
- 'blur' : 'onBlur'
- };
-
- for (key in callbacks) {
- if (callbacks.hasOwnProperty(key)) {
- fn = this.settings[callbacks[key]];
- if (fn) this.on(key, fn);
- }
- }
- },
-
- /**
- * Triggered when the main control element
- * has a click event.
- *
- * @param {object} e
- * @return {boolean}
- */
- onClick: function(e) {
- var self = this;
-
- // necessary for mobile webkit devices (manual focus triggering
- // is ignored unless invoked within a click event)
- // also necessary to reopen a dropdown that has been closed by
- // closeAfterSelect
- if (!self.isFocused || !self.isOpen) {
- self.focus();
- e.preventDefault();
- }
- },
-
- /**
- * Triggered when the main control element
- * has a mouse down event.
- *
- * @param {object} e
- * @return {boolean}
- */
- onMouseDown: function(e) {
- var self = this;
- var defaultPrevented = e.isDefaultPrevented();
- var $target = $(e.target);
-
- if (self.isFocused) {
- // retain focus by preventing native handling. if the
- // event target is the input it should not be modified.
- // otherwise, text selection within the input won't work.
- if (e.target !== self.$control_input[0]) {
- if (self.settings.mode === 'single') {
- // toggle dropdown
- self.isOpen ? self.close() : self.open();
- } else if (!defaultPrevented) {
- self.setActiveItem(null);
- }
- return false;
- }
- } else {
- // give control focus
- if (!defaultPrevented) {
- window.setTimeout(function() {
- self.focus();
- }, 0);
- }
- }
- },
-
- /**
- * Triggered when the value of the control has been changed.
- * This should propagate the event to the original DOM
- * input / select element.
- */
- onChange: function() {
- this.$input.trigger('change');
- },
-
- /**
- * Triggered on <input> paste.
- *
- * @param {object} e
- * @returns {boolean}
- */
- onPaste: function(e) {
- var self = this;
-
- if (self.isFull() || self.isInputHidden || self.isLocked) {
- e.preventDefault();
- return;
- }
-
- // If a regex or string is included, this will split the pasted
- // input and create Items for each separate value
- if (self.settings.splitOn) {
-
- // Wait for pasted text to be recognized in value
- setTimeout(function() {
- var pastedText = self.$control_input.val();
- if(!pastedText.match(self.settings.splitOn)){ return }
-
- var splitInput = $.trim(pastedText).split(self.settings.splitOn);
- for (var i = 0, n = splitInput.length; i < n; i++) {
- self.createItem(splitInput[i]);
- }
- }, 0);
- }
- },
-
- /**
- * Triggered on <input> keypress.
- *
- * @param {object} e
- * @returns {boolean}
- */
- onKeyPress: function(e) {
- if (this.isLocked) return e && e.preventDefault();
- var character = String.fromCharCode(e.keyCode || e.which);
- if (this.settings.create && this.settings.mode === 'multi' && character === this.settings.delimiter) {
- this.createItem();
- e.preventDefault();
- return false;
- }
- },
-
- /**
- * Triggered on <input> keydown.
- *
- * @param {object} e
- * @returns {boolean}
- */
- onKeyDown: function(e) {
- var isInput = e.target === this.$control_input[0];
- var self = this;
-
- if (self.isLocked) {
- if (e.keyCode !== KEY_TAB) {
- e.preventDefault();
- }
- return;
- }
-
- switch (e.keyCode) {
- case KEY_A:
- if (self.isCmdDown) {
- self.selectAll();
- return;
- }
- break;
- case KEY_ESC:
- if (self.isOpen) {
- e.preventDefault();
- e.stopPropagation();
- self.close();
- }
- return;
- case KEY_N:
- if (!e.ctrlKey || e.altKey) break;
- case KEY_DOWN:
- if (!self.isOpen && self.hasOptions) {
- self.open();
- } else if (self.$activeOption) {
- self.ignoreHover = true;
- var $next = self.getAdjacentOption(self.$activeOption, 1);
- if ($next.length) self.setActiveOption($next, true, true);
- }
- e.preventDefault();
- return;
- case KEY_P:
- if (!e.ctrlKey || e.altKey) break;
- case KEY_UP:
- if (self.$activeOption) {
- self.ignoreHover = true;
- var $prev = self.getAdjacentOption(self.$activeOption, -1);
- if ($prev.length) self.setActiveOption($prev, true, true);
- }
- e.preventDefault();
- return;
- case KEY_RETURN:
- if (self.isOpen && self.$activeOption) {
- self.onOptionSelect({currentTarget: self.$activeOption});
- e.preventDefault();
- }
- return;
- case KEY_LEFT:
- self.advanceSelection(-1, e);
- return;
- case KEY_RIGHT:
- self.advanceSelection(1, e);
- return;
- case KEY_TAB:
- if (self.settings.selectOnTab && self.isOpen && self.$activeOption) {
- self.onOptionSelect({currentTarget: self.$activeOption});
-
- // Default behaviour is to jump to the next field, we only want this
- // if the current field doesn't accept any more entries
- if (!self.isFull()) {
- e.preventDefault();
- }
- }
- if (self.settings.create && self.createItem()) {
- e.preventDefault();
- }
- return;
- case KEY_BACKSPACE:
- case KEY_DELETE:
- self.deleteSelection(e);
- return;
- }
-
- if ((self.isFull() || self.isInputHidden) && !(IS_MAC ? e.metaKey : e.ctrlKey)) {
- e.preventDefault();
- return;
- }
- },
-
- /**
- * Triggered on <input> keyup.
- *
- * @param {object} e
- * @returns {boolean}
- */
- onKeyUp: function(e) {
- var self = this;
-
- if (self.isLocked) return e && e.preventDefault();
- var value = self.$control_input.val() || '';
- if (self.lastValue !== value) {
- self.lastValue = value;
- self.onSearchChange(value);
- self.refreshOptions();
- self.trigger('type', value);
- }
- },
-
- /**
- * Invokes the user-provide option provider / loader.
- *
- * Note: this function is debounced in the Selectize
- * constructor (by `settings.loadThrottle` milliseconds)
- *
- * @param {string} value
- */
- onSearchChange: function(value) {
- var self = this;
- var fn = self.settings.load;
- if (!fn) return;
- if (self.loadedSearches.hasOwnProperty(value)) return;
- self.loadedSearches[value] = true;
- self.load(function(callback) {
- fn.apply(self, [value, callback]);
- });
- },
-
- /**
- * Triggered on <input> focus.
- *
- * @param {object} e (optional)
- * @returns {boolean}
- */
- onFocus: function(e) {
- var self = this;
- var wasFocused = self.isFocused;
-
- if (self.isDisabled) {
- self.blur();
- e && e.preventDefault();
- return false;
- }
-
- if (self.ignoreFocus) return;
- self.isFocused = true;
- if (self.settings.preload === 'focus') self.onSearchChange('');
-
- if (!wasFocused) self.trigger('focus');
-
- if (!self.$activeItems.length) {
- self.showInput();
- self.setActiveItem(null);
- self.refreshOptions(!!self.settings.openOnFocus);
- }
-
- self.refreshState();
- },
-
- /**
- * Triggered on <input> blur.
- *
- * @param {object} e
- * @param {Element} dest
- */
- onBlur: function(e, dest) {
- var self = this;
- if (!self.isFocused) return;
- self.isFocused = false;
-
- if (self.ignoreFocus) {
- return;
- } else if (!self.ignoreBlur && document.activeElement === self.$dropdown_content[0]) {
- // necessary to prevent IE closing the dropdown when the scrollbar is clicked
- self.ignoreBlur = true;
- self.onFocus(e);
- return;
- }
-
- var deactivate = function() {
- self.close();
- self.setTextboxValue('');
- self.setActiveItem(null);
- self.setActiveOption(null);
- self.setCaret(self.items.length);
- self.refreshState();
-
- // IE11 bug: element still marked as active
- dest && dest.focus && dest.focus();
-
- self.isBlurring = false;
- self.ignoreFocus = false;
- self.trigger('blur');
- };
-
- self.isBlurring = true;
- self.ignoreFocus = true;
- if (self.settings.create && self.settings.createOnBlur) {
- self.createItem(null, false, deactivate);
- } else {
- deactivate();
- }
- },
-
- /**
- * Triggered when the user rolls over
- * an option in the autocomplete dropdown menu.
- *
- * @param {object} e
- * @returns {boolean}
- */
- onOptionHover: function(e) {
- if (this.ignoreHover) return;
- this.setActiveOption(e.currentTarget, false);
- },
-
- /**
- * Triggered when the user clicks on an option
- * in the autocomplete dropdown menu.
- *
- * @param {object} e
- * @returns {boolean}
- */
- onOptionSelect: function(e) {
- var value, $target, $option, self = this;
-
- if (e.preventDefault) {
- e.preventDefault();
- e.stopPropagation();
- }
-
- $target = $(e.currentTarget);
- if ($target.hasClass('create')) {
- self.createItem(null, function() {
- if (self.settings.closeAfterSelect) {
- self.close();
- }
- });
- } else {
- value = $target.attr('data-value');
- if (typeof value !== 'undefined') {
- self.lastQuery = null;
- self.setTextboxValue('');
- self.addItem(value);
- if (self.settings.closeAfterSelect) {
- self.close();
- } else if (!self.settings.hideSelected && e.type && /mouse/.test(e.type)) {
- self.setActiveOption(self.getOption(value));
- }
- }
- }
- },
-
- /**
- * Triggered when the user clicks on an item
- * that has been selected.
- *
- * @param {object} e
- * @returns {boolean}
- */
- onItemSelect: function(e) {
- var self = this;
-
- if (self.isLocked) return;
- if (self.settings.mode === 'multi') {
- e.preventDefault();
- self.setActiveItem(e.currentTarget, e);
- }
- },
-
- /**
- * Invokes the provided method that provides
- * results to a callback---which are then added
- * as options to the control.
- *
- * @param {function} fn
- */
- load: function(fn) {
- var self = this;
- var $wrapper = self.$wrapper.addClass(self.settings.loadingClass);
-
- self.loading++;
- fn.apply(self, [function(results) {
- self.loading = Math.max(self.loading - 1, 0);
- if (results && results.length) {
- self.addOption(results);
- self.refreshOptions(self.isFocused && !self.isInputHidden);
- }
- if (!self.loading) {
- $wrapper.removeClass(self.settings.loadingClass);
- }
- self.trigger('load', results);
- }]);
- },
-
- /**
- * Sets the input field of the control to the specified value.
- *
- * @param {string} value
- */
- setTextboxValue: function(value) {
- var $input = this.$control_input;
- var changed = $input.val() !== value;
- if (changed) {
- $input.val(value).triggerHandler('update');
- this.lastValue = value;
- }
- },
-
- /**
- * Returns the value of the control. If multiple items
- * can be selected (e.g. <select multiple>), this returns
- * an array. If only one item can be selected, this
- * returns a string.
- *
- * @returns {mixed}
- */
- getValue: function() {
- if (this.tagType === TAG_SELECT && this.$input.attr('multiple')) {
- return this.items;
- } else {
- return this.items.join(this.settings.delimiter);
- }
- },
-
- /**
- * Resets the selected items to the given value.
- *
- * @param {mixed} value
- */
- setValue: function(value, silent) {
- var events = silent ? [] : ['change'];
-
- debounce_events(this, events, function() {
- this.clear(silent);
- this.addItems(value, silent);
- });
- },
-
- /**
- * Sets the selected item.
- *
- * @param {object} $item
- * @param {object} e (optional)
- */
- setActiveItem: function($item, e) {
- var self = this;
- var eventName;
- var i, idx, begin, end, item, swap;
- var $last;
-
- if (self.settings.mode === 'single') return;
- $item = $($item);
-
- // clear the active selection
- if (!$item.length) {
- $(self.$activeItems).removeClass('active');
- self.$activeItems = [];
- if (self.isFocused) {
- self.showInput();
- }
- return;
- }
-
- // modify selection
- eventName = e && e.type.toLowerCase();
-
- if (eventName === 'mousedown' && self.isShiftDown && self.$activeItems.length) {
- $last = self.$control.children('.active:last');
- begin = Array.prototype.indexOf.apply(self.$control[0].childNodes, [$last[0]]);
- end = Array.prototype.indexOf.apply(self.$control[0].childNodes, [$item[0]]);
- if (begin > end) {
- swap = begin;
- begin = end;
- end = swap;
- }
- for (i = begin; i <= end; i++) {
- item = self.$control[0].childNodes[i];
- if (self.$activeItems.indexOf(item) === -1) {
- $(item).addClass('active');
- self.$activeItems.push(item);
- }
- }
- e.preventDefault();
- } else if ((eventName === 'mousedown' && self.isCtrlDown) || (eventName === 'keydown' && this.isShiftDown)) {
- if ($item.hasClass('active')) {
- idx = self.$activeItems.indexOf($item[0]);
- self.$activeItems.splice(idx, 1);
- $item.removeClass('active');
- } else {
- self.$activeItems.push($item.addClass('active')[0]);
- }
- } else {
- $(self.$activeItems).removeClass('active');
- self.$activeItems = [$item.addClass('active')[0]];
- }
-
- // ensure control has focus
- self.hideInput();
- if (!this.isFocused) {
- self.focus();
- }
- },
-
- /**
- * Sets the selected item in the dropdown menu
- * of available options.
- *
- * @param {object} $object
- * @param {boolean} scroll
- * @param {boolean} animate
- */
- setActiveOption: function($option, scroll, animate) {
- var height_menu, height_item, y;
- var scroll_top, scroll_bottom;
- var self = this;
-
- if (self.$activeOption) self.$activeOption.removeClass('active');
- self.$activeOption = null;
-
- $option = $($option);
- if (!$option.length) return;
-
- self.$activeOption = $option.addClass('active');
-
- if (scroll || !isset(scroll)) {
-
- height_menu = self.$dropdown_content.height();
- height_item = self.$activeOption.outerHeight(true);
- scroll = self.$dropdown_content.scrollTop() || 0;
- y = self.$activeOption.offset().top - self.$dropdown_content.offset().top + scroll;
- scroll_top = y;
- scroll_bottom = y - height_menu + height_item;
-
- if (y + height_item > height_menu + scroll) {
- self.$dropdown_content.stop().animate({scrollTop: scroll_bottom}, animate ? self.settings.scrollDuration : 0);
- } else if (y < scroll) {
- self.$dropdown_content.stop().animate({scrollTop: scroll_top}, animate ? self.settings.scrollDuration : 0);
- }
-
- }
- },
-
- /**
- * Selects all items (CTRL + A).
- */
- selectAll: function() {
- var self = this;
- if (self.settings.mode === 'single') return;
-
- self.$activeItems = Array.prototype.slice.apply(self.$control.children(':not(input)').addClass('active'));
- if (self.$activeItems.length) {
- self.hideInput();
- self.close();
- }
- self.focus();
- },
-
- /**
- * Hides the input element out of view, while
- * retaining its focus.
- */
- hideInput: function() {
- var self = this;
-
- self.setTextboxValue('');
- self.$control_input.css({opacity: 0, position: 'absolute', left: self.rtl ? 10000 : -10000});
- self.isInputHidden = true;
- },
-
- /**
- * Restores input visibility.
- */
- showInput: function() {
- this.$control_input.css({opacity: 1, position: 'relative', left: 0});
- this.isInputHidden = false;
- },
-
- /**
- * Gives the control focus.
- */
- focus: function() {
- var self = this;
- if (self.isDisabled) return;
-
- self.ignoreFocus = true;
- self.$control_input[0].focus();
- window.setTimeout(function() {
- self.ignoreFocus = false;
- self.onFocus();
- }, 0);
- },
-
- /**
- * Forces the control out of focus.
- *
- * @param {Element} dest
- */
- blur: function(dest) {
- this.$control_input[0].blur();
- this.onBlur(null, dest);
- },
-
- /**
- * Returns a function that scores an object
- * to show how good of a match it is to the
- * provided query.
- *
- * @param {string} query
- * @param {object} options
- * @return {function}
- */
- getScoreFunction: function(query) {
- return this.sifter.getScoreFunction(query, this.getSearchOptions());
- },
-
- /**
- * Returns search options for sifter (the system
- * for scoring and sorting results).
- *
- * @see https://github.com/brianreavis/sifter.js
- * @return {object}
- */
- getSearchOptions: function() {
- var settings = this.settings;
- var sort = settings.sortField;
- if (typeof sort === 'string') {
- sort = [{field: sort}];
- }
-
- return {
- fields : settings.searchField,
- conjunction : settings.searchConjunction,
- sort : sort,
- nesting : settings.nesting
- };
- },
-
- /**
- * Searches through available options and returns
- * a sorted array of matches.
- *
- * Returns an object containing:
- *
- * - query {string}
- * - tokens {array}
- * - total {int}
- * - items {array}
- *
- * @param {string} query
- * @returns {object}
- */
- search: function(query) {
- var i, value, score, result, calculateScore;
- var self = this;
- var settings = self.settings;
- var options = this.getSearchOptions();
-
- // validate user-provided result scoring function
- if (settings.score) {
- calculateScore = self.settings.score.apply(this, [query]);
- if (typeof calculateScore !== 'function') {
- throw new Error('Selectize "score" setting must be a function that returns a function');
- }
- }
-
- // perform search
- if (query !== self.lastQuery) {
- self.lastQuery = query;
- result = self.sifter.search(query, $.extend(options, {score: calculateScore}));
- self.currentResults = result;
- } else {
- result = $.extend(true, {}, self.currentResults);
- }
-
- // filter out selected items
- if (settings.hideSelected) {
- for (i = result.items.length - 1; i >= 0; i--) {
- if (self.items.indexOf(hash_key(result.items[i].id)) !== -1) {
- result.items.splice(i, 1);
- }
- }
- }
-
- return result;
- },
-
- /**
- * Refreshes the list of available options shown
- * in the autocomplete dropdown menu.
- *
- * @param {boolean} triggerDropdown
- */
- refreshOptions: function(triggerDropdown) {
- var i, j, k, n, groups, groups_order, option, option_html, optgroup, optgroups, html, html_children, has_create_option;
- var $active, $active_before, $create;
-
- if (typeof triggerDropdown === 'undefined') {
- triggerDropdown = true;
- }
-
- var self = this;
- var query = $.trim(self.$control_input.val());
- var results = self.search(query);
- var $dropdown_content = self.$dropdown_content;
- var active_before = self.$activeOption && hash_key(self.$activeOption.attr('data-value'));
-
- // build markup
- n = results.items.length;
- if (typeof self.settings.maxOptions === 'number') {
- n = Math.min(n, self.settings.maxOptions);
- }
-
- // render and group available options individually
- groups = {};
- groups_order = [];
-
- for (i = 0; i < n; i++) {
- option = self.options[results.items[i].id];
- option_html = self.render('option', option);
- optgroup = option[self.settings.optgroupField] || '';
- optgroups = $.isArray(optgroup) ? optgroup : [optgroup];
-
- for (j = 0, k = optgroups && optgroups.length; j < k; j++) {
- optgroup = optgroups[j];
- if (!self.optgroups.hasOwnProperty(optgroup)) {
- optgroup = '';
- }
- if (!groups.hasOwnProperty(optgroup)) {
- groups[optgroup] = document.createDocumentFragment();
- groups_order.push(optgroup);
- }
- groups[optgroup].appendChild(option_html);
- }
- }
-
- // sort optgroups
- if (this.settings.lockOptgroupOrder) {
- groups_order.sort(function(a, b) {
- var a_order = self.optgroups[a].$order || 0;
- var b_order = self.optgroups[b].$order || 0;
- return a_order - b_order;
- });
- }
-
- // render optgroup headers & join groups
- html = document.createDocumentFragment();
- for (i = 0, n = groups_order.length; i < n; i++) {
- optgroup = groups_order[i];
- if (self.optgroups.hasOwnProperty(optgroup) && groups[optgroup].childNodes.length) {
- // render the optgroup header and options within it,
- // then pass it to the wrapper template
- html_children = document.createDocumentFragment();
- html_children.appendChild(self.render('optgroup_header', self.optgroups[optgroup]));
- html_children.appendChild(groups[optgroup]);
-
- html.appendChild(self.render('optgroup', $.extend({}, self.optgroups[optgroup], {
- html: domToString(html_children),
- dom: html_children
- })));
- } else {
- html.appendChild(groups[optgroup]);
- }
- }
-
- $dropdown_content.html(html);
-
- // highlight matching terms inline
- if (self.settings.highlight) {
- $dropdown_content.removeHighlight();
- if (results.query.length && results.tokens.length) {
- for (i = 0, n = results.tokens.length; i < n; i++) {
- highlight($dropdown_content, results.tokens[i].regex);
- }
- }
- }
-
- // add "selected" class to selected options
- if (!self.settings.hideSelected) {
- for (i = 0, n = self.items.length; i < n; i++) {
- self.getOption(self.items[i]).addClass('selected');
- }
- }
-
- // add create option
- has_create_option = self.canCreate(query);
- if (has_create_option) {
- $dropdown_content.prepend(self.render('option_create', {input: query}));
- $create = $($dropdown_content[0].childNodes[0]);
- }
-
- // activate
- self.hasOptions = results.items.length > 0 || has_create_option;
- if (self.hasOptions) {
- if (results.items.length > 0) {
- $active_before = active_before && self.getOption(active_before);
- if ($active_before && $active_before.length) {
- $active = $active_before;
- } else if (self.settings.mode === 'single' && self.items.length) {
- $active = self.getOption(self.items[0]);
- }
- if (!$active || !$active.length) {
- if ($create && !self.settings.addPrecedence) {
- $active = self.getAdjacentOption($create, 1);
- } else {
- $active = $dropdown_content.find('[data-selectable]:first');
- }
- }
- } else {
- $active = $create;
- }
- self.setActiveOption($active);
- if (triggerDropdown && !self.isOpen) { self.open(); }
- } else {
- self.setActiveOption(null);
- if (triggerDropdown && self.isOpen) { self.close(); }
- }
- },
-
- /**
- * Adds an available option. If it already exists,
- * nothing will happen. Note: this does not refresh
- * the options list dropdown (use `refreshOptions`
- * for that).
- *
- * Usage:
- *
- * this.addOption(data)
- *
- * @param {object|array} data
- */
- addOption: function(data) {
- var i, n, value, self = this;
-
- if ($.isArray(data)) {
- for (i = 0, n = data.length; i < n; i++) {
- self.addOption(data[i]);
- }
- return;
- }
-
- if (value = self.registerOption(data)) {
- self.userOptions[value] = true;
- self.lastQuery = null;
- self.trigger('option_add', value, data);
- }
- },
-
- /**
- * Registers an option to the pool of options.
- *
- * @param {object} data
- * @return {boolean|string}
- */
- registerOption: function(data) {
- var key = hash_key(data[this.settings.valueField]);
- if (typeof key === 'undefined' || key === null || this.options.hasOwnProperty(key)) return false;
- data.$order = data.$order || ++this.order;
- this.options[key] = data;
- return key;
- },
-
- /**
- * Registers an option group to the pool of option groups.
- *
- * @param {object} data
- * @return {boolean|string}
- */
- registerOptionGroup: function(data) {
- var key = hash_key(data[this.settings.optgroupValueField]);
- if (!key) return false;
-
- data.$order = data.$order || ++this.order;
- this.optgroups[key] = data;
- return key;
- },
-
- /**
- * Registers a new optgroup for options
- * to be bucketed into.
- *
- * @param {string} id
- * @param {object} data
- */
- addOptionGroup: function(id, data) {
- data[this.settings.optgroupValueField] = id;
- if (id = this.registerOptionGroup(data)) {
- this.trigger('optgroup_add', id, data);
- }
- },
-
- /**
- * Removes an existing option group.
- *
- * @param {string} id
- */
- removeOptionGroup: function(id) {
- if (this.optgroups.hasOwnProperty(id)) {
- delete this.optgroups[id];
- this.renderCache = {};
- this.trigger('optgroup_remove', id);
- }
- },
-
- /**
- * Clears all existing option groups.
- */
- clearOptionGroups: function() {
- this.optgroups = {};
- this.renderCache = {};
- this.trigger('optgroup_clear');
- },
-
- /**
- * Updates an option available for selection. If
- * it is visible in the selected items or options
- * dropdown, it will be re-rendered automatically.
- *
- * @param {string} value
- * @param {object} data
- */
- updateOption: function(value, data) {
- var self = this;
- var $item, $item_new;
- var value_new, index_item, cache_items, cache_options, order_old;
-
- value = hash_key(value);
- value_new = hash_key(data[self.settings.valueField]);
-
- // sanity checks
- if (value === null) return;
- if (!self.options.hasOwnProperty(value)) return;
- if (typeof value_new !== 'string') throw new Error('Value must be set in option data');
-
- order_old = self.options[value].$order;
-
- // update references
- if (value_new !== value) {
- delete self.options[value];
- index_item = self.items.indexOf(value);
- if (index_item !== -1) {
- self.items.splice(index_item, 1, value_new);
- }
- }
- data.$order = data.$order || order_old;
- self.options[value_new] = data;
-
- // invalidate render cache
- cache_items = self.renderCache['item'];
- cache_options = self.renderCache['option'];
-
- if (cache_items) {
- delete cache_items[value];
- delete cache_items[value_new];
- }
- if (cache_options) {
- delete cache_options[value];
- delete cache_options[value_new];
- }
-
- // update the item if it's selected
- if (self.items.indexOf(value_new) !== -1) {
- $item = self.getItem(value);
- $item_new = $(self.render('item', data));
- if ($item.hasClass('active')) $item_new.addClass('active');
- $item.replaceWith($item_new);
- }
-
- // invalidate last query because we might have updated the sortField
- self.lastQuery = null;
-
- // update dropdown contents
- if (self.isOpen) {
- self.refreshOptions(false);
- }
- },
-
- /**
- * Removes a single option.
- *
- * @param {string} value
- * @param {boolean} silent
- */
- removeOption: function(value, silent) {
- var self = this;
- value = hash_key(value);
-
- var cache_items = self.renderCache['item'];
- var cache_options = self.renderCache['option'];
- if (cache_items) delete cache_items[value];
- if (cache_options) delete cache_options[value];
-
- delete self.userOptions[value];
- delete self.options[value];
- self.lastQuery = null;
- self.trigger('option_remove', value);
- self.removeItem(value, silent);
- },
-
- /**
- * Clears all options.
- */
- clearOptions: function() {
- var self = this;
-
- self.loadedSearches = {};
- self.userOptions = {};
- self.renderCache = {};
- var options = self.options;
- $.each(self.options, function(key, value) {
- if(self.items.indexOf(key) == -1) {
- delete options[key];
- }
- });
- self.options = self.sifter.items = options;
- self.lastQuery = null;
- self.trigger('option_clear');
- },
-
- /**
- * Returns the jQuery element of the option
- * matching the given value.
- *
- * @param {string} value
- * @returns {object}
- */
- getOption: function(value) {
- return this.getElementWithValue(value, this.$dropdown_content.find('[data-selectable]'));
- },
-
- /**
- * Returns the jQuery element of the next or
- * previous selectable option.
- *
- * @param {object} $option
- * @param {int} direction can be 1 for next or -1 for previous
- * @return {object}
- */
- getAdjacentOption: function($option, direction) {
- var $options = this.$dropdown.find('[data-selectable]');
- var index = $options.index($option) + direction;
-
- return index >= 0 && index < $options.length ? $options.eq(index) : $();
- },
-
- /**
- * Finds the first element with a "data-value" attribute
- * that matches the given value.
- *
- * @param {mixed} value
- * @param {object} $els
- * @return {object}
- */
- getElementWithValue: function(value, $els) {
- value = hash_key(value);
-
- if (typeof value !== 'undefined' && value !== null) {
- for (var i = 0, n = $els.length; i < n; i++) {
- if ($els[i].getAttribute('data-value') === value) {
- return $($els[i]);
- }
- }
- }
-
- return $();
- },
-
- /**
- * Returns the jQuery element of the item
- * matching the given value.
- *
- * @param {string} value
- * @returns {object}
- */
- getItem: function(value) {
- return this.getElementWithValue(value, this.$control.children());
- },
-
- /**
- * "Selects" multiple items at once. Adds them to the list
- * at the current caret position.
- *
- * @param {string} value
- * @param {boolean} silent
- */
- addItems: function(values, silent) {
- this.buffer = document.createDocumentFragment();
-
- var childNodes = this.$control[0].childNodes;
- for (var i = 0; i < childNodes.length; i++) {
- this.buffer.appendChild(childNodes[i]);
- }
-
- var items = $.isArray(values) ? values : [values];
- for (var i = 0, n = items.length; i < n; i++) {
- this.isPending = (i < n - 1);
- this.addItem(items[i], silent);
- }
-
- var control = this.$control[0];
- control.insertBefore(this.buffer, control.firstChild);
-
- this.buffer = null;
- },
-
- /**
- * "Selects" an item. Adds it to the list
- * at the current caret position.
- *
- * @param {string} value
- * @param {boolean} silent
- */
- addItem: function(value, silent) {
- var events = silent ? [] : ['change'];
-
- debounce_events(this, events, function() {
- var $item, $option, $options;
- var self = this;
- var inputMode = self.settings.mode;
- var i, active, value_next, wasFull;
- value = hash_key(value);
-
- if (self.items.indexOf(value) !== -1) {
- if (inputMode === 'single') self.close();
- return;
- }
-
- if (!self.options.hasOwnProperty(value)) return;
- if (inputMode === 'single') self.clear(silent);
- if (inputMode === 'multi' && self.isFull()) return;
-
- $item = $(self.render('item', self.options[value]));
- wasFull = self.isFull();
- self.items.splice(self.caretPos, 0, value);
- self.insertAtCaret($item);
- if (!self.isPending || (!wasFull && self.isFull())) {
- self.refreshState();
- }
-
- if (self.isSetup) {
- $options = self.$dropdown_content.find('[data-selectable]');
-
- // update menu / remove the option (if this is not one item being added as part of series)
- if (!self.isPending) {
- $option = self.getOption(value);
- value_next = self.getAdjacentOption($option, 1).attr('data-value');
- self.refreshOptions(self.isFocused && inputMode !== 'single');
- if (value_next) {
- self.setActiveOption(self.getOption(value_next));
- }
- }
-
- // hide the menu if the maximum number of items have been selected or no options are left
- if (!$options.length || self.isFull()) {
- self.close();
- } else if (!self.isPending) {
- self.positionDropdown();
- }
-
- self.updatePlaceholder();
- self.trigger('item_add', value, $item);
-
- if (!self.isPending) {
- self.updateOriginalInput({silent: silent});
- }
- }
- });
- },
-
- /**
- * Removes the selected item matching
- * the provided value.
- *
- * @param {string} value
- */
- removeItem: function(value, silent) {
- var self = this;
- var $item, i, idx;
-
- $item = (value instanceof $) ? value : self.getItem(value);
- value = hash_key($item.attr('data-value'));
- i = self.items.indexOf(value);
-
- if (i !== -1) {
- $item.remove();
- if ($item.hasClass('active')) {
- idx = self.$activeItems.indexOf($item[0]);
- self.$activeItems.splice(idx, 1);
- }
-
- self.items.splice(i, 1);
- self.lastQuery = null;
- if (!self.settings.persist && self.userOptions.hasOwnProperty(value)) {
- self.removeOption(value, silent);
- }
-
- if (i < self.caretPos) {
- self.setCaret(self.caretPos - 1);
- }
-
- self.refreshState();
- self.updatePlaceholder();
- self.updateOriginalInput({silent: silent});
- self.positionDropdown();
- self.trigger('item_remove', value, $item);
- }
- },
-
- /**
- * Invokes the `create` method provided in the
- * selectize options that should provide the data
- * for the new item, given the user input.
- *
- * Once this completes, it will be added
- * to the item list.
- *
- * @param {string} value
- * @param {boolean} [triggerDropdown]
- * @param {function} [callback]
- * @return {boolean}
- */
- createItem: function(input, triggerDropdown) {
- var self = this;
- var caret = self.caretPos;
- input = input || $.trim(self.$control_input.val() || '');
-
- var callback = arguments[arguments.length - 1];
- if (typeof callback !== 'function') callback = function() {};
-
- if (typeof triggerDropdown !== 'boolean') {
- triggerDropdown = true;
- }
-
- if (!self.canCreate(input)) {
- callback();
- return false;
- }
-
- self.lock();
-
- var setup = (typeof self.settings.create === 'function') ? this.settings.create : function(input) {
- var data = {};
- data[self.settings.labelField] = input;
- data[self.settings.valueField] = input;
- return data;
- };
-
- var create = once(function(data) {
- self.unlock();
-
- if (!data || typeof data !== 'object') return callback();
- var value = hash_key(data[self.settings.valueField]);
- if (typeof value !== 'string') return callback();
-
- self.setTextboxValue('');
- self.addOption(data);
- self.setCaret(caret);
- self.addItem(value);
- self.refreshOptions(triggerDropdown && self.settings.mode !== 'single');
- callback(data);
- });
-
- var output = setup.apply(this, [input, create]);
- if (typeof output !== 'undefined') {
- create(output);
- }
-
- return true;
- },
-
- /**
- * Re-renders the selected item lists.
- */
- refreshItems: function() {
- this.lastQuery = null;
-
- if (this.isSetup) {
- this.addItem(this.items);
- }
-
- this.refreshState();
- this.updateOriginalInput();
- },
-
- /**
- * Updates all state-dependent attributes
- * and CSS classes.
- */
- refreshState: function() {
- this.refreshValidityState();
- this.refreshClasses();
- },
-
- /**
- * Update the `required` attribute of both input and control input.
- *
- * The `required` property needs to be activated on the control input
- * for the error to be displayed at the right place. `required` also
- * needs to be temporarily deactivated on the input since the input is
- * hidden and can't show errors.
- */
- refreshValidityState: function() {
- if (!this.isRequired) return false;
-
- var invalid = !this.items.length;
-
- this.isInvalid = invalid;
- this.$control_input.prop('required', invalid);
- this.$input.prop('required', !invalid);
- },
-
- /**
- * Updates all state-dependent CSS classes.
- */
- refreshClasses: function() {
- var self = this;
- var isFull = self.isFull();
- var isLocked = self.isLocked;
-
- self.$wrapper
- .toggleClass('rtl', self.rtl);
-
- self.$control
- .toggleClass('focus', self.isFocused)
- .toggleClass('disabled', self.isDisabled)
- .toggleClass('required', self.isRequired)
- .toggleClass('invalid', self.isInvalid)
- .toggleClass('locked', isLocked)
- .toggleClass('full', isFull).toggleClass('not-full', !isFull)
- .toggleClass('input-active', self.isFocused && !self.isInputHidden)
- .toggleClass('dropdown-active', self.isOpen)
- .toggleClass('has-options', !$.isEmptyObject(self.options))
- .toggleClass('has-items', self.items.length > 0);
-
- self.$control_input.data('grow', !isFull && !isLocked);
- },
-
- /**
- * Determines whether or not more items can be added
- * to the control without exceeding the user-defined maximum.
- *
- * @returns {boolean}
- */
- isFull: function() {
- return this.settings.maxItems !== null && this.items.length >= this.settings.maxItems;
- },
-
- /**
- * Refreshes the original <select> or <input>
- * element to reflect the current state.
- */
- updateOriginalInput: function(opts) {
- var i, n, options, label, self = this;
- opts = opts || {};
-
- if (self.tagType === TAG_SELECT) {
- options = [];
- for (i = 0, n = self.items.length; i < n; i++) {
- label = self.options[self.items[i]][self.settings.labelField] || '';
- options.push('<option value="' + escape_html(self.items[i]) + '" selected="selected">' + escape_html(label) + '</option>');
- }
- if (!options.length && !this.$input.attr('multiple')) {
- options.push('<option value="" selected="selected"></option>');
- }
- self.$input.html(options.join(''));
- } else {
- self.$input.val(self.getValue());
- self.$input.attr('value',self.$input.val());
- }
-
- if (self.isSetup) {
- if (!opts.silent) {
- self.trigger('change', self.$input.val());
- }
- }
- },
-
- /**
- * Shows/hide the input placeholder depending
- * on if there items in the list already.
- */
- updatePlaceholder: function() {
- if (!this.settings.placeholder) return;
- var $input = this.$control_input;
-
- if (this.items.length) {
- $input.removeAttr('placeholder');
- } else {
- $input.attr('placeholder', this.settings.placeholder);
- }
- $input.triggerHandler('update', {force: true});
- },
-
- /**
- * Shows the autocomplete dropdown containing
- * the available options.
- */
- open: function() {
- var self = this;
-
- if (self.isLocked || self.isOpen || (self.settings.mode === 'multi' && self.isFull())) return;
- self.focus();
- self.isOpen = true;
- self.refreshState();
- self.$dropdown.css({visibility: 'hidden', display: 'block'});
- self.positionDropdown();
- self.$dropdown.css({visibility: 'visible'});
- self.trigger('dropdown_open', self.$dropdown);
- },
-
- /**
- * Closes the autocomplete dropdown menu.
- */
- close: function() {
- var self = this;
- var trigger = self.isOpen;
-
- if (self.settings.mode === 'single' && self.items.length) {
- self.hideInput();
-
- // Do not trigger blur while inside a blur event,
- // this fixes some weird tabbing behavior in FF and IE.
- // See #1164
- if (!self.isBlurring) {
- self.$control_input.blur(); // close keyboard on iOS
- }
- }
-
- self.isOpen = false;
- self.$dropdown.hide();
- self.setActiveOption(null);
- self.refreshState();
-
- if (trigger) self.trigger('dropdown_close', self.$dropdown);
- },
-
- /**
- * Calculates and applies the appropriate
- * position of the dropdown.
- */
- positionDropdown: function() {
- var $control = this.$control;
- var offset = this.settings.dropdownParent === 'body' ? $control.offset() : $control.position();
- offset.top += $control.outerHeight(true);
-
- this.$dropdown.css({
- width : $control[0].getBoundingClientRect().width,
- top : offset.top,
- left : offset.left
- });
- },
-
- /**
- * Resets / clears all selected items
- * from the control.
- *
- * @param {boolean} silent
- */
- clear: function(silent) {
- var self = this;
-
- if (!self.items.length) return;
- self.$control.children(':not(input)').remove();
- self.items = [];
- self.lastQuery = null;
- self.setCaret(0);
- self.setActiveItem(null);
- self.updatePlaceholder();
- self.updateOriginalInput({silent: silent});
- self.refreshState();
- self.showInput();
- self.trigger('clear');
- },
-
- /**
- * A helper method for inserting an element
- * at the current caret position.
- *
- * @param {object} $el
- */
- insertAtCaret: function($el) {
- var caret = Math.min(this.caretPos, this.items.length);
- var el = $el[0];
- var target = this.buffer || this.$control[0];
-
- if (caret === 0) {
- target.insertBefore(el, target.firstChild);
- } else {
- target.insertBefore(el, target.childNodes[caret]);
- }
-
- this.setCaret(caret + 1);
- },
-
- /**
- * Removes the current selected item(s).
- *
- * @param {object} e (optional)
- * @returns {boolean}
- */
- deleteSelection: function(e) {
- var i, n, direction, selection, values, caret, option_select, $option_select, $tail;
- var self = this;
-
- direction = (e && e.keyCode === KEY_BACKSPACE) ? -1 : 1;
- selection = getSelection(self.$control_input[0]);
-
- if (self.$activeOption && !self.settings.hideSelected) {
- option_select = self.getAdjacentOption(self.$activeOption, -1).attr('data-value');
- }
-
- // determine items that will be removed
- values = [];
-
- if (self.$activeItems.length) {
- $tail = self.$control.children('.active:' + (direction > 0 ? 'last' : 'first'));
- caret = self.$control.children(':not(input)').index($tail);
- if (direction > 0) { caret++; }
-
- for (i = 0, n = self.$activeItems.length; i < n; i++) {
- values.push($(self.$activeItems[i]).attr('data-value'));
- }
- if (e) {
- e.preventDefault();
- e.stopPropagation();
- }
- } else if ((self.isFocused || self.settings.mode === 'single') && self.items.length) {
- if (direction < 0 && selection.start === 0 && selection.length === 0) {
- values.push(self.items[self.caretPos - 1]);
- } else if (direction > 0 && selection.start === self.$control_input.val().length) {
- values.push(self.items[self.caretPos]);
- }
- }
-
- // allow the callback to abort
- if (!values.length || (typeof self.settings.onDelete === 'function' && self.settings.onDelete.apply(self, [values]) === false)) {
- return false;
- }
-
- // perform removal
- if (typeof caret !== 'undefined') {
- self.setCaret(caret);
- }
- while (values.length) {
- self.removeItem(values.pop());
- }
-
- self.showInput();
- self.positionDropdown();
- self.refreshOptions(true);
-
- // select previous option
- if (option_select) {
- $option_select = self.getOption(option_select);
- if ($option_select.length) {
- self.setActiveOption($option_select);
- }
- }
-
- return true;
- },
-
- /**
- * Selects the previous / next item (depending
- * on the `direction` argument).
- *
- * > 0 - right
- * < 0 - left
- *
- * @param {int} direction
- * @param {object} e (optional)
- */
- advanceSelection: function(direction, e) {
- var tail, selection, idx, valueLength, cursorAtEdge, $tail;
- var self = this;
-
- if (direction === 0) return;
- if (self.rtl) direction *= -1;
-
- tail = direction > 0 ? 'last' : 'first';
- selection = getSelection(self.$control_input[0]);
-
- if (self.isFocused && !self.isInputHidden) {
- valueLength = self.$control_input.val().length;
- cursorAtEdge = direction < 0
- ? selection.start === 0 && selection.length === 0
- : selection.start === valueLength;
-
- if (cursorAtEdge && !valueLength) {
- self.advanceCaret(direction, e);
- }
- } else {
- $tail = self.$control.children('.active:' + tail);
- if ($tail.length) {
- idx = self.$control.children(':not(input)').index($tail);
- self.setActiveItem(null);
- self.setCaret(direction > 0 ? idx + 1 : idx);
- }
- }
- },
-
- /**
- * Moves the caret left / right.
- *
- * @param {int} direction
- * @param {object} e (optional)
- */
- advanceCaret: function(direction, e) {
- var self = this, fn, $adj;
-
- if (direction === 0) return;
-
- fn = direction > 0 ? 'next' : 'prev';
- if (self.isShiftDown) {
- $adj = self.$control_input[fn]();
- if ($adj.length) {
- self.hideInput();
- self.setActiveItem($adj);
- e && e.preventDefault();
- }
- } else {
- self.setCaret(self.caretPos + direction);
- }
- },
-
- /**
- * Moves the caret to the specified index.
- *
- * @param {int} i
- */
- setCaret: function(i) {
- var self = this;
-
- if (self.settings.mode === 'single') {
- i = self.items.length;
- } else {
- i = Math.max(0, Math.min(self.items.length, i));
- }
-
- if(!self.isPending) {
- // the input must be moved by leaving it in place and moving the
- // siblings, due to the fact that focus cannot be restored once lost
- // on mobile webkit devices
- var j, n, fn, $children, $child;
- $children = self.$control.children(':not(input)');
- for (j = 0, n = $children.length; j < n; j++) {
- $child = $($children[j]).detach();
- if (j < i) {
- self.$control_input.before($child);
- } else {
- self.$control.append($child);
- }
- }
- }
-
- self.caretPos = i;
- },
-
- /**
- * Disables user input on the control. Used while
- * items are being asynchronously created.
- */
- lock: function() {
- this.close();
- this.isLocked = true;
- this.refreshState();
- },
-
- /**
- * Re-enables user input on the control.
- */
- unlock: function() {
- this.isLocked = false;
- this.refreshState();
- },
-
- /**
- * Disables user input on the control completely.
- * While disabled, it cannot receive focus.
- */
- disable: function() {
- var self = this;
- self.$input.prop('disabled', true);
- self.$control_input.prop('disabled', true).prop('tabindex', -1);
- self.isDisabled = true;
- self.lock();
- },
-
- /**
- * Enables the control so that it can respond
- * to focus and user input.
- */
- enable: function() {
- var self = this;
- self.$input.prop('disabled', false);
- self.$control_input.prop('disabled', false).prop('tabindex', self.tabIndex);
- self.isDisabled = false;
- self.unlock();
- },
-
- /**
- * Completely destroys the control and
- * unbinds all event listeners so that it can
- * be garbage collected.
- */
- destroy: function() {
- var self = this;
- var eventNS = self.eventNS;
- var revertSettings = self.revertSettings;
-
- self.trigger('destroy');
- self.off();
- self.$wrapper.remove();
- self.$dropdown.remove();
-
- self.$input
- .html('')
- .append(revertSettings.$children)
- .removeAttr('tabindex')
- .removeClass('selectized')
- .attr({tabindex: revertSettings.tabindex})
- .show();
-
- self.$control_input.removeData('grow');
- self.$input.removeData('selectize');
-
- if (--Selectize.count == 0 && Selectize.$testInput) {
- Selectize.$testInput.remove();
- Selectize.$testInput = undefined;
- }
-
- $(window).off(eventNS);
- $(document).off(eventNS);
- $(document.body).off(eventNS);
-
- delete self.$input[0].selectize;
- },
-
- /**
- * A helper method for rendering "item" and
- * "option" templates, given the data.
- *
- * @param {string} templateName
- * @param {object} data
- * @returns {string}
- */
- render: function(templateName, data) {
- var value, id, label;
- var html = '';
- var cache = false;
- var self = this;
- var regex_tag = /^[\t \r\n]*<([a-z][a-z0-9\-_]*(?:\:[a-z][a-z0-9\-_]*)?)/i;
-
- if (templateName === 'option' || templateName === 'item') {
- value = hash_key(data[self.settings.valueField]);
- cache = !!value;
- }
-
- // pull markup from cache if it exists
- if (cache) {
- if (!isset(self.renderCache[templateName])) {
- self.renderCache[templateName] = {};
- }
- if (self.renderCache[templateName].hasOwnProperty(value)) {
- return self.renderCache[templateName][value];
- }
- }
-
- // render markup
- html = $(self.settings.render[templateName].apply(this, [data, escape_html]));
-
- // add mandatory attributes
- if (templateName === 'option' || templateName === 'option_create') {
- if (!data[self.settings.disabledField]) {
- html.attr('data-selectable', '');
- }
- }
- else if (templateName === 'optgroup') {
- id = data[self.settings.optgroupValueField] || '';
- html.attr('data-group', id);
- if(data[self.settings.disabledField]) {
- html.attr('data-disabled', '');
- }
- }
- if (templateName === 'option' || templateName === 'item') {
- html.attr('data-value', value || '');
- }
-
- // update cache
- if (cache) {
- self.renderCache[templateName][value] = html[0];
- }
-
- return html[0];
- },
-
- /**
- * Clears the render cache for a template. If
- * no template is given, clears all render
- * caches.
- *
- * @param {string} templateName
- */
- clearCache: function(templateName) {
- var self = this;
- if (typeof templateName === 'undefined') {
- self.renderCache = {};
- } else {
- delete self.renderCache[templateName];
- }
- },
-
- /**
- * Determines whether or not to display the
- * create item prompt, given a user input.
- *
- * @param {string} input
- * @return {boolean}
- */
- canCreate: function(input) {
- var self = this;
- if (!self.settings.create) return false;
- var filter = self.settings.createFilter;
- return input.length
- && (typeof filter !== 'function' || filter.apply(self, [input]))
- && (typeof filter !== 'string' || new RegExp(filter).test(input))
- && (!(filter instanceof RegExp) || filter.test(input));
- }
-
- });
-
-
- Selectize.count = 0;
- Selectize.defaults = {
- options: [],
- optgroups: [],
-
- plugins: [],
- delimiter: ',',
- splitOn: null, // regexp or string for splitting up values from a paste command
- persist: true,
- diacritics: true,
- create: false,
- createOnBlur: false,
- createFilter: null,
- highlight: true,
- openOnFocus: true,
- maxOptions: 1000,
- maxItems: null,
- hideSelected: null,
- addPrecedence: false,
- selectOnTab: false,
- preload: false,
- allowEmptyOption: false,
- closeAfterSelect: false,
-
- scrollDuration: 60,
- loadThrottle: 300,
- loadingClass: 'loading',
-
- dataAttr: 'data-data',
- optgroupField: 'optgroup',
- valueField: 'value',
- labelField: 'text',
- disabledField: 'disabled',
- optgroupLabelField: 'label',
- optgroupValueField: 'value',
- lockOptgroupOrder: false,
-
- sortField: '$order',
- searchField: ['text'],
- searchConjunction: 'and',
-
- mode: null,
- wrapperClass: 'selectize-control',
- inputClass: 'selectize-input',
- dropdownClass: 'selectize-dropdown',
- dropdownContentClass: 'selectize-dropdown-content',
-
- dropdownParent: null,
-
- copyClassesToDropdown: true,
-
- /*
- load : null, // function(query, callback) { ... }
- score : null, // function(search) { ... }
- onInitialize : null, // function() { ... }
- onChange : null, // function(value) { ... }
- onItemAdd : null, // function(value, $item) { ... }
- onItemRemove : null, // function(value) { ... }
- onClear : null, // function() { ... }
- onOptionAdd : null, // function(value, data) { ... }
- onOptionRemove : null, // function(value) { ... }
- onOptionClear : null, // function() { ... }
- onOptionGroupAdd : null, // function(id, data) { ... }
- onOptionGroupRemove : null, // function(id) { ... }
- onOptionGroupClear : null, // function() { ... }
- onDropdownOpen : null, // function($dropdown) { ... }
- onDropdownClose : null, // function($dropdown) { ... }
- onType : null, // function(str) { ... }
- onDelete : null, // function(values) { ... }
- */
-
- render: {
- /*
- item: null,
- optgroup: null,
- optgroup_header: null,
- option: null,
- option_create: null
- */
- }
- };
-
-
- $.fn.selectize = function(settings_user) {
- var defaults = $.fn.selectize.defaults;
- var settings = $.extend({}, defaults, settings_user);
- var attr_data = settings.dataAttr;
- var field_label = settings.labelField;
- var field_value = settings.valueField;
- var field_disabled = settings.disabledField;
- var field_optgroup = settings.optgroupField;
- var field_optgroup_label = settings.optgroupLabelField;
- var field_optgroup_value = settings.optgroupValueField;
-
- /**
- * Initializes selectize from a <input type="text"> element.
- *
- * @param {object} $input
- * @param {object} settings_element
- */
- var init_textbox = function($input, settings_element) {
- var i, n, values, option;
-
- var data_raw = $input.attr(attr_data);
-
- if (!data_raw) {
- var value = $.trim($input.val() || '');
- if (!settings.allowEmptyOption && !value.length) return;
- values = value.split(settings.delimiter);
- for (i = 0, n = values.length; i < n; i++) {
- option = {};
- option[field_label] = values[i];
- option[field_value] = values[i];
- settings_element.options.push(option);
- }
- settings_element.items = values;
- } else {
- settings_element.options = JSON.parse(data_raw);
- for (i = 0, n = settings_element.options.length; i < n; i++) {
- settings_element.items.push(settings_element.options[i][field_value]);
- }
- }
- };
-
- /**
- * Initializes selectize from a <select> element.
- *
- * @param {object} $input
- * @param {object} settings_element
- */
- var init_select = function($input, settings_element) {
- var i, n, tagName, $children, order = 0;
- var options = settings_element.options;
- var optionsMap = {};
-
- var readData = function($el) {
- var data = attr_data && $el.attr(attr_data);
- if (typeof data === 'string' && data.length) {
- return JSON.parse(data);
- }
- return null;
- };
-
- var addOption = function($option, group) {
- $option = $($option);
-
- var value = hash_key($option.val());
- if (!value && !settings.allowEmptyOption) return;
-
- // if the option already exists, it's probably been
- // duplicated in another optgroup. in this case, push
- // the current group to the "optgroup" property on the
- // existing option so that it's rendered in both places.
- if (optionsMap.hasOwnProperty(value)) {
- if (group) {
- var arr = optionsMap[value][field_optgroup];
- if (!arr) {
- optionsMap[value][field_optgroup] = group;
- } else if (!$.isArray(arr)) {
- optionsMap[value][field_optgroup] = [arr, group];
- } else {
- arr.push(group);
- }
- }
- return;
- }
-
- var option = readData($option) || {};
- option[field_label] = option[field_label] || $option.text();
- option[field_value] = option[field_value] || value;
- option[field_disabled] = option[field_disabled] || $option.prop('disabled');
- option[field_optgroup] = option[field_optgroup] || group;
-
- optionsMap[value] = option;
- options.push(option);
-
- if ($option.is(':selected')) {
- settings_element.items.push(value);
- }
- };
-
- var addGroup = function($optgroup) {
- var i, n, id, optgroup, $options;
-
- $optgroup = $($optgroup);
- id = $optgroup.attr('label');
-
- if (id) {
- optgroup = readData($optgroup) || {};
- optgroup[field_optgroup_label] = id;
- optgroup[field_optgroup_value] = id;
- optgroup[field_disabled] = $optgroup.prop('disabled');
- settings_element.optgroups.push(optgroup);
- }
-
- $options = $('option', $optgroup);
- for (i = 0, n = $options.length; i < n; i++) {
- addOption($options[i], id);
- }
- };
-
- settings_element.maxItems = $input.attr('multiple') ? null : 1;
-
- $children = $input.children();
- for (i = 0, n = $children.length; i < n; i++) {
- tagName = $children[i].tagName.toLowerCase();
- if (tagName === 'optgroup') {
- addGroup($children[i]);
- } else if (tagName === 'option') {
- addOption($children[i]);
- }
- }
- };
-
- return this.each(function() {
- if (this.selectize) return;
-
- var instance;
- var $input = $(this);
- var tag_name = this.tagName.toLowerCase();
- var placeholder = $input.attr('placeholder') || $input.attr('data-placeholder');
- if (!placeholder && !settings.allowEmptyOption) {
- placeholder = $input.children('option[value=""]').text();
- }
-
- var settings_element = {
- 'placeholder' : placeholder,
- 'options' : [],
- 'optgroups' : [],
- 'items' : []
- };
-
- if (tag_name === 'select') {
- init_select($input, settings_element);
- } else {
- init_textbox($input, settings_element);
- }
-
- instance = new Selectize($input, $.extend(true, {}, defaults, settings_element, settings_user));
- });
- };
-
- $.fn.selectize.defaults = Selectize.defaults;
- $.fn.selectize.support = {
- validity: SUPPORTS_VALIDITY_API
- };
-
-
- Selectize.define('drag_drop', function(options) {
- if (!$.fn.sortable) throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');
- if (this.settings.mode !== 'multi') return;
- var self = this;
-
- self.lock = (function() {
- var original = self.lock;
- return function() {
- var sortable = self.$control.data('sortable');
- if (sortable) sortable.disable();
- return original.apply(self, arguments);
- };
- })();
-
- self.unlock = (function() {
- var original = self.unlock;
- return function() {
- var sortable = self.$control.data('sortable');
- if (sortable) sortable.enable();
- return original.apply(self, arguments);
- };
- })();
-
- self.setup = (function() {
- var original = self.setup;
- return function() {
- original.apply(this, arguments);
-
- var $control = self.$control.sortable({
- items: '[data-value]',
- forcePlaceholderSize: true,
- disabled: self.isLocked,
- start: function(e, ui) {
- ui.placeholder.css('width', ui.helper.css('width'));
- $control.css({overflow: 'visible'});
- },
- stop: function() {
- $control.css({overflow: 'hidden'});
- var active = self.$activeItems ? self.$activeItems.slice() : null;
- var values = [];
- $control.children('[data-value]').each(function() {
- values.push($(this).attr('data-value'));
- });
- self.setValue(values);
- self.setActiveItem(active);
- }
- });
- };
- })();
-
- });
-
- Selectize.define('dropdown_header', function(options) {
- var self = this;
-
- options = $.extend({
- title : 'Untitled',
- headerClass : 'selectize-dropdown-header',
- titleRowClass : 'selectize-dropdown-header-title',
- labelClass : 'selectize-dropdown-header-label',
- closeClass : 'selectize-dropdown-header-close',
-
- html: function(data) {
- return (
- '<div class="' + data.headerClass + '">' +
- '<div class="' + data.titleRowClass + '">' +
- '<span class="' + data.labelClass + '">' + data.title + '</span>' +
- '<a href="javascript:void(0)" class="' + data.closeClass + '">×</a>' +
- '</div>' +
- '</div>'
- );
- }
- }, options);
-
- self.setup = (function() {
- var original = self.setup;
- return function() {
- original.apply(self, arguments);
- self.$dropdown_header = $(options.html(options));
- self.$dropdown.prepend(self.$dropdown_header);
- };
- })();
-
- });
-
- Selectize.define('optgroup_columns', function(options) {
- var self = this;
-
- options = $.extend({
- equalizeWidth : true,
- equalizeHeight : true
- }, options);
-
- this.getAdjacentOption = function($option, direction) {
- var $options = $option.closest('[data-group]').find('[data-selectable]');
- var index = $options.index($option) + direction;
-
- return index >= 0 && index < $options.length ? $options.eq(index) : $();
- };
-
- this.onKeyDown = (function() {
- var original = self.onKeyDown;
- return function(e) {
- var index, $option, $options, $optgroup;
-
- if (this.isOpen && (e.keyCode === KEY_LEFT || e.keyCode === KEY_RIGHT)) {
- self.ignoreHover = true;
- $optgroup = this.$activeOption.closest('[data-group]');
- index = $optgroup.find('[data-selectable]').index(this.$activeOption);
-
- if(e.keyCode === KEY_LEFT) {
- $optgroup = $optgroup.prev('[data-group]');
- } else {
- $optgroup = $optgroup.next('[data-group]');
- }
-
- $options = $optgroup.find('[data-selectable]');
- $option = $options.eq(Math.min($options.length - 1, index));
- if ($option.length) {
- this.setActiveOption($option);
- }
- return;
- }
-
- return original.apply(this, arguments);
- };
- })();
-
- var getScrollbarWidth = function() {
- var div;
- var width = getScrollbarWidth.width;
- var doc = document;
-
- if (typeof width === 'undefined') {
- div = doc.createElement('div');
- div.innerHTML = '<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>';
- div = div.firstChild;
- doc.body.appendChild(div);
- width = getScrollbarWidth.width = div.offsetWidth - div.clientWidth;
- doc.body.removeChild(div);
- }
- return width;
- };
-
- var equalizeSizes = function() {
- var i, n, height_max, width, width_last, width_parent, $optgroups;
-
- $optgroups = $('[data-group]', self.$dropdown_content);
- n = $optgroups.length;
- if (!n || !self.$dropdown_content.width()) return;
-
- if (options.equalizeHeight) {
- height_max = 0;
- for (i = 0; i < n; i++) {
- height_max = Math.max(height_max, $optgroups.eq(i).height());
- }
- $optgroups.css({height: height_max});
- }
-
- if (options.equalizeWidth) {
- width_parent = self.$dropdown_content.innerWidth() - getScrollbarWidth();
- width = Math.round(width_parent / n);
- $optgroups.css({width: width});
- if (n > 1) {
- width_last = width_parent - width * (n - 1);
- $optgroups.eq(n - 1).css({width: width_last});
- }
- }
- };
-
- if (options.equalizeHeight || options.equalizeWidth) {
- hook.after(this, 'positionDropdown', equalizeSizes);
- hook.after(this, 'refreshOptions', equalizeSizes);
- }
-
-
- });
-
- Selectize.define('remove_button', function(options) {
- options = $.extend({
- label : '×',
- title : 'Remove',
- className : 'remove',
- append : true
- }, options);
-
- var singleClose = function(thisRef, options) {
-
- options.className = 'remove-single';
-
- var self = thisRef;
- var html = '<a href="javascript:void(0)" class="' + options.className + '" tabindex="-1" title="' + escape_html(options.title) + '">' + options.label + '</a>';
-
- /**
- * Appends an element as a child (with raw HTML).
- *
- * @param {string} html_container
- * @param {string} html_element
- * @return {string}
- */
- var append = function(html_container, html_element) {
- return $('<span>').append(html_container)
- .append(html_element);
- };
-
- thisRef.setup = (function() {
- var original = self.setup;
- return function() {
- // override the item rendering method to add the button to each
- if (options.append) {
- var id = $(self.$input.context).attr('id');
- var selectizer = $('#'+id);
-
- var render_item = self.settings.render.item;
- self.settings.render.item = function(data) {
- return append(render_item.apply(thisRef, arguments), html);
- };
- }
-
- original.apply(thisRef, arguments);
-
- // add event listener
- thisRef.$control.on('click', '.' + options.className, function(e) {
- e.preventDefault();
- if (self.isLocked) return;
-
- self.clear();
- });
-
- };
- })();
- };
-
- var multiClose = function(thisRef, options) {
-
- var self = thisRef;
- var html = '<a href="javascript:void(0)" class="' + options.className + '" tabindex="-1" title="' + escape_html(options.title) + '">' + options.label + '</a>';
-
- /**
- * Appends an element as a child (with raw HTML).
- *
- * @param {string} html_container
- * @param {string} html_element
- * @return {string}
- */
- var append = function(html_container, html_element) {
- var pos = html_container.search(/(<\/[^>]+>\s*)$/);
- return html_container.substring(0, pos) + html_element + html_container.substring(pos);
- };
-
- thisRef.setup = (function() {
- var original = self.setup;
- return function() {
- // override the item rendering method to add the button to each
- if (options.append) {
- var render_item = self.settings.render.item;
- self.settings.render.item = function(data) {
- return append(render_item.apply(thisRef, arguments), html);
- };
- }
-
- original.apply(thisRef, arguments);
-
- // add event listener
- thisRef.$control.on('click', '.' + options.className, function(e) {
- e.preventDefault();
- if (self.isLocked) return;
-
- var $item = $(e.currentTarget).parent();
- self.setActiveItem($item);
- if (self.deleteSelection()) {
- self.setCaret(self.items.length);
- }
- });
-
- };
- })();
- };
-
- if (this.settings.mode === 'single') {
- singleClose(this, options);
- return;
- } else {
- multiClose(this, options);
- }
- });
-
-
- Selectize.define('restore_on_backspace', function(options) {
- var self = this;
-
- options.text = options.text || function(option) {
- return option[this.settings.labelField];
- };
-
- this.onKeyDown = (function() {
- var original = self.onKeyDown;
- return function(e) {
- var index, option;
- if (e.keyCode === KEY_BACKSPACE && this.$control_input.val() === '' && !this.$activeItems.length) {
- index = this.caretPos - 1;
- if (index >= 0 && index < this.items.length) {
- option = this.options[this.items[index]];
- if (this.deleteSelection(e)) {
- this.setTextboxValue(options.text.apply(this, [option]));
- this.refreshOptions(true);
- }
- e.preventDefault();
- return;
- }
- }
- return original.apply(this, arguments);
- };
- })();
- });
-
- return Selectize;
- }));
- /***/ }),
- /***/ 55069:
- /***/ (function(module, exports, __webpack_require__) {
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
- * sifter.js
- * Copyright (c) 2013 Brian Reavis & contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
- * file except in compliance with the License. You may obtain a copy of the License at:
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
- * ANY KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- *
- * @author Brian Reavis <brian@thirdroute.com>
- */
- (function(root, factory) {
- if (true) {
- !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
- __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
- }(this, function() {
- /**
- * Textually searches arrays and hashes of objects
- * by property (or multiple properties). Designed
- * specifically for autocomplete.
- *
- * @constructor
- * @param {array|object} items
- * @param {object} items
- */
- var Sifter = function(items, settings) {
- this.items = items;
- this.settings = settings || {diacritics: true};
- };
- /**
- * Splits a search string into an array of individual
- * regexps to be used to match results.
- *
- * @param {string} query
- * @returns {array}
- */
- Sifter.prototype.tokenize = function(query) {
- query = trim(String(query || '').toLowerCase());
- if (!query || !query.length) return [];
- var i, n, regex, letter;
- var tokens = [];
- var words = query.split(/ +/);
- for (i = 0, n = words.length; i < n; i++) {
- regex = escape_regex(words[i]);
- if (this.settings.diacritics) {
- for (letter in DIACRITICS) {
- if (DIACRITICS.hasOwnProperty(letter)) {
- regex = regex.replace(new RegExp(letter, 'g'), DIACRITICS[letter]);
- }
- }
- }
- tokens.push({
- string : words[i],
- regex : new RegExp(regex, 'i')
- });
- }
- return tokens;
- };
- /**
- * Iterates over arrays and hashes.
- *
- * ```
- * this.iterator(this.items, function(item, id) {
- * // invoked for each item
- * });
- * ```
- *
- * @param {array|object} object
- */
- Sifter.prototype.iterator = function(object, callback) {
- var iterator;
- if (is_array(object)) {
- iterator = Array.prototype.forEach || function(callback) {
- for (var i = 0, n = this.length; i < n; i++) {
- callback(this[i], i, this);
- }
- };
- } else {
- iterator = function(callback) {
- for (var key in this) {
- if (this.hasOwnProperty(key)) {
- callback(this[key], key, this);
- }
- }
- };
- }
- iterator.apply(object, [callback]);
- };
- /**
- * Returns a function to be used to score individual results.
- *
- * Good matches will have a higher score than poor matches.
- * If an item is not a match, 0 will be returned by the function.
- *
- * @param {object|string} search
- * @param {object} options (optional)
- * @returns {function}
- */
- Sifter.prototype.getScoreFunction = function(search, options) {
- var self, fields, tokens, token_count, nesting;
- self = this;
- search = self.prepareSearch(search, options);
- tokens = search.tokens;
- fields = search.options.fields;
- token_count = tokens.length;
- nesting = search.options.nesting;
- /**
- * Calculates how close of a match the
- * given value is against a search token.
- *
- * @param {mixed} value
- * @param {object} token
- * @return {number}
- */
- var scoreValue = function(value, token) {
- var score, pos;
- if (!value) return 0;
- value = String(value || '');
- pos = value.search(token.regex);
- if (pos === -1) return 0;
- score = token.string.length / value.length;
- if (pos === 0) score += 0.5;
- return score;
- };
- /**
- * Calculates the score of an object
- * against the search query.
- *
- * @param {object} token
- * @param {object} data
- * @return {number}
- */
- var scoreObject = (function() {
- var field_count = fields.length;
- if (!field_count) {
- return function() { return 0; };
- }
- if (field_count === 1) {
- return function(token, data) {
- return scoreValue(getattr(data, fields[0], nesting), token);
- };
- }
- return function(token, data) {
- for (var i = 0, sum = 0; i < field_count; i++) {
- sum += scoreValue(getattr(data, fields[i], nesting), token);
- }
- return sum / field_count;
- };
- })();
- if (!token_count) {
- return function() { return 0; };
- }
- if (token_count === 1) {
- return function(data) {
- return scoreObject(tokens[0], data);
- };
- }
- if (search.options.conjunction === 'and') {
- return function(data) {
- var score;
- for (var i = 0, sum = 0; i < token_count; i++) {
- score = scoreObject(tokens[i], data);
- if (score <= 0) return 0;
- sum += score;
- }
- return sum / token_count;
- };
- } else {
- return function(data) {
- for (var i = 0, sum = 0; i < token_count; i++) {
- sum += scoreObject(tokens[i], data);
- }
- return sum / token_count;
- };
- }
- };
- /**
- * Returns a function that can be used to compare two
- * results, for sorting purposes. If no sorting should
- * be performed, `null` will be returned.
- *
- * @param {string|object} search
- * @param {object} options
- * @return function(a,b)
- */
- Sifter.prototype.getSortFunction = function(search, options) {
- var i, n, self, field, fields, fields_count, multiplier, multipliers, get_field, implicit_score, sort;
- self = this;
- search = self.prepareSearch(search, options);
- sort = (!search.query && options.sort_empty) || options.sort;
- /**
- * Fetches the specified sort field value
- * from a search result item.
- *
- * @param {string} name
- * @param {object} result
- * @return {mixed}
- */
- get_field = function(name, result) {
- if (name === '$score') return result.score;
- return getattr(self.items[result.id], name, options.nesting);
- };
- // parse options
- fields = [];
- if (sort) {
- for (i = 0, n = sort.length; i < n; i++) {
- if (search.query || sort[i].field !== '$score') {
- fields.push(sort[i]);
- }
- }
- }
- // the "$score" field is implied to be the primary
- // sort field, unless it's manually specified
- if (search.query) {
- implicit_score = true;
- for (i = 0, n = fields.length; i < n; i++) {
- if (fields[i].field === '$score') {
- implicit_score = false;
- break;
- }
- }
- if (implicit_score) {
- fields.unshift({field: '$score', direction: 'desc'});
- }
- } else {
- for (i = 0, n = fields.length; i < n; i++) {
- if (fields[i].field === '$score') {
- fields.splice(i, 1);
- break;
- }
- }
- }
- multipliers = [];
- for (i = 0, n = fields.length; i < n; i++) {
- multipliers.push(fields[i].direction === 'desc' ? -1 : 1);
- }
- // build function
- fields_count = fields.length;
- if (!fields_count) {
- return null;
- } else if (fields_count === 1) {
- field = fields[0].field;
- multiplier = multipliers[0];
- return function(a, b) {
- return multiplier * cmp(
- get_field(field, a),
- get_field(field, b)
- );
- };
- } else {
- return function(a, b) {
- var i, result, a_value, b_value, field;
- for (i = 0; i < fields_count; i++) {
- field = fields[i].field;
- result = multipliers[i] * cmp(
- get_field(field, a),
- get_field(field, b)
- );
- if (result) return result;
- }
- return 0;
- };
- }
- };
- /**
- * Parses a search query and returns an object
- * with tokens and fields ready to be populated
- * with results.
- *
- * @param {string} query
- * @param {object} options
- * @returns {object}
- */
- Sifter.prototype.prepareSearch = function(query, options) {
- if (typeof query === 'object') return query;
- options = extend({}, options);
- var option_fields = options.fields;
- var option_sort = options.sort;
- var option_sort_empty = options.sort_empty;
- if (option_fields && !is_array(option_fields)) options.fields = [option_fields];
- if (option_sort && !is_array(option_sort)) options.sort = [option_sort];
- if (option_sort_empty && !is_array(option_sort_empty)) options.sort_empty = [option_sort_empty];
- return {
- options : options,
- query : String(query || '').toLowerCase(),
- tokens : this.tokenize(query),
- total : 0,
- items : []
- };
- };
- /**
- * Searches through all items and returns a sorted array of matches.
- *
- * The `options` parameter can contain:
- *
- * - fields {string|array}
- * - sort {array}
- * - score {function}
- * - filter {bool}
- * - limit {integer}
- *
- * Returns an object containing:
- *
- * - options {object}
- * - query {string}
- * - tokens {array}
- * - total {int}
- * - items {array}
- *
- * @param {string} query
- * @param {object} options
- * @returns {object}
- */
- Sifter.prototype.search = function(query, options) {
- var self = this, value, score, search, calculateScore;
- var fn_sort;
- var fn_score;
- search = this.prepareSearch(query, options);
- options = search.options;
- query = search.query;
- // generate result scoring function
- fn_score = options.score || self.getScoreFunction(search);
- // perform search and sort
- if (query.length) {
- self.iterator(self.items, function(item, id) {
- score = fn_score(item);
- if (options.filter === false || score > 0) {
- search.items.push({'score': score, 'id': id});
- }
- });
- } else {
- self.iterator(self.items, function(item, id) {
- search.items.push({'score': 1, 'id': id});
- });
- }
- fn_sort = self.getSortFunction(search, options);
- if (fn_sort) search.items.sort(fn_sort);
- // apply limits
- search.total = search.items.length;
- if (typeof options.limit === 'number') {
- search.items = search.items.slice(0, options.limit);
- }
- return search;
- };
- // utilities
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- var cmp = function(a, b) {
- if (typeof a === 'number' && typeof b === 'number') {
- return a > b ? 1 : (a < b ? -1 : 0);
- }
- a = asciifold(String(a || ''));
- b = asciifold(String(b || ''));
- if (a > b) return 1;
- if (b > a) return -1;
- return 0;
- };
- var extend = function(a, b) {
- var i, n, k, object;
- for (i = 1, n = arguments.length; i < n; i++) {
- object = arguments[i];
- if (!object) continue;
- for (k in object) {
- if (object.hasOwnProperty(k)) {
- a[k] = object[k];
- }
- }
- }
- return a;
- };
- /**
- * A property getter resolving dot-notation
- * @param {Object} obj The root object to fetch property on
- * @param {String} name The optionally dotted property name to fetch
- * @param {Boolean} nesting Handle nesting or not
- * @return {Object} The resolved property value
- */
- var getattr = function(obj, name, nesting) {
- if (!obj || !name) return;
- if (!nesting) return obj[name];
- var names = name.split(".");
- while(names.length && (obj = obj[names.shift()]));
- return obj;
- };
- var trim = function(str) {
- return (str + '').replace(/^\s+|\s+$|/g, '');
- };
- var escape_regex = function(str) {
- return (str + '').replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
- };
- var is_array = Array.isArray || (typeof $ !== 'undefined' && $.isArray) || function(object) {
- return Object.prototype.toString.call(object) === '[object Array]';
- };
- var DIACRITICS = {
- 'a': '[aḀḁĂăÂâǍǎȺⱥȦȧẠạÄäÀàÁáĀāÃãÅåąĄÃąĄ]',
- 'b': '[b␢βΒB฿𐌁ᛒ]',
- 'c': '[cĆćĈĉČčĊċC̄c̄ÇçḈḉȻȼƇƈɕᴄCc]',
- 'd': '[dĎďḊḋḐḑḌḍḒḓḎḏĐđD̦d̦ƉɖƊɗƋƌᵭᶁᶑȡᴅDdð]',
- 'e': '[eÉéÈèÊêḘḙĚěĔĕẼẽḚḛẺẻĖėËëĒēȨȩĘęᶒɆɇȄȅẾếỀềỄễỂểḜḝḖḗḔḕȆȇẸẹỆệⱸᴇEeɘǝƏƐε]',
- 'f': '[fƑƒḞḟ]',
- 'g': '[gɢ₲ǤǥĜĝĞğĢģƓɠĠġ]',
- 'h': '[hĤĥĦħḨḩẖẖḤḥḢḣɦʰǶƕ]',
- 'i': '[iÍíÌìĬĭÎîǏǐÏïḮḯĨĩĮįĪīỈỉȈȉȊȋỊịḬḭƗɨɨ̆ᵻᶖİiIıɪIi]',
- 'j': '[jȷĴĵɈɉʝɟʲ]',
- 'k': '[kƘƙꝀꝁḰḱǨǩḲḳḴḵκϰ₭]',
- 'l': '[lŁłĽľĻļĹĺḶḷḸḹḼḽḺḻĿŀȽƚⱠⱡⱢɫɬᶅɭȴʟLl]',
- 'n': '[nŃńǸǹŇňÑñṄṅŅņṆṇṊṋṈṉN̈n̈ƝɲȠƞᵰᶇɳȵɴNnŊŋ]',
- 'o': '[oØøÖöÓóÒòÔôǑǒŐőŎŏȮȯỌọƟɵƠơỎỏŌōÕõǪǫȌȍՕօ]',
- 'p': '[pṔṕṖṗⱣᵽƤƥᵱ]',
- 'q': '[qꝖꝗʠɊɋꝘꝙq̃]',
- 'r': '[rŔŕɌɍŘřŖŗṘṙȐȑȒȓṚṛⱤɽ]',
- 's': '[sŚśṠṡṢṣꞨꞩŜŝŠšŞşȘșS̈s̈]',
- 't': '[tŤťṪṫŢţṬṭƮʈȚțṰṱṮṯƬƭ]',
- 'u': '[uŬŭɄʉỤụÜüÚúÙùÛûǓǔŰűŬŭƯưỦủŪūŨũŲųȔȕ∪]',
- 'v': '[vṼṽṾṿƲʋꝞꝟⱱʋ]',
- 'w': '[wẂẃẀẁŴŵẄẅẆẇẈẉ]',
- 'x': '[xẌẍẊẋχ]',
- 'y': '[yÝýỲỳŶŷŸÿỸỹẎẏỴỵɎɏƳƴ]',
- 'z': '[zŹźẐẑŽžŻżẒẓẔẕƵƶ]'
- };
- var asciifold = (function() {
- var i, n, k, chunk;
- var foreignletters = '';
- var lookup = {};
- for (k in DIACRITICS) {
- if (DIACRITICS.hasOwnProperty(k)) {
- chunk = DIACRITICS[k].substring(2, DIACRITICS[k].length - 1);
- foreignletters += chunk;
- for (i = 0, n = chunk.length; i < n; i++) {
- lookup[chunk.charAt(i)] = k;
- }
- }
- }
- var regexp = new RegExp('[' + foreignletters + ']', 'g');
- return function(str) {
- return str.replace(regexp, function(foreignletter) {
- return lookup[foreignletter];
- }).toLowerCase();
- };
- })();
- // export
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- return Sifter;
- }));
- /***/ }),
- /***/ 85766:
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- /**
- * SimpleBar.js - v5.3.6
- * Scrollbars, simpler.
- * https://grsmto.github.io/simplebar/
- *
- * Made by Adrien Denat from a fork by Jonathan Nicol
- * Under MIT License
- */
- !function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof __webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r,i,n,o="object",s=function(t){return t&&t.Math==Math&&t},a=s(typeof globalThis==o&&globalThis)||s(typeof window==o&&window)||s(typeof self==o&&self)||s(typeof t==o&&t)||Function("return this")(),c=function(t){try{return!!t()}catch(t){return!0}},l=!c((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),u={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,h={f:f&&!u.call({1:2},1)?function(t){var e=f(this,t);return!!e&&e.enumerable}:u},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},p={}.toString,v=function(t){return p.call(t).slice(8,-1)},g="".split,b=c((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==v(t)?g.call(t,""):Object(t)}:Object,y=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},m=function(t){return b(y(t))},x=function(t){return"object"==typeof t?null!==t:"function"==typeof t},E=function(t,e){if(!x(t))return t;var r,i;if(e&&"function"==typeof(r=t.toString)&&!x(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!x(i=r.call(t)))return i;if(!e&&"function"==typeof(r=t.toString)&&!x(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")},w={}.hasOwnProperty,S=function(t,e){return w.call(t,e)},O=a.document,k=x(O)&&x(O.createElement),A=function(t){return k?O.createElement(t):{}},T=!l&&!c((function(){return 7!=Object.defineProperty(A("div"),"a",{get:function(){return 7}}).a})),L=Object.getOwnPropertyDescriptor,z={f:l?L:function(t,e){if(t=m(t),e=E(e,!0),T)try{return L(t,e)}catch(t){}if(S(t,e))return d(!h.f.call(t,e),t[e])}},R=function(t){if(!x(t))throw TypeError(String(t)+" is not an object");return t},_=Object.defineProperty,M={f:l?_:function(t,e,r){if(R(t),e=E(e,!0),R(r),T)try{return _(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},C=l?function(t,e,r){return M.f(t,e,d(1,r))}:function(t,e,r){return t[e]=r,t},W=function(t,e){try{C(a,t,e)}catch(r){a[t]=e}return e},j=e((function(t){var e=a["__core-js_shared__"]||W("__core-js_shared__",{});(t.exports=function(t,r){return e[t]||(e[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),N=j("native-function-to-string",Function.toString),I=a.WeakMap,B="function"==typeof I&&/native code/.test(N.call(I)),D=0,P=Math.random(),F=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++D+P).toString(36)},V=j("keys"),X=function(t){return V[t]||(V[t]=F(t))},H={},q=a.WeakMap;if(B){var $=new q,Y=$.get,G=$.has,U=$.set;r=function(t,e){return U.call($,t,e),e},i=function(t){return Y.call($,t)||{}},n=function(t){return G.call($,t)}}else{var Q=X("state");H[Q]=!0,r=function(t,e){return C(t,Q,e),e},i=function(t){return S(t,Q)?t[Q]:{}},n=function(t){return S(t,Q)}}var K={set:r,get:i,has:n,enforce:function(t){return n(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var r;if(!x(e)||(r=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},J=e((function(t){var e=K.get,r=K.enforce,i=String(N).split("toString");j("inspectSource",(function(t){return N.call(t)})),(t.exports=function(t,e,n,o){var s=!!o&&!!o.unsafe,c=!!o&&!!o.enumerable,l=!!o&&!!o.noTargetGet;"function"==typeof n&&("string"!=typeof e||S(n,"name")||C(n,"name",e),r(n).source=i.join("string"==typeof e?e:"")),t!==a?(s?!l&&t[e]&&(c=!0):delete t[e],c?t[e]=n:C(t,e,n)):c?t[e]=n:W(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||N.call(this)}))})),Z=a,tt=function(t){return"function"==typeof t?t:void 0},et=function(t,e){return arguments.length<2?tt(Z[t])||tt(a[t]):Z[t]&&Z[t][e]||a[t]&&a[t][e]},rt=Math.ceil,it=Math.floor,nt=function(t){return isNaN(t=+t)?0:(t>0?it:rt)(t)},ot=Math.min,st=function(t){return t>0?ot(nt(t),9007199254740991):0},at=Math.max,ct=Math.min,lt=function(t){return function(e,r,i){var n,o=m(e),s=st(o.length),a=function(t,e){var r=nt(t);return r<0?at(r+e,0):ct(r,e)}(i,s);if(t&&r!=r){for(;s>a;)if((n=o[a++])!=n)return!0}else for(;s>a;a++)if((t||a in o)&&o[a]===r)return t||a||0;return!t&&-1}},ut={includes:lt(!0),indexOf:lt(!1)}.indexOf,ft=function(t,e){var r,i=m(t),n=0,o=[];for(r in i)!S(H,r)&&S(i,r)&&o.push(r);for(;e.length>n;)S(i,r=e[n++])&&(~ut(o,r)||o.push(r));return o},ht=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],dt=ht.concat("length","prototype"),pt={f:Object.getOwnPropertyNames||function(t){return ft(t,dt)}},vt={f:Object.getOwnPropertySymbols},gt=et("Reflect","ownKeys")||function(t){var e=pt.f(R(t)),r=vt.f;return r?e.concat(r(t)):e},bt=function(t,e){for(var r=gt(e),i=M.f,n=z.f,o=0;o<r.length;o++){var s=r[o];S(t,s)||i(t,s,n(e,s))}},yt=/#|\.prototype\./,mt=function(t,e){var r=Et[xt(t)];return r==St||r!=wt&&("function"==typeof e?c(e):!!e)},xt=mt.normalize=function(t){return String(t).replace(yt,".").toLowerCase()},Et=mt.data={},wt=mt.NATIVE="N",St=mt.POLYFILL="P",Ot=mt,kt=z.f,At=function(t,e){var r,i,n,o,s,c=t.target,l=t.global,u=t.stat;if(r=l?a:u?a[c]||W(c,{}):(a[c]||{}).prototype)for(i in e){if(o=e[i],n=t.noTargetGet?(s=kt(r,i))&&s.value:r[i],!Ot(l?i:c+(u?".":"#")+i,t.forced)&&void 0!==n){if(typeof o==typeof n)continue;bt(o,n)}(t.sham||n&&n.sham)&&C(o,"sham",!0),J(r,i,o,t)}},Tt=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},Lt=function(t,e,r){if(Tt(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,i){return t.call(e,r,i)};case 3:return function(r,i,n){return t.call(e,r,i,n)}}return function(){return t.apply(e,arguments)}},zt=function(t){return Object(y(t))},Rt=Array.isArray||function(t){return"Array"==v(t)},_t=!!Object.getOwnPropertySymbols&&!c((function(){return!String(Symbol())})),Mt=a.Symbol,Ct=j("wks"),Wt=function(t){return Ct[t]||(Ct[t]=_t&&Mt[t]||(_t?Mt:F)("Symbol."+t))},jt=Wt("species"),Nt=function(t,e){var r;return Rt(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!Rt(r.prototype)?x(r)&&null===(r=r[jt])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===e?0:e)},It=[].push,Bt=function(t){var e=1==t,r=2==t,i=3==t,n=4==t,o=6==t,s=5==t||o;return function(a,c,l,u){for(var f,h,d=zt(a),p=b(d),v=Lt(c,l,3),g=st(p.length),y=0,m=u||Nt,x=e?m(a,g):r?m(a,0):void 0;g>y;y++)if((s||y in p)&&(h=v(f=p[y],y,d),t))if(e)x[y]=h;else if(h)switch(t){case 3:return!0;case 5:return f;case 6:return y;case 2:It.call(x,f)}else if(n)return!1;return o?-1:i||n?n:x}},Dt={forEach:Bt(0),map:Bt(1),filter:Bt(2),some:Bt(3),every:Bt(4),find:Bt(5),findIndex:Bt(6)},Pt=function(t,e){var r=[][t];return!r||!c((function(){r.call(null,e||function(){throw 1},1)}))},Ft=Dt.forEach,Vt=Pt("forEach")?function(t){return Ft(this,t,arguments.length>1?arguments[1]:void 0)}:[].forEach;At({target:"Array",proto:!0,forced:[].forEach!=Vt},{forEach:Vt});var Xt={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var Ht in Xt){var qt=a[Ht],$t=qt&&qt.prototype;if($t&&$t.forEach!==Vt)try{C($t,"forEach",Vt)}catch(t){$t.forEach=Vt}}var Yt=!("undefined"==typeof window||!window.document||!window.document.createElement),Gt=Wt("species"),Ut=Dt.filter;At({target:"Array",proto:!0,forced:!function(t){return!c((function(){var e=[];return(e.constructor={})[Gt]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}("filter")},{filter:function(t){return Ut(this,t,arguments.length>1?arguments[1]:void 0)}});var Qt=Object.keys||function(t){return ft(t,ht)},Kt=l?Object.defineProperties:function(t,e){R(t);for(var r,i=Qt(e),n=i.length,o=0;n>o;)M.f(t,r=i[o++],e[r]);return t},Jt=et("document","documentElement"),Zt=X("IE_PROTO"),te=function(){},ee=function(){var t,e=A("iframe"),r=ht.length;for(e.style.display="none",Jt.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),ee=t.F;r--;)delete ee.prototype[ht[r]];return ee()},re=Object.create||function(t,e){var r;return null!==t?(te.prototype=R(t),r=new te,te.prototype=null,r[Zt]=t):r=ee(),void 0===e?r:Kt(r,e)};H[Zt]=!0;var ie=Wt("unscopables"),ne=Array.prototype;null==ne[ie]&&C(ne,ie,re(null));var oe,se,ae,ce=function(t){ne[ie][t]=!0},le={},ue=!c((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),fe=X("IE_PROTO"),he=Object.prototype,de=ue?Object.getPrototypeOf:function(t){return t=zt(t),S(t,fe)?t[fe]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?he:null},pe=Wt("iterator"),ve=!1;[].keys&&("next"in(ae=[].keys())?(se=de(de(ae)))!==Object.prototype&&(oe=se):ve=!0),null==oe&&(oe={}),S(oe,pe)||C(oe,pe,(function(){return this}));var ge={IteratorPrototype:oe,BUGGY_SAFARI_ITERATORS:ve},be=M.f,ye=Wt("toStringTag"),me=function(t,e,r){t&&!S(t=r?t:t.prototype,ye)&&be(t,ye,{configurable:!0,value:e})},xe=ge.IteratorPrototype,Ee=function(){return this},we=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,i){return R(r),function(t){if(!x(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(i),e?t.call(r,i):r.__proto__=i,r}}():void 0),Se=ge.IteratorPrototype,Oe=ge.BUGGY_SAFARI_ITERATORS,ke=Wt("iterator"),Ae=function(){return this},Te=function(t,e,r,i,n,o,s){!function(t,e,r){var i=e+" Iterator";t.prototype=re(xe,{next:d(1,r)}),me(t,i,!1),le[i]=Ee}(r,e,i);var a,c,l,u=function(t){if(t===n&&g)return g;if(!Oe&&t in p)return p[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},f=e+" Iterator",h=!1,p=t.prototype,v=p[ke]||p["@@iterator"]||n&&p[n],g=!Oe&&v||u(n),b="Array"==e&&p.entries||v;if(b&&(a=de(b.call(new t)),Se!==Object.prototype&&a.next&&(de(a)!==Se&&(we?we(a,Se):"function"!=typeof a[ke]&&C(a,ke,Ae)),me(a,f,!0))),"values"==n&&v&&"values"!==v.name&&(h=!0,g=function(){return v.call(this)}),p[ke]!==g&&C(p,ke,g),le[e]=g,n)if(c={values:u("values"),keys:o?g:u("keys"),entries:u("entries")},s)for(l in c)!Oe&&!h&&l in p||J(p,l,c[l]);else At({target:e,proto:!0,forced:Oe||h},c);return c},Le=K.set,ze=K.getterFor("Array Iterator"),Re=Te(Array,"Array",(function(t,e){Le(this,{type:"Array Iterator",target:m(t),index:0,kind:e})}),(function(){var t=ze(this),e=t.target,r=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:i,done:!1}:"values"==r?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values");le.Arguments=le.Array,ce("keys"),ce("values"),ce("entries");var _e=Object.assign,Me=!_e||c((function(){var t={},e={},r=Symbol();return t[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!=_e({},t)[r]||"abcdefghijklmnopqrst"!=Qt(_e({},e)).join("")}))?function(t,e){for(var r=zt(t),i=arguments.length,n=1,o=vt.f,s=h.f;i>n;)for(var a,c=b(arguments[n++]),u=o?Qt(c).concat(o(c)):Qt(c),f=u.length,d=0;f>d;)a=u[d++],l&&!s.call(c,a)||(r[a]=c[a]);return r}:_e;At({target:"Object",stat:!0,forced:Object.assign!==Me},{assign:Me});var Ce=Wt("toStringTag"),We="Arguments"==v(function(){return arguments}()),je=function(t){var e,r,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Ce))?r:We?v(e):"Object"==(i=v(e))&&"function"==typeof e.callee?"Arguments":i},Ne={};Ne[Wt("toStringTag")]="z";var Ie="[object z]"!==String(Ne)?function(){return"[object "+je(this)+"]"}:Ne.toString,Be=Object.prototype;Ie!==Be.toString&&J(Be,"toString",Ie,{unsafe:!0});var De="\t\n\v\f\r \u2028\u2029\ufeff",Pe="["+De+"]",Fe=RegExp("^"+Pe+Pe+"*"),Ve=RegExp(Pe+Pe+"*$"),Xe=function(t){return function(e){var r=String(y(e));return 1&t&&(r=r.replace(Fe,"")),2&t&&(r=r.replace(Ve,"")),r}},He={start:Xe(1),end:Xe(2),trim:Xe(3)}.trim,qe=a.parseInt,$e=/^[+-]?0[Xx]/,Ye=8!==qe(De+"08")||22!==qe(De+"0x16")?function(t,e){var r=He(String(t));return qe(r,e>>>0||($e.test(r)?16:10))}:qe;At({global:!0,forced:parseInt!=Ye},{parseInt:Ye});var Ge=function(t){return function(e,r){var i,n,o=String(y(e)),s=nt(r),a=o.length;return s<0||s>=a?t?"":void 0:(i=o.charCodeAt(s))<55296||i>56319||s+1===a||(n=o.charCodeAt(s+1))<56320||n>57343?t?o.charAt(s):i:t?o.slice(s,s+2):n-56320+(i-55296<<10)+65536}},Ue={codeAt:Ge(!1),charAt:Ge(!0)},Qe=Ue.charAt,Ke=K.set,Je=K.getterFor("String Iterator");Te(String,"String",(function(t){Ke(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=Je(this),r=e.string,i=e.index;return i>=r.length?{value:void 0,done:!0}:(t=Qe(r,i),e.index+=t.length,{value:t,done:!1})}));var Ze=function(t,e,r){for(var i in e)J(t,i,e[i],r);return t},tr=!c((function(){return Object.isExtensible(Object.preventExtensions({}))})),er=e((function(t){var e=M.f,r=F("meta"),i=0,n=Object.isExtensible||function(){return!0},o=function(t){e(t,r,{value:{objectID:"O"+ ++i,weakData:{}}})},s=t.exports={REQUIRED:!1,fastKey:function(t,e){if(!x(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!S(t,r)){if(!n(t))return"F";if(!e)return"E";o(t)}return t[r].objectID},getWeakData:function(t,e){if(!S(t,r)){if(!n(t))return!0;if(!e)return!1;o(t)}return t[r].weakData},onFreeze:function(t){return tr&&s.REQUIRED&&n(t)&&!S(t,r)&&o(t),t}};H[r]=!0})),rr=(er.REQUIRED,er.fastKey,er.getWeakData,er.onFreeze,Wt("iterator")),ir=Array.prototype,nr=Wt("iterator"),or=function(t,e,r,i){try{return i?e(R(r)[0],r[1]):e(r)}catch(e){var n=t.return;throw void 0!==n&&R(n.call(t)),e}},sr=e((function(t){var e=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,r,i,n,o){var s,a,c,l,u,f,h,d=Lt(r,i,n?2:1);if(o)s=t;else{if("function"!=typeof(a=function(t){if(null!=t)return t[nr]||t["@@iterator"]||le[je(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(h=a)&&(le.Array===h||ir[rr]===h)){for(c=0,l=st(t.length);l>c;c++)if((u=n?d(R(f=t[c])[0],f[1]):d(t[c]))&&u instanceof e)return u;return new e(!1)}s=a.call(t)}for(;!(f=s.next()).done;)if((u=or(s,d,f.value,n))&&u instanceof e)return u;return new e(!1)}).stop=function(t){return new e(!0,t)}})),ar=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t},cr=Wt("iterator"),lr=!1;try{var ur=0,fr={next:function(){return{done:!!ur++}},return:function(){lr=!0}};fr[cr]=function(){return this},Array.from(fr,(function(){throw 2}))}catch(t){}var hr=function(t,e,r,i,n){var o=a[t],s=o&&o.prototype,l=o,u=i?"set":"add",f={},h=function(t){var e=s[t];J(s,t,"add"==t?function(t){return e.call(this,0===t?0:t),this}:"delete"==t?function(t){return!(n&&!x(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return n&&!x(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return!(n&&!x(t))&&e.call(this,0===t?0:t)}:function(t,r){return e.call(this,0===t?0:t,r),this})};if(Ot(t,"function"!=typeof o||!(n||s.forEach&&!c((function(){(new o).entries().next()})))))l=r.getConstructor(e,t,i,u),er.REQUIRED=!0;else if(Ot(t,!0)){var d=new l,p=d[u](n?{}:-0,1)!=d,v=c((function(){d.has(1)})),g=function(t,e){if(!e&&!lr)return!1;var r=!1;try{var i={};i[cr]=function(){return{next:function(){return{done:r=!0}}}},t(i)}catch(t){}return r}((function(t){new o(t)})),b=!n&&c((function(){for(var t=new o,e=5;e--;)t[u](e,e);return!t.has(-0)}));g||((l=e((function(e,r){ar(e,l,t);var n=function(t,e,r){var i,n;return we&&"function"==typeof(i=e.constructor)&&i!==r&&x(n=i.prototype)&&n!==r.prototype&&we(t,n),t}(new o,e,l);return null!=r&&sr(r,n[u],n,i),n}))).prototype=s,s.constructor=l),(v||b)&&(h("delete"),h("has"),i&&h("get")),(b||p)&&h(u),n&&s.clear&&delete s.clear}return f[t]=l,At({global:!0,forced:l!=o},f),me(l,t),n||r.setStrong(l,t,i),l},dr=er.getWeakData,pr=K.set,vr=K.getterFor,gr=Dt.find,br=Dt.findIndex,yr=0,mr=function(t){return t.frozen||(t.frozen=new xr)},xr=function(){this.entries=[]},Er=function(t,e){return gr(t.entries,(function(t){return t[0]===e}))};xr.prototype={get:function(t){var e=Er(this,t);if(e)return e[1]},has:function(t){return!!Er(this,t)},set:function(t,e){var r=Er(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=br(this.entries,(function(e){return e[0]===t}));return~e&&this.entries.splice(e,1),!!~e}};var wr={getConstructor:function(t,e,r,i){var n=t((function(t,o){ar(t,n,e),pr(t,{type:e,id:yr++,frozen:void 0}),null!=o&&sr(o,t[i],t,r)})),o=vr(e),s=function(t,e,r){var i=o(t),n=dr(R(e),!0);return!0===n?mr(i).set(e,r):n[i.id]=r,t};return Ze(n.prototype,{delete:function(t){var e=o(this);if(!x(t))return!1;var r=dr(t);return!0===r?mr(e).delete(t):r&&S(r,e.id)&&delete r[e.id]},has:function(t){var e=o(this);if(!x(t))return!1;var r=dr(t);return!0===r?mr(e).has(t):r&&S(r,e.id)}}),Ze(n.prototype,r?{get:function(t){var e=o(this);if(x(t)){var r=dr(t);return!0===r?mr(e).get(t):r?r[e.id]:void 0}},set:function(t,e){return s(this,t,e)}}:{add:function(t){return s(this,t,!0)}}),n}},Sr=(e((function(t){var e,r=K.enforce,i=!a.ActiveXObject&&"ActiveXObject"in a,n=Object.isExtensible,o=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},s=t.exports=hr("WeakMap",o,wr,!0,!0);if(B&&i){e=wr.getConstructor(o,"WeakMap",!0),er.REQUIRED=!0;var c=s.prototype,l=c.delete,u=c.has,f=c.get,h=c.set;Ze(c,{delete:function(t){if(x(t)&&!n(t)){var i=r(this);return i.frozen||(i.frozen=new e),l.call(this,t)||i.frozen.delete(t)}return l.call(this,t)},has:function(t){if(x(t)&&!n(t)){var i=r(this);return i.frozen||(i.frozen=new e),u.call(this,t)||i.frozen.has(t)}return u.call(this,t)},get:function(t){if(x(t)&&!n(t)){var i=r(this);return i.frozen||(i.frozen=new e),u.call(this,t)?f.call(this,t):i.frozen.get(t)}return f.call(this,t)},set:function(t,i){if(x(t)&&!n(t)){var o=r(this);o.frozen||(o.frozen=new e),u.call(this,t)?h.call(this,t,i):o.frozen.set(t,i)}else h.call(this,t,i);return this}})}})),Wt("iterator")),Or=Wt("toStringTag"),kr=Re.values;for(var Ar in Xt){var Tr=a[Ar],Lr=Tr&&Tr.prototype;if(Lr){if(Lr[Sr]!==kr)try{C(Lr,Sr,kr)}catch(t){Lr[Sr]=kr}if(Lr[Or]||C(Lr,Or,Ar),Xt[Ar])for(var zr in Re)if(Lr[zr]!==Re[zr])try{C(Lr,zr,Re[zr])}catch(t){Lr[zr]=Re[zr]}}}var Rr="Expected a function",_r=NaN,Mr="[object Symbol]",Cr=/^\s+|\s+$/g,Wr=/^[-+]0x[0-9a-f]+$/i,jr=/^0b[01]+$/i,Nr=/^0o[0-7]+$/i,Ir=parseInt,Br="object"==typeof t&&t&&t.Object===Object&&t,Dr="object"==typeof self&&self&&self.Object===Object&&self,Pr=Br||Dr||Function("return this")(),Fr=Object.prototype.toString,Vr=Math.max,Xr=Math.min,Hr=function(){return Pr.Date.now()};function qr(t,e,r){var i,n,o,s,a,c,l=0,u=!1,f=!1,h=!0;if("function"!=typeof t)throw new TypeError(Rr);function d(e){var r=i,o=n;return i=n=void 0,l=e,s=t.apply(o,r)}function p(t){var r=t-c;return void 0===c||r>=e||r<0||f&&t-l>=o}function v(){var t=Hr();if(p(t))return g(t);a=setTimeout(v,function(t){var r=e-(t-c);return f?Xr(r,o-(t-l)):r}(t))}function g(t){return a=void 0,h&&i?d(t):(i=n=void 0,s)}function b(){var t=Hr(),r=p(t);if(i=arguments,n=this,c=t,r){if(void 0===a)return function(t){return l=t,a=setTimeout(v,e),u?d(t):s}(c);if(f)return a=setTimeout(v,e),d(c)}return void 0===a&&(a=setTimeout(v,e)),s}return e=Yr(e)||0,$r(r)&&(u=!!r.leading,o=(f="maxWait"in r)?Vr(Yr(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h),b.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=n=a=void 0},b.flush=function(){return void 0===a?s:g(Hr())},b}function $r(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Yr(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&Fr.call(t)==Mr}(t))return _r;if($r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=$r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Cr,"");var r=jr.test(t);return r||Nr.test(t)?Ir(t.slice(2),r?2:8):Wr.test(t)?_r:+t}var Gr=function(t,e,r){var i=!0,n=!0;if("function"!=typeof t)throw new TypeError(Rr);return $r(r)&&(i="leading"in r?!!r.leading:i,n="trailing"in r?!!r.trailing:n),qr(t,e,{leading:i,maxWait:e,trailing:n})},Ur="Expected a function",Qr=NaN,Kr="[object Symbol]",Jr=/^\s+|\s+$/g,Zr=/^[-+]0x[0-9a-f]+$/i,ti=/^0b[01]+$/i,ei=/^0o[0-7]+$/i,ri=parseInt,ii="object"==typeof t&&t&&t.Object===Object&&t,ni="object"==typeof self&&self&&self.Object===Object&&self,oi=ii||ni||Function("return this")(),si=Object.prototype.toString,ai=Math.max,ci=Math.min,li=function(){return oi.Date.now()};function ui(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function fi(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&si.call(t)==Kr}(t))return Qr;if(ui(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ui(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Jr,"");var r=ti.test(t);return r||ei.test(t)?ri(t.slice(2),r?2:8):Zr.test(t)?Qr:+t}var hi=function(t,e,r){var i,n,o,s,a,c,l=0,u=!1,f=!1,h=!0;if("function"!=typeof t)throw new TypeError(Ur);function d(e){var r=i,o=n;return i=n=void 0,l=e,s=t.apply(o,r)}function p(t){var r=t-c;return void 0===c||r>=e||r<0||f&&t-l>=o}function v(){var t=li();if(p(t))return g(t);a=setTimeout(v,function(t){var r=e-(t-c);return f?ci(r,o-(t-l)):r}(t))}function g(t){return a=void 0,h&&i?d(t):(i=n=void 0,s)}function b(){var t=li(),r=p(t);if(i=arguments,n=this,c=t,r){if(void 0===a)return function(t){return l=t,a=setTimeout(v,e),u?d(t):s}(c);if(f)return a=setTimeout(v,e),d(c)}return void 0===a&&(a=setTimeout(v,e)),s}return e=fi(e)||0,ui(r)&&(u=!!r.leading,o=(f="maxWait"in r)?ai(fi(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h),b.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=n=a=void 0},b.flush=function(){return void 0===a?s:g(li())},b},di="Expected a function",pi="__lodash_hash_undefined__",vi="[object Function]",gi="[object GeneratorFunction]",bi=/^\[object .+?Constructor\]$/,yi="object"==typeof t&&t&&t.Object===Object&&t,mi="object"==typeof self&&self&&self.Object===Object&&self,xi=yi||mi||Function("return this")();var Ei=Array.prototype,wi=Function.prototype,Si=Object.prototype,Oi=xi["__core-js_shared__"],ki=function(){var t=/[^.]+$/.exec(Oi&&Oi.keys&&Oi.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ai=wi.toString,Ti=Si.hasOwnProperty,Li=Si.toString,zi=RegExp("^"+Ai.call(Ti).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ri=Ei.splice,_i=Di(xi,"Map"),Mi=Di(Object,"create");function Ci(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Wi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function ji(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Ni(t,e){for(var r,i,n=t.length;n--;)if((r=t[n][0])===(i=e)||r!=r&&i!=i)return n;return-1}function Ii(t){return!(!Fi(t)||(e=t,ki&&ki in e))&&(function(t){var e=Fi(t)?Li.call(t):"";return e==vi||e==gi}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?zi:bi).test(function(t){if(null!=t){try{return Ai.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function Bi(t,e){var r,i,n=t.__data__;return("string"==(i=typeof(r=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?n["string"==typeof e?"string":"hash"]:n.map}function Di(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Ii(r)?r:void 0}function Pi(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(di);var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var s=t.apply(this,i);return r.cache=o.set(n,s),s};return r.cache=new(Pi.Cache||ji),r}function Fi(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}Ci.prototype.clear=function(){this.__data__=Mi?Mi(null):{}},Ci.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Ci.prototype.get=function(t){var e=this.__data__;if(Mi){var r=e[t];return r===pi?void 0:r}return Ti.call(e,t)?e[t]:void 0},Ci.prototype.has=function(t){var e=this.__data__;return Mi?void 0!==e[t]:Ti.call(e,t)},Ci.prototype.set=function(t,e){return this.__data__[t]=Mi&&void 0===e?pi:e,this},Wi.prototype.clear=function(){this.__data__=[]},Wi.prototype.delete=function(t){var e=this.__data__,r=Ni(e,t);return!(r<0)&&(r==e.length-1?e.pop():Ri.call(e,r,1),!0)},Wi.prototype.get=function(t){var e=this.__data__,r=Ni(e,t);return r<0?void 0:e[r][1]},Wi.prototype.has=function(t){return Ni(this.__data__,t)>-1},Wi.prototype.set=function(t,e){var r=this.__data__,i=Ni(r,t);return i<0?r.push([t,e]):r[i][1]=e,this},ji.prototype.clear=function(){this.__data__={hash:new Ci,map:new(_i||Wi),string:new Ci}},ji.prototype.delete=function(t){return Bi(this,t).delete(t)},ji.prototype.get=function(t){return Bi(this,t).get(t)},ji.prototype.has=function(t){return Bi(this,t).has(t)},ji.prototype.set=function(t,e){return Bi(this,t).set(t,e),this},Pi.Cache=ji;var Vi,Xi=Pi,Hi=[],qi="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Vi||(Vi={}));var $i,Yi=function(t){return Object.freeze(t)},Gi=function(t,e){this.inlineSize=t,this.blockSize=e,Yi(this)},Ui=function(){function t(t,e,r,i){return this.x=t,this.y=e,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Yi(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Qi=function(t){return t instanceof SVGElement&&"getBBox"in t},Ki=function(t){if(Qi(t)){var e=t.getBBox(),r=e.width,i=e.height;return!r&&!i}var n=t,o=n.offsetWidth,s=n.offsetHeight;return!(o||s||t.getClientRects().length)},Ji=function(t){var e,r;if(t instanceof Element)return!0;var i=null===(r=null===(e=t)||void 0===e?void 0:e.ownerDocument)||void 0===r?void 0:r.defaultView;return!!(i&&t instanceof i.Element)},Zi="undefined"!=typeof window?window:{},tn=new WeakMap,en=/auto|scroll/,rn=/^tb|vertical/,nn=/msie|trident/i.test(Zi.navigator&&Zi.navigator.userAgent),on=function(t){return parseFloat(t||"0")},sn=function(t,e,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=!1),new Gi((r?e:t)||0,(r?t:e)||0)},an=Yi({devicePixelContentBoxSize:sn(),borderBoxSize:sn(),contentBoxSize:sn(),contentRect:new Ui(0,0,0,0)}),cn=function(t,e){if(void 0===e&&(e=!1),tn.has(t)&&!e)return tn.get(t);if(Ki(t))return tn.set(t,an),an;var r=getComputedStyle(t),i=Qi(t)&&t.ownerSVGElement&&t.getBBox(),n=!nn&&"border-box"===r.boxSizing,o=rn.test(r.writingMode||""),s=!i&&en.test(r.overflowY||""),a=!i&&en.test(r.overflowX||""),c=i?0:on(r.paddingTop),l=i?0:on(r.paddingRight),u=i?0:on(r.paddingBottom),f=i?0:on(r.paddingLeft),h=i?0:on(r.borderTopWidth),d=i?0:on(r.borderRightWidth),p=i?0:on(r.borderBottomWidth),v=f+l,g=c+u,b=(i?0:on(r.borderLeftWidth))+d,y=h+p,m=a?t.offsetHeight-y-t.clientHeight:0,x=s?t.offsetWidth-b-t.clientWidth:0,E=n?v+b:0,w=n?g+y:0,S=i?i.width:on(r.width)-E-x,O=i?i.height:on(r.height)-w-m,k=S+v+x+b,A=O+g+m+y,T=Yi({devicePixelContentBoxSize:sn(Math.round(S*devicePixelRatio),Math.round(O*devicePixelRatio),o),borderBoxSize:sn(k,A,o),contentBoxSize:sn(S,O,o),contentRect:new Ui(f,c,S,O)});return tn.set(t,T),T},ln=function(t,e,r){var i=cn(t,r),n=i.borderBoxSize,o=i.contentBoxSize,s=i.devicePixelContentBoxSize;switch(e){case Vi.DEVICE_PIXEL_CONTENT_BOX:return s;case Vi.BORDER_BOX:return n;default:return o}},un=function(t){var e=cn(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Yi([e.borderBoxSize]),this.contentBoxSize=Yi([e.contentBoxSize]),this.devicePixelContentBoxSize=Yi([e.devicePixelContentBoxSize])},fn=function(t){if(Ki(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},hn=function(){var t=1/0,e=[];Hi.forEach((function(r){if(0!==r.activeTargets.length){var i=[];r.activeTargets.forEach((function(e){var r=new un(e.target),n=fn(e.target);i.push(r),e.lastReportedSize=ln(e.target,e.observedBox),n<t&&(t=n)})),e.push((function(){r.callback.call(r.observer,i,r.observer)})),r.activeTargets.splice(0,r.activeTargets.length)}}));for(var r=0,i=e;r<i.length;r++){(0,i[r])()}return t},dn=function(t){Hi.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(r){r.isActive()&&(fn(r.target)>t?e.activeTargets.push(r):e.skippedTargets.push(r))}))}))},pn=function(){var t,e=0;for(dn(e);Hi.some((function(t){return t.activeTargets.length>0}));)e=hn(),dn(e);return Hi.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:qi}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=qi),window.dispatchEvent(t)),e>0},vn=[],gn=function(t){if(!$i){var e=0,r=document.createTextNode("");new MutationObserver((function(){return vn.splice(0).forEach((function(t){return t()}))})).observe(r,{characterData:!0}),$i=function(){r.textContent=""+(e?e--:e++)}}vn.push(t),$i()},bn=0,yn={attributes:!0,characterData:!0,childList:!0,subtree:!0},mn=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],xn=function(t){return void 0===t&&(t=0),Date.now()+t},En=!1,wn=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!En){En=!0;var r,i=xn(t);r=function(){var r=!1;try{r=pn()}finally{if(En=!1,t=i-xn(),!bn)return;r?e.run(1e3):t>0?e.run(t):e.start()}},gn((function(){requestAnimationFrame(r)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,yn)};document.body?e():Zi.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),mn.forEach((function(e){return Zi.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),mn.forEach((function(e){return Zi.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),Sn=function(t){!bn&&t>0&&wn.start(),!(bn+=t)&&wn.stop()},On=function(){function t(t,e){this.target=t,this.observedBox=e||Vi.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=ln(this.target,this.observedBox,!0);return t=this.target,Qi(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),kn=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},An=new WeakMap,Tn=function(t,e){for(var r=0;r<t.length;r+=1)if(t[r].target===e)return r;return-1},Ln=function(){function t(){}return t.connect=function(t,e){var r=new kn(t,e);An.set(t,r)},t.observe=function(t,e,r){var i=An.get(t),n=0===i.observationTargets.length;Tn(i.observationTargets,e)<0&&(n&&Hi.push(i),i.observationTargets.push(new On(e,r&&r.box)),Sn(1),wn.schedule())},t.unobserve=function(t,e){var r=An.get(t),i=Tn(r.observationTargets,e),n=1===r.observationTargets.length;i>=0&&(n&&Hi.splice(Hi.indexOf(r),1),r.observationTargets.splice(i,1),Sn(-1))},t.disconnect=function(t){var e=this,r=An.get(t);r.observationTargets.slice().forEach((function(r){return e.unobserve(t,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},t}(),zn=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ln.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ji(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ln.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ji(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ln.unobserve(this,t)},t.prototype.disconnect=function(){Ln.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}(),Rn=function(t){return function(e,r,i,n){Tt(r);var o=zt(e),s=b(o),a=st(o.length),c=t?a-1:0,l=t?-1:1;if(i<2)for(;;){if(c in s){n=s[c],c+=l;break}if(c+=l,t?c<0:a<=c)throw TypeError("Reduce of empty array with no initial value")}for(;t?c>=0:a>c;c+=l)c in s&&(n=r(n,s[c],c,o));return n}},_n={left:Rn(!1),right:Rn(!0)}.left;At({target:"Array",proto:!0,forced:Pt("reduce")},{reduce:function(t){return _n(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Mn=M.f,Cn=Function.prototype,Wn=Cn.toString,jn=/^\s*function ([^ (]*)/;!l||"name"in Cn||Mn(Cn,"name",{configurable:!0,get:function(){try{return Wn.call(this).match(jn)[1]}catch(t){return""}}});var Nn,In,Bn=function(){var t=R(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},Dn=RegExp.prototype.exec,Pn=String.prototype.replace,Fn=Dn,Vn=(Nn=/a/,In=/b*/g,Dn.call(Nn,"a"),Dn.call(In,"a"),0!==Nn.lastIndex||0!==In.lastIndex),Xn=void 0!==/()??/.exec("")[1];(Vn||Xn)&&(Fn=function(t){var e,r,i,n,o=this;return Xn&&(r=new RegExp("^"+o.source+"$(?!\\s)",Bn.call(o))),Vn&&(e=o.lastIndex),i=Dn.call(o,t),Vn&&i&&(o.lastIndex=o.global?i.index+i[0].length:e),Xn&&i&&i.length>1&&Pn.call(i[0],r,(function(){for(n=1;n<arguments.length-2;n++)void 0===arguments[n]&&(i[n]=void 0)})),i});var Hn=Fn;At({target:"RegExp",proto:!0,forced:/./.exec!==Hn},{exec:Hn});var qn=Wt("species"),$n=!c((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),Yn=!c((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),Gn=function(t,e,r,i){var n=Wt(t),o=!c((function(){var e={};return e[n]=function(){return 7},7!=""[t](e)})),s=o&&!c((function(){var e=!1,r=/a/;return r.exec=function(){return e=!0,null},"split"===t&&(r.constructor={},r.constructor[qn]=function(){return r}),r[n](""),!e}));if(!o||!s||"replace"===t&&!$n||"split"===t&&!Yn){var a=/./[n],l=r(n,""[t],(function(t,e,r,i,n){return e.exec===Hn?o&&!n?{done:!0,value:a.call(e,r,i)}:{done:!0,value:t.call(r,e,i)}:{done:!1}})),u=l[0],f=l[1];J(String.prototype,t,u),J(RegExp.prototype,n,2==e?function(t,e){return f.call(t,this,e)}:function(t){return f.call(t,this)}),i&&C(RegExp.prototype[n],"sham",!0)}},Un=Ue.charAt,Qn=function(t,e,r){return e+(r?Un(t,e).length:1)},Kn=function(t,e){var r=t.exec;if("function"==typeof r){var i=r.call(t,e);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==v(t))throw TypeError("RegExp#exec called on incompatible receiver");return Hn.call(t,e)};Gn("match",1,(function(t,e,r){return[function(e){var r=y(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,r):new RegExp(e)[t](String(r))},function(t){var i=r(e,t,this);if(i.done)return i.value;var n=R(t),o=String(this);if(!n.global)return Kn(n,o);var s=n.unicode;n.lastIndex=0;for(var a,c=[],l=0;null!==(a=Kn(n,o));){var u=String(a[0]);c[l]=u,""===u&&(n.lastIndex=Qn(o,st(n.lastIndex),s)),l++}return 0===l?null:c}]}));var Jn=Math.max,Zn=Math.min,to=Math.floor,eo=/\$([$&'`]|\d\d?|<[^>]*>)/g,ro=/\$([$&'`]|\d\d?)/g;Gn("replace",2,(function(t,e,r){return[function(r,i){var n=y(this),o=null==r?void 0:r[t];return void 0!==o?o.call(r,n,i):e.call(String(n),r,i)},function(t,n){var o=r(e,t,this,n);if(o.done)return o.value;var s=R(t),a=String(this),c="function"==typeof n;c||(n=String(n));var l=s.global;if(l){var u=s.unicode;s.lastIndex=0}for(var f=[];;){var h=Kn(s,a);if(null===h)break;if(f.push(h),!l)break;""===String(h[0])&&(s.lastIndex=Qn(a,st(s.lastIndex),u))}for(var d,p="",v=0,g=0;g<f.length;g++){h=f[g];for(var b=String(h[0]),y=Jn(Zn(nt(h.index),a.length),0),m=[],x=1;x<h.length;x++)m.push(void 0===(d=h[x])?d:String(d));var E=h.groups;if(c){var w=[b].concat(m,y,a);void 0!==E&&w.push(E);var S=String(n.apply(void 0,w))}else S=i(b,a,y,m,E,n);y>=v&&(p+=a.slice(v,y)+S,v=y+b.length)}return p+a.slice(v)}];function i(t,r,i,n,o,s){var a=i+t.length,c=n.length,l=ro;return void 0!==o&&(o=zt(o),l=eo),e.call(s,l,(function(e,s){var l;switch(s.charAt(0)){case"$":return"$";case"&":return t;case"`":return r.slice(0,i);case"'":return r.slice(a);case"<":l=o[s.slice(1,-1)];break;default:var u=+s;if(0===u)return e;if(u>c){var f=to(u/10);return 0===f?e:f<=c?void 0===n[f-1]?s.charAt(1):n[f-1]+s.charAt(1):e}l=n[u-1]}return void 0===l?"":l}))}}));var io=function(t){return Array.prototype.reduce.call(t,(function(t,e){var r=e.name.match(/data-simplebar-(.+)/);if(r){var i=r[1].replace(/\W+(.)/g,(function(t,e){return e.toUpperCase()}));switch(e.value){case"true":t[i]=!0;break;case"false":t[i]=!1;break;case void 0:t[i]=!0;break;default:t[i]=e.value}}return t}),{})};function no(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:window}function oo(t){return t&&t.ownerDocument?t.ownerDocument:document}var so=null,ao=null;function co(t){if(null===so){var e=oo(t);if(void 0===e)return so=0;var r=e.body,i=e.createElement("div");i.classList.add("simplebar-hide-scrollbar"),r.appendChild(i);var n=i.getBoundingClientRect().right;r.removeChild(i),so=n}return so}Yt&&window.addEventListener("resize",(function(){ao!==window.devicePixelRatio&&(ao=window.devicePixelRatio,so=null)}));var lo=function(){function t(e,r){var i=this;this.onScroll=function(){var t=no(i.el);i.scrollXTicking||(t.requestAnimationFrame(i.scrollX),i.scrollXTicking=!0),i.scrollYTicking||(t.requestAnimationFrame(i.scrollY),i.scrollYTicking=!0)},this.scrollX=function(){i.axis.x.isOverflowing&&(i.showScrollbar("x"),i.positionScrollbar("x")),i.scrollXTicking=!1},this.scrollY=function(){i.axis.y.isOverflowing&&(i.showScrollbar("y"),i.positionScrollbar("y")),i.scrollYTicking=!1},this.onMouseEnter=function(){i.showScrollbar("x"),i.showScrollbar("y")},this.onMouseMove=function(t){i.mouseX=t.clientX,i.mouseY=t.clientY,(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseMoveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseMoveForAxis("y")},this.onMouseLeave=function(){i.onMouseMove.cancel(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseLeaveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseLeaveForAxis("y"),i.mouseX=-1,i.mouseY=-1},this.onWindowResize=function(){i.scrollbarWidth=i.getScrollbarWidth(),i.hideNativeScrollbar()},this.hideScrollbars=function(){i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.track.rect)||(i.axis.y.scrollbar.el.classList.remove(i.classNames.visible),i.axis.y.isVisible=!1),i.isWithinBounds(i.axis.x.track.rect)||(i.axis.x.scrollbar.el.classList.remove(i.classNames.visible),i.axis.x.isVisible=!1)},this.onPointerEvent=function(t){var e,r;i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&(e=i.isWithinBounds(i.axis.x.track.rect)),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&(r=i.isWithinBounds(i.axis.y.track.rect)),(e||r)&&(t.preventDefault(),t.stopPropagation(),"mousedown"===t.type&&(e&&(i.axis.x.scrollbar.rect=i.axis.x.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.x.scrollbar.rect)?i.onDragStart(t,"x"):i.onTrackClick(t,"x")),r&&(i.axis.y.scrollbar.rect=i.axis.y.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.scrollbar.rect)?i.onDragStart(t,"y"):i.onTrackClick(t,"y"))))},this.drag=function(e){var r=i.axis[i.draggedAxis].track,n=r.rect[i.axis[i.draggedAxis].sizeAttr],o=i.axis[i.draggedAxis].scrollbar,s=i.contentWrapperEl[i.axis[i.draggedAxis].scrollSizeAttr],a=parseInt(i.elStyles[i.axis[i.draggedAxis].sizeAttr],10);e.preventDefault(),e.stopPropagation();var c=(("y"===i.draggedAxis?e.pageY:e.pageX)-r.rect[i.axis[i.draggedAxis].offsetAttr]-i.axis[i.draggedAxis].dragOffset)/(n-o.size)*(s-a);"x"===i.draggedAxis&&(c=i.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?c-(n+o.size):c,c=i.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-c:c),i.contentWrapperEl[i.axis[i.draggedAxis].scrollOffsetAttr]=c},this.onEndDrag=function(t){var e=oo(i.el),r=no(i.el);t.preventDefault(),t.stopPropagation(),i.el.classList.remove(i.classNames.dragging),e.removeEventListener("mousemove",i.drag,!0),e.removeEventListener("mouseup",i.onEndDrag,!0),i.removePreventClickId=r.setTimeout((function(){e.removeEventListener("click",i.preventClick,!0),e.removeEventListener("dblclick",i.preventClick,!0),i.removePreventClickId=null}))},this.preventClick=function(t){t.preventDefault(),t.stopPropagation()},this.el=e,this.minScrollbarWidth=20,this.options=Object.assign({},t.defaultOptions,{},r),this.classNames=Object.assign({},t.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,t.instances.has(this.el)||(this.recalculate=Gr(this.recalculate.bind(this),64),this.onMouseMove=Gr(this.onMouseMove.bind(this),64),this.hideScrollbars=hi(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=hi(this.onWindowResize.bind(this),64,{leading:!0}),t.getRtlHelpers=Xi(t.getRtlHelpers),this.init())}t.getRtlHelpers=function(){var e=document.createElement("div");e.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var r=e.firstElementChild;document.body.appendChild(r);var i=r.firstElementChild;r.scrollLeft=0;var n=t.getOffset(r),o=t.getOffset(i);r.scrollLeft=999;var s=t.getOffset(i);return{isRtlScrollingInverted:n.left!==o.left&&o.left-s.left!=0,isRtlScrollbarInverted:n.left!==o.left}},t.getOffset=function(t){var e=t.getBoundingClientRect(),r=oo(t),i=no(t);return{top:e.top+(i.pageYOffset||r.documentElement.scrollTop),left:e.left+(i.pageXOffset||r.documentElement.scrollLeft)}};var e=t.prototype;return e.init=function(){t.instances.set(this.el,this),Yt&&(this.initDOM(),this.setAccessibilityAttributes(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},e.initDOM=function(){var t=this;if(Array.prototype.filter.call(this.el.children,(function(e){return e.classList.contains(t.classNames.wrapper)})).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var e=document.createElement("div"),r=document.createElement("div");e.classList.add(this.classNames.track),r.classList.add(this.classNames.scrollbar),e.appendChild(r),this.axis.x.track.el=e.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=e.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},e.setAccessibilityAttributes=function(){var t=this.options.ariaLabel||"scrollable content";this.contentWrapperEl.setAttribute("tabindex","0"),this.contentWrapperEl.setAttribute("role","region"),this.contentWrapperEl.setAttribute("aria-label",t)},e.initListeners=function(){var t=this,e=no(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(e){t.el.addEventListener(e,t.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(e){t.el.addEventListener(e,t.onPointerEvent,{capture:!0,passive:!0})})),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),e.addEventListener("resize",this.onWindowResize);var r=!1,i=e.ResizeObserver||zn;this.resizeObserver=new i((function(){r&&t.recalculate()})),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),e.requestAnimationFrame((function(){r=!0})),this.mutationObserver=new e.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},e.recalculate=function(){var t=no(this.el);this.elStyles=t.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var e=this.heightAutoObserverEl.offsetHeight<=1,r=this.heightAutoObserverEl.offsetWidth<=1,i=this.contentEl.offsetWidth,n=this.contentWrapperEl.offsetWidth,o=this.elStyles.overflowX,s=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var a=this.contentEl.scrollHeight,c=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=e?"auto":"100%",this.placeholderEl.style.width=r?i+"px":"auto",this.placeholderEl.style.height=a+"px";var l=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=c>i,this.axis.y.isOverflowing=a>l,this.axis.x.isOverflowing="hidden"!==o&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==s&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var u=this.axis.x.isOverflowing?this.scrollbarWidth:0,f=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&c>n-f,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&a>l-u,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},e.getScrollbarSize=function(t){if(void 0===t&&(t="y"),!this.axis[t].isOverflowing)return 0;var e,r=this.contentEl[this.axis[t].scrollSizeAttr],i=this.axis[t].track.el[this.axis[t].offsetSizeAttr],n=i/r;return e=Math.max(~~(n*i),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(e=Math.min(e,this.options.scrollbarMaxSize)),e},e.positionScrollbar=function(e){if(void 0===e&&(e="y"),this.axis[e].isOverflowing){var r=this.contentWrapperEl[this.axis[e].scrollSizeAttr],i=this.axis[e].track.el[this.axis[e].offsetSizeAttr],n=parseInt(this.elStyles[this.axis[e].sizeAttr],10),o=this.axis[e].scrollbar,s=this.contentWrapperEl[this.axis[e].scrollOffsetAttr],a=(s="x"===e&&this.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-s:s)/(r-n),c=~~((i-o.size)*a);c="x"===e&&this.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?c+(i-o.size):c,o.el.style.transform="x"===e?"translate3d("+c+"px, 0, 0)":"translate3d(0, "+c+"px, 0)"}},e.toggleTrackVisibility=function(t){void 0===t&&(t="y");var e=this.axis[t].track.el,r=this.axis[t].scrollbar.el;this.axis[t].isOverflowing||this.axis[t].forceVisible?(e.style.visibility="visible",this.contentWrapperEl.style[this.axis[t].overflowAttr]="scroll"):(e.style.visibility="hidden",this.contentWrapperEl.style[this.axis[t].overflowAttr]="hidden"),this.axis[t].isOverflowing?r.style.display="block":r.style.display="none"},e.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},e.onMouseMoveForAxis=function(t){void 0===t&&(t="y"),this.axis[t].track.rect=this.axis[t].track.el.getBoundingClientRect(),this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis[t].scrollbar.rect)?this.axis[t].scrollbar.el.classList.add(this.classNames.hover):this.axis[t].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[t].track.rect)?(this.showScrollbar(t),this.axis[t].track.el.classList.add(this.classNames.hover)):this.axis[t].track.el.classList.remove(this.classNames.hover)},e.onMouseLeaveForAxis=function(t){void 0===t&&(t="y"),this.axis[t].track.el.classList.remove(this.classNames.hover),this.axis[t].scrollbar.el.classList.remove(this.classNames.hover)},e.showScrollbar=function(t){void 0===t&&(t="y");var e=this.axis[t].scrollbar.el;this.axis[t].isVisible||(e.classList.add(this.classNames.visible),this.axis[t].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},e.onDragStart=function(t,e){void 0===e&&(e="y");var r=oo(this.el),i=no(this.el),n=this.axis[e].scrollbar,o="y"===e?t.pageY:t.pageX;this.axis[e].dragOffset=o-n.rect[this.axis[e].offsetAttr],this.draggedAxis=e,this.el.classList.add(this.classNames.dragging),r.addEventListener("mousemove",this.drag,!0),r.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(r.addEventListener("click",this.preventClick,!0),r.addEventListener("dblclick",this.preventClick,!0)):(i.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},e.onTrackClick=function(t,e){var r=this;if(void 0===e&&(e="y"),this.options.clickOnTrack){var i=no(this.el);this.axis[e].scrollbar.rect=this.axis[e].scrollbar.el.getBoundingClientRect();var n=this.axis[e].scrollbar.rect[this.axis[e].offsetAttr],o=parseInt(this.elStyles[this.axis[e].sizeAttr],10),s=this.contentWrapperEl[this.axis[e].scrollOffsetAttr],a=("y"===e?this.mouseY-n:this.mouseX-n)<0?-1:1,c=-1===a?s-o:s+o;!function t(){var n,o;-1===a?s>c&&(s-=r.options.clickOnTrackSpeed,r.contentWrapperEl.scrollTo(((n={})[r.axis[e].offsetAttr]=s,n)),i.requestAnimationFrame(t)):s<c&&(s+=r.options.clickOnTrackSpeed,r.contentWrapperEl.scrollTo(((o={})[r.axis[e].offsetAttr]=s,o)),i.requestAnimationFrame(t))}()}},e.getContentElement=function(){return this.contentEl},e.getScrollElement=function(){return this.contentWrapperEl},e.getScrollbarWidth=function(){try{return"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:co(this.el)}catch(t){return co(this.el)}},e.removeListeners=function(){var t=this,e=no(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(e){t.el.removeEventListener(e,t.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(e){t.el.removeEventListener(e,t.onPointerEvent,{capture:!0,passive:!0})})),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},e.unMount=function(){this.removeListeners(),t.instances.delete(this.el)},e.isWithinBounds=function(t){return this.mouseX>=t.left&&this.mouseX<=t.left+t.width&&this.mouseY>=t.top&&this.mouseY<=t.top+t.height},e.findChild=function(t,e){var r=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;return Array.prototype.filter.call(t.children,(function(t){return r.call(t,e)}))[0]},t}();return lo.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},lo.instances=new WeakMap,lo.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),(function(t){"init"===t.getAttribute("data-simplebar")||lo.instances.has(t)||new lo(t,io(t.attributes))}))},lo.removeObserver=function(){this.globalObserver.disconnect()},lo.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(lo.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))},lo.handleMutations=function(t){t.forEach((function(t){Array.prototype.forEach.call(t.addedNodes,(function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?!lo.instances.has(t)&&document.documentElement.contains(t)&&new lo(t,io(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),(function(t){"init"!==t.getAttribute("data-simplebar")&&!lo.instances.has(t)&&document.documentElement.contains(t)&&new lo(t,io(t.attributes))})))})),Array.prototype.forEach.call(t.removedNodes,(function(t){1===t.nodeType&&("init"===t.getAttribute("data-simplebar")?lo.instances.has(t)&&!document.documentElement.contains(t)&&lo.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-simplebar="init"]'),(function(t){lo.instances.has(t)&&!document.documentElement.contains(t)&&lo.instances.get(t).unMount()})))}))}))},lo.getOptions=io,Yt&&lo.initHtmlApi(),lo}));
- /***/ }),
- /***/ 51474:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* unused harmony exports MultiDrag, Sortable, Swap */
- /**!
- * Sortable 1.14.0
- * @author RubaXa <trash@rubaxa.org>
- * @author owenm <owen23355@gmail.com>
- * @license MIT
- */
- function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- if (enumerableOnly) {
- symbols = symbols.filter(function (sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- });
- }
- keys.push.apply(keys, symbols);
- }
- return keys;
- }
- function _objectSpread2(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
- if (i % 2) {
- ownKeys(Object(source), true).forEach(function (key) {
- _defineProperty(target, key, source[key]);
- });
- } else if (Object.getOwnPropertyDescriptors) {
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
- } else {
- ownKeys(Object(source)).forEach(function (key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- }
- return target;
- }
- function _typeof(obj) {
- "@babel/helpers - typeof";
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
- _typeof = function (obj) {
- return typeof obj;
- };
- } else {
- _typeof = function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- }
- return _typeof(obj);
- }
- 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;
- }
- function _extends() {
- _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;
- };
- return _extends.apply(this, arguments);
- }
- function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
- }
- return target;
- }
- function _objectWithoutProperties(source, excluded) {
- if (source == null) return {};
- var target = _objectWithoutPropertiesLoose(source, excluded);
- var key, i;
- if (Object.getOwnPropertySymbols) {
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
- for (i = 0; i < sourceSymbolKeys.length; i++) {
- key = sourceSymbolKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
- target[key] = source[key];
- }
- }
- return target;
- }
- function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
- }
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
- }
- function _iterableToArray(iter) {
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) return;
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor) n = o.constructor.name;
- if (n === "Map" || n === "Set") return Array.from(o);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
- }
- function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length;
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
- return arr2;
- }
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- var version = "1.14.0";
- function userAgent(pattern) {
- if (typeof window !== 'undefined' && window.navigator) {
- return !! /*@__PURE__*/navigator.userAgent.match(pattern);
- }
- }
- var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
- var Edge = userAgent(/Edge/i);
- var FireFox = userAgent(/firefox/i);
- var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
- var IOS = userAgent(/iP(ad|od|hone)/i);
- var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
- var captureMode = {
- capture: false,
- passive: false
- };
- function on(el, event, fn) {
- el.addEventListener(event, fn, !IE11OrLess && captureMode);
- }
- function off(el, event, fn) {
- el.removeEventListener(event, fn, !IE11OrLess && captureMode);
- }
- function matches(
- /**HTMLElement*/
- el,
- /**String*/
- selector) {
- if (!selector) return;
- selector[0] === '>' && (selector = selector.substring(1));
- if (el) {
- try {
- if (el.matches) {
- return el.matches(selector);
- } else if (el.msMatchesSelector) {
- return el.msMatchesSelector(selector);
- } else if (el.webkitMatchesSelector) {
- return el.webkitMatchesSelector(selector);
- }
- } catch (_) {
- return false;
- }
- }
- return false;
- }
- function getParentOrHost(el) {
- return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
- }
- function closest(
- /**HTMLElement*/
- el,
- /**String*/
- selector,
- /**HTMLElement*/
- ctx, includeCTX) {
- if (el) {
- ctx = ctx || document;
- do {
- if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
- return el;
- }
- if (el === ctx) break;
- /* jshint boss:true */
- } while (el = getParentOrHost(el));
- }
- return null;
- }
- var R_SPACE = /\s+/g;
- function toggleClass(el, name, state) {
- if (el && name) {
- if (el.classList) {
- el.classList[state ? 'add' : 'remove'](name);
- } else {
- var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
- el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
- }
- }
- }
- function css(el, prop, val) {
- var style = el && el.style;
- if (style) {
- if (val === void 0) {
- if (document.defaultView && document.defaultView.getComputedStyle) {
- val = document.defaultView.getComputedStyle(el, '');
- } else if (el.currentStyle) {
- val = el.currentStyle;
- }
- return prop === void 0 ? val : val[prop];
- } else {
- if (!(prop in style) && prop.indexOf('webkit') === -1) {
- prop = '-webkit-' + prop;
- }
- style[prop] = val + (typeof val === 'string' ? '' : 'px');
- }
- }
- }
- function matrix(el, selfOnly) {
- var appliedTransforms = '';
- if (typeof el === 'string') {
- appliedTransforms = el;
- } else {
- do {
- var transform = css(el, 'transform');
- if (transform && transform !== 'none') {
- appliedTransforms = transform + ' ' + appliedTransforms;
- }
- /* jshint boss:true */
- } while (!selfOnly && (el = el.parentNode));
- }
- var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
- /*jshint -W056 */
- return matrixFn && new matrixFn(appliedTransforms);
- }
- function find(ctx, tagName, iterator) {
- if (ctx) {
- var list = ctx.getElementsByTagName(tagName),
- i = 0,
- n = list.length;
- if (iterator) {
- for (; i < n; i++) {
- iterator(list[i], i);
- }
- }
- return list;
- }
- return [];
- }
- function getWindowScrollingElement() {
- var scrollingElement = document.scrollingElement;
- if (scrollingElement) {
- return scrollingElement;
- } else {
- return document.documentElement;
- }
- }
- /**
- * Returns the "bounding client rect" of given element
- * @param {HTMLElement} el The element whose boundingClientRect is wanted
- * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
- * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
- * @param {[Boolean]} undoScale Whether the container's scale() should be undone
- * @param {[HTMLElement]} container The parent the element will be placed in
- * @return {Object} The boundingClientRect of el, with specified adjustments
- */
- function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
- if (!el.getBoundingClientRect && el !== window) return;
- var elRect, top, left, bottom, right, height, width;
- if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
- elRect = el.getBoundingClientRect();
- top = elRect.top;
- left = elRect.left;
- bottom = elRect.bottom;
- right = elRect.right;
- height = elRect.height;
- width = elRect.width;
- } else {
- top = 0;
- left = 0;
- bottom = window.innerHeight;
- right = window.innerWidth;
- height = window.innerHeight;
- width = window.innerWidth;
- }
- if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
- // Adjust for translate()
- container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
- // Not needed on <= IE11
- if (!IE11OrLess) {
- do {
- if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
- var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container
- top -= containerRect.top + parseInt(css(container, 'border-top-width'));
- left -= containerRect.left + parseInt(css(container, 'border-left-width'));
- bottom = top + elRect.height;
- right = left + elRect.width;
- break;
- }
- /* jshint boss:true */
- } while (container = container.parentNode);
- }
- }
- if (undoScale && el !== window) {
- // Adjust for scale()
- var elMatrix = matrix(container || el),
- scaleX = elMatrix && elMatrix.a,
- scaleY = elMatrix && elMatrix.d;
- if (elMatrix) {
- top /= scaleY;
- left /= scaleX;
- width /= scaleX;
- height /= scaleY;
- bottom = top + height;
- right = left + width;
- }
- }
- return {
- top: top,
- left: left,
- bottom: bottom,
- right: right,
- width: width,
- height: height
- };
- }
- /**
- * Checks if a side of an element is scrolled past a side of its parents
- * @param {HTMLElement} el The element who's side being scrolled out of view is in question
- * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
- * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
- * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
- */
- function isScrolledPast(el, elSide, parentSide) {
- var parent = getParentAutoScrollElement(el, true),
- elSideVal = getRect(el)[elSide];
- /* jshint boss:true */
- while (parent) {
- var parentSideVal = getRect(parent)[parentSide],
- visible = void 0;
- if (parentSide === 'top' || parentSide === 'left') {
- visible = elSideVal >= parentSideVal;
- } else {
- visible = elSideVal <= parentSideVal;
- }
- if (!visible) return parent;
- if (parent === getWindowScrollingElement()) break;
- parent = getParentAutoScrollElement(parent, false);
- }
- return false;
- }
- /**
- * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
- * and non-draggable elements
- * @param {HTMLElement} el The parent element
- * @param {Number} childNum The index of the child
- * @param {Object} options Parent Sortable's options
- * @return {HTMLElement} The child at index childNum, or null if not found
- */
- function getChild(el, childNum, options, includeDragEl) {
- var currentChild = 0,
- i = 0,
- children = el.children;
- while (i < children.length) {
- if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
- if (currentChild === childNum) {
- return children[i];
- }
- currentChild++;
- }
- i++;
- }
- return null;
- }
- /**
- * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
- * @param {HTMLElement} el Parent element
- * @param {selector} selector Any other elements that should be ignored
- * @return {HTMLElement} The last child, ignoring ghostEl
- */
- function lastChild(el, selector) {
- var last = el.lastElementChild;
- while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
- last = last.previousElementSibling;
- }
- return last || null;
- }
- /**
- * Returns the index of an element within its parent for a selected set of
- * elements
- * @param {HTMLElement} el
- * @param {selector} selector
- * @return {number}
- */
- function index(el, selector) {
- var index = 0;
- if (!el || !el.parentNode) {
- return -1;
- }
- /* jshint boss:true */
- while (el = el.previousElementSibling) {
- if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
- index++;
- }
- }
- return index;
- }
- /**
- * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
- * The value is returned in real pixels.
- * @param {HTMLElement} el
- * @return {Array} Offsets in the format of [left, top]
- */
- function getRelativeScrollOffset(el) {
- var offsetLeft = 0,
- offsetTop = 0,
- winScroller = getWindowScrollingElement();
- if (el) {
- do {
- var elMatrix = matrix(el),
- scaleX = elMatrix.a,
- scaleY = elMatrix.d;
- offsetLeft += el.scrollLeft * scaleX;
- offsetTop += el.scrollTop * scaleY;
- } while (el !== winScroller && (el = el.parentNode));
- }
- return [offsetLeft, offsetTop];
- }
- /**
- * Returns the index of the object within the given array
- * @param {Array} arr Array that may or may not hold the object
- * @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
- * @return {Number} The index of the object in the array, or -1
- */
- function indexOfObject(arr, obj) {
- for (var i in arr) {
- if (!arr.hasOwnProperty(i)) continue;
- for (var key in obj) {
- if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
- }
- }
- return -1;
- }
- function getParentAutoScrollElement(el, includeSelf) {
- // skip to window
- if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
- var elem = el;
- var gotSelf = false;
- do {
- // we don't need to get elem css if it isn't even overflowing in the first place (performance)
- if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
- var elemCSS = css(elem);
- if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
- if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
- if (gotSelf || includeSelf) return elem;
- gotSelf = true;
- }
- }
- /* jshint boss:true */
- } while (elem = elem.parentNode);
- return getWindowScrollingElement();
- }
- function extend(dst, src) {
- if (dst && src) {
- for (var key in src) {
- if (src.hasOwnProperty(key)) {
- dst[key] = src[key];
- }
- }
- }
- return dst;
- }
- function isRectEqual(rect1, rect2) {
- 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);
- }
- var _throttleTimeout;
- function throttle(callback, ms) {
- return function () {
- if (!_throttleTimeout) {
- var args = arguments,
- _this = this;
- if (args.length === 1) {
- callback.call(_this, args[0]);
- } else {
- callback.apply(_this, args);
- }
- _throttleTimeout = setTimeout(function () {
- _throttleTimeout = void 0;
- }, ms);
- }
- };
- }
- function cancelThrottle() {
- clearTimeout(_throttleTimeout);
- _throttleTimeout = void 0;
- }
- function scrollBy(el, x, y) {
- el.scrollLeft += x;
- el.scrollTop += y;
- }
- function clone(el) {
- var Polymer = window.Polymer;
- var $ = window.jQuery || window.Zepto;
- if (Polymer && Polymer.dom) {
- return Polymer.dom(el).cloneNode(true);
- } else if ($) {
- return $(el).clone(true)[0];
- } else {
- return el.cloneNode(true);
- }
- }
- function setRect(el, rect) {
- css(el, 'position', 'absolute');
- css(el, 'top', rect.top);
- css(el, 'left', rect.left);
- css(el, 'width', rect.width);
- css(el, 'height', rect.height);
- }
- function unsetRect(el) {
- css(el, 'position', '');
- css(el, 'top', '');
- css(el, 'left', '');
- css(el, 'width', '');
- css(el, 'height', '');
- }
- var expando = 'Sortable' + new Date().getTime();
- function AnimationStateManager() {
- var animationStates = [],
- animationCallbackId;
- return {
- captureAnimationState: function captureAnimationState() {
- animationStates = [];
- if (!this.options.animation) return;
- var children = [].slice.call(this.el.children);
- children.forEach(function (child) {
- if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
- animationStates.push({
- target: child,
- rect: getRect(child)
- });
- var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation
- if (child.thisAnimationDuration) {
- var childMatrix = matrix(child, true);
- if (childMatrix) {
- fromRect.top -= childMatrix.f;
- fromRect.left -= childMatrix.e;
- }
- }
- child.fromRect = fromRect;
- });
- },
- addAnimationState: function addAnimationState(state) {
- animationStates.push(state);
- },
- removeAnimationState: function removeAnimationState(target) {
- animationStates.splice(indexOfObject(animationStates, {
- target: target
- }), 1);
- },
- animateAll: function animateAll(callback) {
- var _this = this;
- if (!this.options.animation) {
- clearTimeout(animationCallbackId);
- if (typeof callback === 'function') callback();
- return;
- }
- var animating = false,
- animationTime = 0;
- animationStates.forEach(function (state) {
- var time = 0,
- target = state.target,
- fromRect = target.fromRect,
- toRect = getRect(target),
- prevFromRect = target.prevFromRect,
- prevToRect = target.prevToRect,
- animatingRect = state.rect,
- targetMatrix = matrix(target, true);
- if (targetMatrix) {
- // Compensate for current animation
- toRect.top -= targetMatrix.f;
- toRect.left -= targetMatrix.e;
- }
- target.toRect = toRect;
- if (target.thisAnimationDuration) {
- // Could also check if animatingRect is between fromRect and toRect
- if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect
- (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
- // If returning to same place as started from animation and on same axis
- time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
- }
- } // if fromRect != toRect: animate
- if (!isRectEqual(toRect, fromRect)) {
- target.prevFromRect = fromRect;
- target.prevToRect = toRect;
- if (!time) {
- time = _this.options.animation;
- }
- _this.animate(target, animatingRect, toRect, time);
- }
- if (time) {
- animating = true;
- animationTime = Math.max(animationTime, time);
- clearTimeout(target.animationResetTimer);
- target.animationResetTimer = setTimeout(function () {
- target.animationTime = 0;
- target.prevFromRect = null;
- target.fromRect = null;
- target.prevToRect = null;
- target.thisAnimationDuration = null;
- }, time);
- target.thisAnimationDuration = time;
- }
- });
- clearTimeout(animationCallbackId);
- if (!animating) {
- if (typeof callback === 'function') callback();
- } else {
- animationCallbackId = setTimeout(function () {
- if (typeof callback === 'function') callback();
- }, animationTime);
- }
- animationStates = [];
- },
- animate: function animate(target, currentRect, toRect, duration) {
- if (duration) {
- css(target, 'transition', '');
- css(target, 'transform', '');
- var elMatrix = matrix(this.el),
- scaleX = elMatrix && elMatrix.a,
- scaleY = elMatrix && elMatrix.d,
- translateX = (currentRect.left - toRect.left) / (scaleX || 1),
- translateY = (currentRect.top - toRect.top) / (scaleY || 1);
- target.animatingX = !!translateX;
- target.animatingY = !!translateY;
- css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
- this.forRepaintDummy = repaint(target); // repaint
- css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
- css(target, 'transform', 'translate3d(0,0,0)');
- typeof target.animated === 'number' && clearTimeout(target.animated);
- target.animated = setTimeout(function () {
- css(target, 'transition', '');
- css(target, 'transform', '');
- target.animated = false;
- target.animatingX = false;
- target.animatingY = false;
- }, duration);
- }
- }
- };
- }
- function repaint(target) {
- return target.offsetWidth;
- }
- function calculateRealTime(animatingRect, fromRect, toRect, options) {
- 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;
- }
- var plugins = [];
- var defaults = {
- initializeByDefault: true
- };
- var PluginManager = {
- mount: function mount(plugin) {
- // Set default static properties
- for (var option in defaults) {
- if (defaults.hasOwnProperty(option) && !(option in plugin)) {
- plugin[option] = defaults[option];
- }
- }
- plugins.forEach(function (p) {
- if (p.pluginName === plugin.pluginName) {
- throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
- }
- });
- plugins.push(plugin);
- },
- pluginEvent: function pluginEvent(eventName, sortable, evt) {
- var _this = this;
- this.eventCanceled = false;
- evt.cancel = function () {
- _this.eventCanceled = true;
- };
- var eventNameGlobal = eventName + 'Global';
- plugins.forEach(function (plugin) {
- if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable
- if (sortable[plugin.pluginName][eventNameGlobal]) {
- sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
- sortable: sortable
- }, evt));
- } // Only fire plugin event if plugin is enabled in this sortable,
- // and plugin has event defined
- if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
- sortable[plugin.pluginName][eventName](_objectSpread2({
- sortable: sortable
- }, evt));
- }
- });
- },
- initializePlugins: function initializePlugins(sortable, el, defaults, options) {
- plugins.forEach(function (plugin) {
- var pluginName = plugin.pluginName;
- if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
- var initialized = new plugin(sortable, el, sortable.options);
- initialized.sortable = sortable;
- initialized.options = sortable.options;
- sortable[pluginName] = initialized; // Add default options from plugin
- _extends(defaults, initialized.defaults);
- });
- for (var option in sortable.options) {
- if (!sortable.options.hasOwnProperty(option)) continue;
- var modified = this.modifyOption(sortable, option, sortable.options[option]);
- if (typeof modified !== 'undefined') {
- sortable.options[option] = modified;
- }
- }
- },
- getEventProperties: function getEventProperties(name, sortable) {
- var eventProperties = {};
- plugins.forEach(function (plugin) {
- if (typeof plugin.eventProperties !== 'function') return;
- _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
- });
- return eventProperties;
- },
- modifyOption: function modifyOption(sortable, name, value) {
- var modifiedValue;
- plugins.forEach(function (plugin) {
- // Plugin must exist on the Sortable
- 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
- if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
- modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
- }
- });
- return modifiedValue;
- }
- };
- function dispatchEvent(_ref) {
- var sortable = _ref.sortable,
- rootEl = _ref.rootEl,
- name = _ref.name,
- targetEl = _ref.targetEl,
- cloneEl = _ref.cloneEl,
- toEl = _ref.toEl,
- fromEl = _ref.fromEl,
- oldIndex = _ref.oldIndex,
- newIndex = _ref.newIndex,
- oldDraggableIndex = _ref.oldDraggableIndex,
- newDraggableIndex = _ref.newDraggableIndex,
- originalEvent = _ref.originalEvent,
- putSortable = _ref.putSortable,
- extraEventProperties = _ref.extraEventProperties;
- sortable = sortable || rootEl && rootEl[expando];
- if (!sortable) return;
- var evt,
- options = sortable.options,
- onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature
- if (window.CustomEvent && !IE11OrLess && !Edge) {
- evt = new CustomEvent(name, {
- bubbles: true,
- cancelable: true
- });
- } else {
- evt = document.createEvent('Event');
- evt.initEvent(name, true, true);
- }
- evt.to = toEl || rootEl;
- evt.from = fromEl || rootEl;
- evt.item = targetEl || rootEl;
- evt.clone = cloneEl;
- evt.oldIndex = oldIndex;
- evt.newIndex = newIndex;
- evt.oldDraggableIndex = oldDraggableIndex;
- evt.newDraggableIndex = newDraggableIndex;
- evt.originalEvent = originalEvent;
- evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
- var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
- for (var option in allEventProperties) {
- evt[option] = allEventProperties[option];
- }
- if (rootEl) {
- rootEl.dispatchEvent(evt);
- }
- if (options[onName]) {
- options[onName].call(sortable, evt);
- }
- }
- var _excluded = ["evt"];
- var pluginEvent = function pluginEvent(eventName, sortable) {
- var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
- originalEvent = _ref.evt,
- data = _objectWithoutProperties(_ref, _excluded);
- PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
- dragEl: dragEl,
- parentEl: parentEl,
- ghostEl: ghostEl,
- rootEl: rootEl,
- nextEl: nextEl,
- lastDownEl: lastDownEl,
- cloneEl: cloneEl,
- cloneHidden: cloneHidden,
- dragStarted: moved,
- putSortable: putSortable,
- activeSortable: Sortable.active,
- originalEvent: originalEvent,
- oldIndex: oldIndex,
- oldDraggableIndex: oldDraggableIndex,
- newIndex: newIndex,
- newDraggableIndex: newDraggableIndex,
- hideGhostForTarget: _hideGhostForTarget,
- unhideGhostForTarget: _unhideGhostForTarget,
- cloneNowHidden: function cloneNowHidden() {
- cloneHidden = true;
- },
- cloneNowShown: function cloneNowShown() {
- cloneHidden = false;
- },
- dispatchSortableEvent: function dispatchSortableEvent(name) {
- _dispatchEvent({
- sortable: sortable,
- name: name,
- originalEvent: originalEvent
- });
- }
- }, data));
- };
- function _dispatchEvent(info) {
- dispatchEvent(_objectSpread2({
- putSortable: putSortable,
- cloneEl: cloneEl,
- targetEl: dragEl,
- rootEl: rootEl,
- oldIndex: oldIndex,
- oldDraggableIndex: oldDraggableIndex,
- newIndex: newIndex,
- newDraggableIndex: newDraggableIndex
- }, info));
- }
- var dragEl,
- parentEl,
- ghostEl,
- rootEl,
- nextEl,
- lastDownEl,
- cloneEl,
- cloneHidden,
- oldIndex,
- newIndex,
- oldDraggableIndex,
- newDraggableIndex,
- activeGroup,
- putSortable,
- awaitingDragStarted = false,
- ignoreNextClick = false,
- sortables = [],
- tapEvt,
- touchEvt,
- lastDx,
- lastDy,
- tapDistanceLeft,
- tapDistanceTop,
- moved,
- lastTarget,
- lastDirection,
- pastFirstInvertThresh = false,
- isCircumstantialInvert = false,
- targetMoveDistance,
- // For positioning ghost absolutely
- ghostRelativeParent,
- ghostRelativeParentInitialScroll = [],
- // (left, top)
- _silent = false,
- savedInputChecked = [];
- /** @const */
- var documentExists = typeof document !== 'undefined',
- PositionGhostAbsolutely = IOS,
- CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
- // This will not pass for IE9, because IE9 DnD only works on anchors
- supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
- supportCssPointerEvents = function () {
- if (!documentExists) return; // false when <= IE11
- if (IE11OrLess) {
- return false;
- }
- var el = document.createElement('x');
- el.style.cssText = 'pointer-events:auto';
- return el.style.pointerEvents === 'auto';
- }(),
- _detectDirection = function _detectDirection(el, options) {
- var elCSS = css(el),
- elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
- child1 = getChild(el, 0, options),
- child2 = getChild(el, 1, options),
- firstChildCSS = child1 && css(child1),
- secondChildCSS = child2 && css(child2),
- firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
- secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
- if (elCSS.display === 'flex') {
- return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
- }
- if (elCSS.display === 'grid') {
- return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
- }
- if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
- var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
- return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
- }
- 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';
- },
- _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
- var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
- dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
- dragElOppLength = vertical ? dragRect.width : dragRect.height,
- targetS1Opp = vertical ? targetRect.left : targetRect.top,
- targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
- targetOppLength = vertical ? targetRect.width : targetRect.height;
- return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
- },
- /**
- * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
- * @param {Number} x X position
- * @param {Number} y Y position
- * @return {HTMLElement} Element of the first found nearest Sortable
- */
- _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
- var ret;
- sortables.some(function (sortable) {
- var threshold = sortable[expando].options.emptyInsertThreshold;
- if (!threshold || lastChild(sortable)) return;
- var rect = getRect(sortable),
- insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
- insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
- if (insideHorizontally && insideVertically) {
- return ret = sortable;
- }
- });
- return ret;
- },
- _prepareGroup = function _prepareGroup(options) {
- function toFn(value, pull) {
- return function (to, from, dragEl, evt) {
- var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
- if (value == null && (pull || sameGroup)) {
- // Default pull value
- // Default pull and put value if same group
- return true;
- } else if (value == null || value === false) {
- return false;
- } else if (pull && value === 'clone') {
- return value;
- } else if (typeof value === 'function') {
- return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
- } else {
- var otherGroup = (pull ? to : from).options.group.name;
- return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
- }
- };
- }
- var group = {};
- var originalGroup = options.group;
- if (!originalGroup || _typeof(originalGroup) != 'object') {
- originalGroup = {
- name: originalGroup
- };
- }
- group.name = originalGroup.name;
- group.checkPull = toFn(originalGroup.pull, true);
- group.checkPut = toFn(originalGroup.put);
- group.revertClone = originalGroup.revertClone;
- options.group = group;
- },
- _hideGhostForTarget = function _hideGhostForTarget() {
- if (!supportCssPointerEvents && ghostEl) {
- css(ghostEl, 'display', 'none');
- }
- },
- _unhideGhostForTarget = function _unhideGhostForTarget() {
- if (!supportCssPointerEvents && ghostEl) {
- css(ghostEl, 'display', '');
- }
- }; // #1184 fix - Prevent click event on fallback if dragged but item not changed position
- if (documentExists) {
- document.addEventListener('click', function (evt) {
- if (ignoreNextClick) {
- evt.preventDefault();
- evt.stopPropagation && evt.stopPropagation();
- evt.stopImmediatePropagation && evt.stopImmediatePropagation();
- ignoreNextClick = false;
- return false;
- }
- }, true);
- }
- var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
- if (dragEl) {
- evt = evt.touches ? evt.touches[0] : evt;
- var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
- if (nearest) {
- // Create imitation event
- var event = {};
- for (var i in evt) {
- if (evt.hasOwnProperty(i)) {
- event[i] = evt[i];
- }
- }
- event.target = event.rootEl = nearest;
- event.preventDefault = void 0;
- event.stopPropagation = void 0;
- nearest[expando]._onDragOver(event);
- }
- }
- };
- var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
- if (dragEl) {
- dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
- }
- };
- /**
- * @class Sortable
- * @param {HTMLElement} el
- * @param {Object} [options]
- */
- function Sortable(el, options) {
- if (!(el && el.nodeType && el.nodeType === 1)) {
- throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
- }
- this.el = el; // root element
- this.options = options = _extends({}, options); // Export instance
- el[expando] = this;
- var defaults = {
- group: null,
- sort: true,
- disabled: false,
- store: null,
- handle: null,
- draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
- swapThreshold: 1,
- // percentage; 0 <= x <= 1
- invertSwap: false,
- // invert always
- invertedSwapThreshold: null,
- // will be set to same as swapThreshold if default
- removeCloneOnHide: true,
- direction: function direction() {
- return _detectDirection(el, this.options);
- },
- ghostClass: 'sortable-ghost',
- chosenClass: 'sortable-chosen',
- dragClass: 'sortable-drag',
- ignore: 'a, img',
- filter: null,
- preventOnFilter: true,
- animation: 0,
- easing: null,
- setData: function setData(dataTransfer, dragEl) {
- dataTransfer.setData('Text', dragEl.textContent);
- },
- dropBubble: false,
- dragoverBubble: false,
- dataIdAttr: 'data-id',
- delay: 0,
- delayOnTouchOnly: false,
- touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
- forceFallback: false,
- fallbackClass: 'sortable-fallback',
- fallbackOnBody: false,
- fallbackTolerance: 0,
- fallbackOffset: {
- x: 0,
- y: 0
- },
- supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
- emptyInsertThreshold: 5
- };
- PluginManager.initializePlugins(this, el, defaults); // Set default options
- for (var name in defaults) {
- !(name in options) && (options[name] = defaults[name]);
- }
- _prepareGroup(options); // Bind all private methods
- for (var fn in this) {
- if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
- this[fn] = this[fn].bind(this);
- }
- } // Setup drag mode
- this.nativeDraggable = options.forceFallback ? false : supportDraggable;
- if (this.nativeDraggable) {
- // Touch start threshold cannot be greater than the native dragstart threshold
- this.options.touchStartThreshold = 1;
- } // Bind events
- if (options.supportPointer) {
- on(el, 'pointerdown', this._onTapStart);
- } else {
- on(el, 'mousedown', this._onTapStart);
- on(el, 'touchstart', this._onTapStart);
- }
- if (this.nativeDraggable) {
- on(el, 'dragover', this);
- on(el, 'dragenter', this);
- }
- sortables.push(this.el); // Restore sorting
- options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager
- _extends(this, AnimationStateManager());
- }
- Sortable.prototype =
- /** @lends Sortable.prototype */
- {
- constructor: Sortable,
- _isOutsideThisEl: function _isOutsideThisEl(target) {
- if (!this.el.contains(target) && target !== this.el) {
- lastTarget = null;
- }
- },
- _getDirection: function _getDirection(evt, target) {
- return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
- },
- _onTapStart: function _onTapStart(
- /** Event|TouchEvent */
- evt) {
- if (!evt.cancelable) return;
- var _this = this,
- el = this.el,
- options = this.options,
- preventOnFilter = options.preventOnFilter,
- type = evt.type,
- touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
- target = (touch || evt).target,
- originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
- filter = options.filter;
- _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
- if (dragEl) {
- return;
- }
- if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
- return; // only left button and enabled
- } // cancel dnd if original target is content editable
- if (originalTarget.isContentEditable) {
- return;
- } // Safari ignores further event handling after mousedown
- if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
- return;
- }
- target = closest(target, options.draggable, el, false);
- if (target && target.animated) {
- return;
- }
- if (lastDownEl === target) {
- // Ignoring duplicate `down`
- return;
- } // Get the index of the dragged element within its parent
- oldIndex = index(target);
- oldDraggableIndex = index(target, options.draggable); // Check filter
- if (typeof filter === 'function') {
- if (filter.call(this, evt, target, this)) {
- _dispatchEvent({
- sortable: _this,
- rootEl: originalTarget,
- name: 'filter',
- targetEl: target,
- toEl: el,
- fromEl: el
- });
- pluginEvent('filter', _this, {
- evt: evt
- });
- preventOnFilter && evt.cancelable && evt.preventDefault();
- return; // cancel dnd
- }
- } else if (filter) {
- filter = filter.split(',').some(function (criteria) {
- criteria = closest(originalTarget, criteria.trim(), el, false);
- if (criteria) {
- _dispatchEvent({
- sortable: _this,
- rootEl: criteria,
- name: 'filter',
- targetEl: target,
- fromEl: el,
- toEl: el
- });
- pluginEvent('filter', _this, {
- evt: evt
- });
- return true;
- }
- });
- if (filter) {
- preventOnFilter && evt.cancelable && evt.preventDefault();
- return; // cancel dnd
- }
- }
- if (options.handle && !closest(originalTarget, options.handle, el, false)) {
- return;
- } // Prepare `dragstart`
- this._prepareDragStart(evt, touch, target);
- },
- _prepareDragStart: function _prepareDragStart(
- /** Event */
- evt,
- /** Touch */
- touch,
- /** HTMLElement */
- target) {
- var _this = this,
- el = _this.el,
- options = _this.options,
- ownerDocument = el.ownerDocument,
- dragStartFn;
- if (target && !dragEl && target.parentNode === el) {
- var dragRect = getRect(target);
- rootEl = el;
- dragEl = target;
- parentEl = dragEl.parentNode;
- nextEl = dragEl.nextSibling;
- lastDownEl = target;
- activeGroup = options.group;
- Sortable.dragged = dragEl;
- tapEvt = {
- target: dragEl,
- clientX: (touch || evt).clientX,
- clientY: (touch || evt).clientY
- };
- tapDistanceLeft = tapEvt.clientX - dragRect.left;
- tapDistanceTop = tapEvt.clientY - dragRect.top;
- this._lastX = (touch || evt).clientX;
- this._lastY = (touch || evt).clientY;
- dragEl.style['will-change'] = 'all';
- dragStartFn = function dragStartFn() {
- pluginEvent('delayEnded', _this, {
- evt: evt
- });
- if (Sortable.eventCanceled) {
- _this._onDrop();
- return;
- } // Delayed drag has been triggered
- // we can re-enable the events: touchmove/mousemove
- _this._disableDelayedDragEvents();
- if (!FireFox && _this.nativeDraggable) {
- dragEl.draggable = true;
- } // Bind the events: dragstart/dragend
- _this._triggerDragStart(evt, touch); // Drag start event
- _dispatchEvent({
- sortable: _this,
- name: 'choose',
- originalEvent: evt
- }); // Chosen item
- toggleClass(dragEl, options.chosenClass, true);
- }; // Disable "draggable"
- options.ignore.split(',').forEach(function (criteria) {
- find(dragEl, criteria.trim(), _disableDraggable);
- });
- on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
- on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
- on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
- on(ownerDocument, 'mouseup', _this._onDrop);
- on(ownerDocument, 'touchend', _this._onDrop);
- on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)
- if (FireFox && this.nativeDraggable) {
- this.options.touchStartThreshold = 4;
- dragEl.draggable = true;
- }
- pluginEvent('delayStart', this, {
- evt: evt
- }); // Delay is impossible for native DnD in Edge or IE
- if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
- if (Sortable.eventCanceled) {
- this._onDrop();
- return;
- } // If the user moves the pointer or let go the click or touch
- // before the delay has been reached:
- // disable the delayed drag
- on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
- on(ownerDocument, 'touchend', _this._disableDelayedDrag);
- on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
- on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
- on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
- options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
- _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
- } else {
- dragStartFn();
- }
- }
- },
- _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(
- /** TouchEvent|PointerEvent **/
- e) {
- var touch = e.touches ? e.touches[0] : e;
- 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))) {
- this._disableDelayedDrag();
- }
- },
- _disableDelayedDrag: function _disableDelayedDrag() {
- dragEl && _disableDraggable(dragEl);
- clearTimeout(this._dragStartTimer);
- this._disableDelayedDragEvents();
- },
- _disableDelayedDragEvents: function _disableDelayedDragEvents() {
- var ownerDocument = this.el.ownerDocument;
- off(ownerDocument, 'mouseup', this._disableDelayedDrag);
- off(ownerDocument, 'touchend', this._disableDelayedDrag);
- off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
- off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
- off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
- off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
- },
- _triggerDragStart: function _triggerDragStart(
- /** Event */
- evt,
- /** Touch */
- touch) {
- touch = touch || evt.pointerType == 'touch' && evt;
- if (!this.nativeDraggable || touch) {
- if (this.options.supportPointer) {
- on(document, 'pointermove', this._onTouchMove);
- } else if (touch) {
- on(document, 'touchmove', this._onTouchMove);
- } else {
- on(document, 'mousemove', this._onTouchMove);
- }
- } else {
- on(dragEl, 'dragend', this);
- on(rootEl, 'dragstart', this._onDragStart);
- }
- try {
- if (document.selection) {
- // Timeout neccessary for IE9
- _nextTick(function () {
- document.selection.empty();
- });
- } else {
- window.getSelection().removeAllRanges();
- }
- } catch (err) {}
- },
- _dragStarted: function _dragStarted(fallback, evt) {
- awaitingDragStarted = false;
- if (rootEl && dragEl) {
- pluginEvent('dragStarted', this, {
- evt: evt
- });
- if (this.nativeDraggable) {
- on(document, 'dragover', _checkOutsideTargetEl);
- }
- var options = this.options; // Apply effect
- !fallback && toggleClass(dragEl, options.dragClass, false);
- toggleClass(dragEl, options.ghostClass, true);
- Sortable.active = this;
- fallback && this._appendGhost(); // Drag start event
- _dispatchEvent({
- sortable: this,
- name: 'start',
- originalEvent: evt
- });
- } else {
- this._nulling();
- }
- },
- _emulateDragOver: function _emulateDragOver() {
- if (touchEvt) {
- this._lastX = touchEvt.clientX;
- this._lastY = touchEvt.clientY;
- _hideGhostForTarget();
- var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
- var parent = target;
- while (target && target.shadowRoot) {
- target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
- if (target === parent) break;
- parent = target;
- }
- dragEl.parentNode[expando]._isOutsideThisEl(target);
- if (parent) {
- do {
- if (parent[expando]) {
- var inserted = void 0;
- inserted = parent[expando]._onDragOver({
- clientX: touchEvt.clientX,
- clientY: touchEvt.clientY,
- target: target,
- rootEl: parent
- });
- if (inserted && !this.options.dragoverBubble) {
- break;
- }
- }
- target = parent; // store last element
- }
- /* jshint boss:true */
- while (parent = parent.parentNode);
- }
- _unhideGhostForTarget();
- }
- },
- _onTouchMove: function _onTouchMove(
- /**TouchEvent*/
- evt) {
- if (tapEvt) {
- var options = this.options,
- fallbackTolerance = options.fallbackTolerance,
- fallbackOffset = options.fallbackOffset,
- touch = evt.touches ? evt.touches[0] : evt,
- ghostMatrix = ghostEl && matrix(ghostEl, true),
- scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
- scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
- relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
- dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
- 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
- if (!Sortable.active && !awaitingDragStarted) {
- if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
- return;
- }
- this._onDragStart(evt, true);
- }
- if (ghostEl) {
- if (ghostMatrix) {
- ghostMatrix.e += dx - (lastDx || 0);
- ghostMatrix.f += dy - (lastDy || 0);
- } else {
- ghostMatrix = {
- a: 1,
- b: 0,
- c: 0,
- d: 1,
- e: dx,
- f: dy
- };
- }
- var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
- css(ghostEl, 'webkitTransform', cssMatrix);
- css(ghostEl, 'mozTransform', cssMatrix);
- css(ghostEl, 'msTransform', cssMatrix);
- css(ghostEl, 'transform', cssMatrix);
- lastDx = dx;
- lastDy = dy;
- touchEvt = touch;
- }
- evt.cancelable && evt.preventDefault();
- }
- },
- _appendGhost: function _appendGhost() {
- // Bug if using scale(): https://stackoverflow.com/questions/2637058
- // Not being adjusted for
- if (!ghostEl) {
- var container = this.options.fallbackOnBody ? document.body : rootEl,
- rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
- options = this.options; // Position absolutely
- if (PositionGhostAbsolutely) {
- // Get relatively positioned parent
- ghostRelativeParent = container;
- while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
- ghostRelativeParent = ghostRelativeParent.parentNode;
- }
- if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
- if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
- rect.top += ghostRelativeParent.scrollTop;
- rect.left += ghostRelativeParent.scrollLeft;
- } else {
- ghostRelativeParent = getWindowScrollingElement();
- }
- ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
- }
- ghostEl = dragEl.cloneNode(true);
- toggleClass(ghostEl, options.ghostClass, false);
- toggleClass(ghostEl, options.fallbackClass, true);
- toggleClass(ghostEl, options.dragClass, true);
- css(ghostEl, 'transition', '');
- css(ghostEl, 'transform', '');
- css(ghostEl, 'box-sizing', 'border-box');
- css(ghostEl, 'margin', 0);
- css(ghostEl, 'top', rect.top);
- css(ghostEl, 'left', rect.left);
- css(ghostEl, 'width', rect.width);
- css(ghostEl, 'height', rect.height);
- css(ghostEl, 'opacity', '0.8');
- css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
- css(ghostEl, 'zIndex', '100000');
- css(ghostEl, 'pointerEvents', 'none');
- Sortable.ghost = ghostEl;
- container.appendChild(ghostEl); // Set transform-origin
- css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
- }
- },
- _onDragStart: function _onDragStart(
- /**Event*/
- evt,
- /**boolean*/
- fallback) {
- var _this = this;
- var dataTransfer = evt.dataTransfer;
- var options = _this.options;
- pluginEvent('dragStart', this, {
- evt: evt
- });
- if (Sortable.eventCanceled) {
- this._onDrop();
- return;
- }
- pluginEvent('setupClone', this);
- if (!Sortable.eventCanceled) {
- cloneEl = clone(dragEl);
- cloneEl.draggable = false;
- cloneEl.style['will-change'] = '';
- this._hideClone();
- toggleClass(cloneEl, this.options.chosenClass, false);
- Sortable.clone = cloneEl;
- } // #1143: IFrame support workaround
- _this.cloneId = _nextTick(function () {
- pluginEvent('clone', _this);
- if (Sortable.eventCanceled) return;
- if (!_this.options.removeCloneOnHide) {
- rootEl.insertBefore(cloneEl, dragEl);
- }
- _this._hideClone();
- _dispatchEvent({
- sortable: _this,
- name: 'clone'
- });
- });
- !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events
- if (fallback) {
- ignoreNextClick = true;
- _this._loopId = setInterval(_this._emulateDragOver, 50);
- } else {
- // Undo what was set in _prepareDragStart before drag started
- off(document, 'mouseup', _this._onDrop);
- off(document, 'touchend', _this._onDrop);
- off(document, 'touchcancel', _this._onDrop);
- if (dataTransfer) {
- dataTransfer.effectAllowed = 'move';
- options.setData && options.setData.call(_this, dataTransfer, dragEl);
- }
- on(document, 'drop', _this); // #1276 fix:
- css(dragEl, 'transform', 'translateZ(0)');
- }
- awaitingDragStarted = true;
- _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
- on(document, 'selectstart', _this);
- moved = true;
- if (Safari) {
- css(document.body, 'user-select', 'none');
- }
- },
- // Returns true - if no further action is needed (either inserted or another condition)
- _onDragOver: function _onDragOver(
- /**Event*/
- evt) {
- var el = this.el,
- target = evt.target,
- dragRect,
- targetRect,
- revert,
- options = this.options,
- group = options.group,
- activeSortable = Sortable.active,
- isOwner = activeGroup === group,
- canSort = options.sort,
- fromSortable = putSortable || activeSortable,
- vertical,
- _this = this,
- completedFired = false;
- if (_silent) return;
- function dragOverEvent(name, extra) {
- pluginEvent(name, _this, _objectSpread2({
- evt: evt,
- isOwner: isOwner,
- axis: vertical ? 'vertical' : 'horizontal',
- revert: revert,
- dragRect: dragRect,
- targetRect: targetRect,
- canSort: canSort,
- fromSortable: fromSortable,
- target: target,
- completed: completed,
- onMove: function onMove(target, after) {
- return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
- },
- changed: changed
- }, extra));
- } // Capture animation state
- function capture() {
- dragOverEvent('dragOverAnimationCapture');
- _this.captureAnimationState();
- if (_this !== fromSortable) {
- fromSortable.captureAnimationState();
- }
- } // Return invocation when dragEl is inserted (or completed)
- function completed(insertion) {
- dragOverEvent('dragOverCompleted', {
- insertion: insertion
- });
- if (insertion) {
- // Clones must be hidden before folding animation to capture dragRectAbsolute properly
- if (isOwner) {
- activeSortable._hideClone();
- } else {
- activeSortable._showClone(_this);
- }
- if (_this !== fromSortable) {
- // Set ghost class to new sortable's ghost class
- toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
- toggleClass(dragEl, options.ghostClass, true);
- }
- if (putSortable !== _this && _this !== Sortable.active) {
- putSortable = _this;
- } else if (_this === Sortable.active && putSortable) {
- putSortable = null;
- } // Animation
- if (fromSortable === _this) {
- _this._ignoreWhileAnimating = target;
- }
- _this.animateAll(function () {
- dragOverEvent('dragOverAnimationComplete');
- _this._ignoreWhileAnimating = null;
- });
- if (_this !== fromSortable) {
- fromSortable.animateAll();
- fromSortable._ignoreWhileAnimating = null;
- }
- } // Null lastTarget if it is not inside a previously swapped element
- if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
- lastTarget = null;
- } // no bubbling and not fallback
- if (!options.dragoverBubble && !evt.rootEl && target !== document) {
- dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted
- !insertion && nearestEmptyInsertDetectEvent(evt);
- }
- !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
- return completedFired = true;
- } // Call when dragEl has been inserted
- function changed() {
- newIndex = index(dragEl);
- newDraggableIndex = index(dragEl, options.draggable);
- _dispatchEvent({
- sortable: _this,
- name: 'change',
- toEl: el,
- newIndex: newIndex,
- newDraggableIndex: newDraggableIndex,
- originalEvent: evt
- });
- }
- if (evt.preventDefault !== void 0) {
- evt.cancelable && evt.preventDefault();
- }
- target = closest(target, options.draggable, el, true);
- dragOverEvent('dragOver');
- if (Sortable.eventCanceled) return completedFired;
- if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
- return completed(false);
- }
- ignoreNextClick = false;
- if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
- : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
- vertical = this._getDirection(evt, target) === 'vertical';
- dragRect = getRect(dragEl);
- dragOverEvent('dragOverValid');
- if (Sortable.eventCanceled) return completedFired;
- if (revert) {
- parentEl = rootEl; // actualization
- capture();
- this._hideClone();
- dragOverEvent('revert');
- if (!Sortable.eventCanceled) {
- if (nextEl) {
- rootEl.insertBefore(dragEl, nextEl);
- } else {
- rootEl.appendChild(dragEl);
- }
- }
- return completed(true);
- }
- var elLastChild = lastChild(el, options.draggable);
- if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
- // Insert to end of list
- // If already at end of list: Do not insert
- if (elLastChild === dragEl) {
- return completed(false);
- } // if there is a last element, it is the target
- if (elLastChild && el === evt.target) {
- target = elLastChild;
- }
- if (target) {
- targetRect = getRect(target);
- }
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
- capture();
- el.appendChild(dragEl);
- parentEl = el; // actualization
- changed();
- return completed(true);
- }
- } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
- // Insert to start of list
- var firstChild = getChild(el, 0, options, true);
- if (firstChild === dragEl) {
- return completed(false);
- }
- target = firstChild;
- targetRect = getRect(target);
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
- capture();
- el.insertBefore(dragEl, firstChild);
- parentEl = el; // actualization
- changed();
- return completed(true);
- }
- } else if (target.parentNode === el) {
- targetRect = getRect(target);
- var direction = 0,
- targetBeforeFirstSwap,
- differentLevel = dragEl.parentNode !== el,
- differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
- side1 = vertical ? 'top' : 'left',
- scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
- scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
- if (lastTarget !== target) {
- targetBeforeFirstSwap = targetRect[side1];
- pastFirstInvertThresh = false;
- isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
- }
- direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
- var sibling;
- if (direction !== 0) {
- // Check if target is beside dragEl in respective direction (ignoring hidden elements)
- var dragIndex = index(dragEl);
- do {
- dragIndex -= direction;
- sibling = parentEl.children[dragIndex];
- } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
- } // If dragEl is already beside target: Do not insert
- if (direction === 0 || sibling === target) {
- return completed(false);
- }
- lastTarget = target;
- lastDirection = direction;
- var nextSibling = target.nextElementSibling,
- after = false;
- after = direction === 1;
- var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
- if (moveVector !== false) {
- if (moveVector === 1 || moveVector === -1) {
- after = moveVector === 1;
- }
- _silent = true;
- setTimeout(_unsilent, 30);
- capture();
- if (after && !nextSibling) {
- el.appendChild(dragEl);
- } else {
- target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
- } // Undo chrome's scroll adjustment (has no effect on other browsers)
- if (scrolledPastTop) {
- scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
- }
- parentEl = dragEl.parentNode; // actualization
- // must be done before animation
- if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
- targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
- }
- changed();
- return completed(true);
- }
- }
- if (el.contains(dragEl)) {
- return completed(false);
- }
- }
- return false;
- },
- _ignoreWhileAnimating: null,
- _offMoveEvents: function _offMoveEvents() {
- off(document, 'mousemove', this._onTouchMove);
- off(document, 'touchmove', this._onTouchMove);
- off(document, 'pointermove', this._onTouchMove);
- off(document, 'dragover', nearestEmptyInsertDetectEvent);
- off(document, 'mousemove', nearestEmptyInsertDetectEvent);
- off(document, 'touchmove', nearestEmptyInsertDetectEvent);
- },
- _offUpEvents: function _offUpEvents() {
- var ownerDocument = this.el.ownerDocument;
- off(ownerDocument, 'mouseup', this._onDrop);
- off(ownerDocument, 'touchend', this._onDrop);
- off(ownerDocument, 'pointerup', this._onDrop);
- off(ownerDocument, 'touchcancel', this._onDrop);
- off(document, 'selectstart', this);
- },
- _onDrop: function _onDrop(
- /**Event*/
- evt) {
- var el = this.el,
- options = this.options; // Get the index of the dragged element within its parent
- newIndex = index(dragEl);
- newDraggableIndex = index(dragEl, options.draggable);
- pluginEvent('drop', this, {
- evt: evt
- });
- parentEl = dragEl && dragEl.parentNode; // Get again after plugin event
- newIndex = index(dragEl);
- newDraggableIndex = index(dragEl, options.draggable);
- if (Sortable.eventCanceled) {
- this._nulling();
- return;
- }
- awaitingDragStarted = false;
- isCircumstantialInvert = false;
- pastFirstInvertThresh = false;
- clearInterval(this._loopId);
- clearTimeout(this._dragStartTimer);
- _cancelNextTick(this.cloneId);
- _cancelNextTick(this._dragStartId); // Unbind events
- if (this.nativeDraggable) {
- off(document, 'drop', this);
- off(el, 'dragstart', this._onDragStart);
- }
- this._offMoveEvents();
- this._offUpEvents();
- if (Safari) {
- css(document.body, 'user-select', '');
- }
- css(dragEl, 'transform', '');
- if (evt) {
- if (moved) {
- evt.cancelable && evt.preventDefault();
- !options.dropBubble && evt.stopPropagation();
- }
- ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
- if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
- // Remove clone(s)
- cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
- }
- if (dragEl) {
- if (this.nativeDraggable) {
- off(dragEl, 'dragend', this);
- }
- _disableDraggable(dragEl);
- dragEl.style['will-change'] = ''; // Remove classes
- // ghostClass is added in dragStarted
- if (moved && !awaitingDragStarted) {
- toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
- }
- toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event
- _dispatchEvent({
- sortable: this,
- name: 'unchoose',
- toEl: parentEl,
- newIndex: null,
- newDraggableIndex: null,
- originalEvent: evt
- });
- if (rootEl !== parentEl) {
- if (newIndex >= 0) {
- // Add event
- _dispatchEvent({
- rootEl: parentEl,
- name: 'add',
- toEl: parentEl,
- fromEl: rootEl,
- originalEvent: evt
- }); // Remove event
- _dispatchEvent({
- sortable: this,
- name: 'remove',
- toEl: parentEl,
- originalEvent: evt
- }); // drag from one list and drop into another
- _dispatchEvent({
- rootEl: parentEl,
- name: 'sort',
- toEl: parentEl,
- fromEl: rootEl,
- originalEvent: evt
- });
- _dispatchEvent({
- sortable: this,
- name: 'sort',
- toEl: parentEl,
- originalEvent: evt
- });
- }
- putSortable && putSortable.save();
- } else {
- if (newIndex !== oldIndex) {
- if (newIndex >= 0) {
- // drag & drop within the same list
- _dispatchEvent({
- sortable: this,
- name: 'update',
- toEl: parentEl,
- originalEvent: evt
- });
- _dispatchEvent({
- sortable: this,
- name: 'sort',
- toEl: parentEl,
- originalEvent: evt
- });
- }
- }
- }
- if (Sortable.active) {
- /* jshint eqnull:true */
- if (newIndex == null || newIndex === -1) {
- newIndex = oldIndex;
- newDraggableIndex = oldDraggableIndex;
- }
- _dispatchEvent({
- sortable: this,
- name: 'end',
- toEl: parentEl,
- originalEvent: evt
- }); // Save sorting
- this.save();
- }
- }
- }
- this._nulling();
- },
- _nulling: function _nulling() {
- pluginEvent('nulling', this);
- 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;
- savedInputChecked.forEach(function (el) {
- el.checked = true;
- });
- savedInputChecked.length = lastDx = lastDy = 0;
- },
- handleEvent: function handleEvent(
- /**Event*/
- evt) {
- switch (evt.type) {
- case 'drop':
- case 'dragend':
- this._onDrop(evt);
- break;
- case 'dragenter':
- case 'dragover':
- if (dragEl) {
- this._onDragOver(evt);
- _globalDragOver(evt);
- }
- break;
- case 'selectstart':
- evt.preventDefault();
- break;
- }
- },
- /**
- * Serializes the item into an array of string.
- * @returns {String[]}
- */
- toArray: function toArray() {
- var order = [],
- el,
- children = this.el.children,
- i = 0,
- n = children.length,
- options = this.options;
- for (; i < n; i++) {
- el = children[i];
- if (closest(el, options.draggable, this.el, false)) {
- order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
- }
- }
- return order;
- },
- /**
- * Sorts the elements according to the array.
- * @param {String[]} order order of the items
- */
- sort: function sort(order, useAnimation) {
- var items = {},
- rootEl = this.el;
- this.toArray().forEach(function (id, i) {
- var el = rootEl.children[i];
- if (closest(el, this.options.draggable, rootEl, false)) {
- items[id] = el;
- }
- }, this);
- useAnimation && this.captureAnimationState();
- order.forEach(function (id) {
- if (items[id]) {
- rootEl.removeChild(items[id]);
- rootEl.appendChild(items[id]);
- }
- });
- useAnimation && this.animateAll();
- },
- /**
- * Save the current sorting
- */
- save: function save() {
- var store = this.options.store;
- store && store.set && store.set(this);
- },
- /**
- * 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.
- * @param {HTMLElement} el
- * @param {String} [selector] default: `options.draggable`
- * @returns {HTMLElement|null}
- */
- closest: function closest$1(el, selector) {
- return closest(el, selector || this.options.draggable, this.el, false);
- },
- /**
- * Set/get option
- * @param {string} name
- * @param {*} [value]
- * @returns {*}
- */
- option: function option(name, value) {
- var options = this.options;
- if (value === void 0) {
- return options[name];
- } else {
- var modifiedValue = PluginManager.modifyOption(this, name, value);
- if (typeof modifiedValue !== 'undefined') {
- options[name] = modifiedValue;
- } else {
- options[name] = value;
- }
- if (name === 'group') {
- _prepareGroup(options);
- }
- }
- },
- /**
- * Destroy
- */
- destroy: function destroy() {
- pluginEvent('destroy', this);
- var el = this.el;
- el[expando] = null;
- off(el, 'mousedown', this._onTapStart);
- off(el, 'touchstart', this._onTapStart);
- off(el, 'pointerdown', this._onTapStart);
- if (this.nativeDraggable) {
- off(el, 'dragover', this);
- off(el, 'dragenter', this);
- } // Remove draggable attributes
- Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
- el.removeAttribute('draggable');
- });
- this._onDrop();
- this._disableDelayedDragEvents();
- sortables.splice(sortables.indexOf(this.el), 1);
- this.el = el = null;
- },
- _hideClone: function _hideClone() {
- if (!cloneHidden) {
- pluginEvent('hideClone', this);
- if (Sortable.eventCanceled) return;
- css(cloneEl, 'display', 'none');
- if (this.options.removeCloneOnHide && cloneEl.parentNode) {
- cloneEl.parentNode.removeChild(cloneEl);
- }
- cloneHidden = true;
- }
- },
- _showClone: function _showClone(putSortable) {
- if (putSortable.lastPutMode !== 'clone') {
- this._hideClone();
- return;
- }
- if (cloneHidden) {
- pluginEvent('showClone', this);
- if (Sortable.eventCanceled) return; // show clone at dragEl or original position
- if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
- rootEl.insertBefore(cloneEl, dragEl);
- } else if (nextEl) {
- rootEl.insertBefore(cloneEl, nextEl);
- } else {
- rootEl.appendChild(cloneEl);
- }
- if (this.options.group.revertClone) {
- this.animate(dragEl, cloneEl);
- }
- css(cloneEl, 'display', '');
- cloneHidden = false;
- }
- }
- };
- function _globalDragOver(
- /**Event*/
- evt) {
- if (evt.dataTransfer) {
- evt.dataTransfer.dropEffect = 'move';
- }
- evt.cancelable && evt.preventDefault();
- }
- function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
- var evt,
- sortable = fromEl[expando],
- onMoveFn = sortable.options.onMove,
- retVal; // Support for new CustomEvent feature
- if (window.CustomEvent && !IE11OrLess && !Edge) {
- evt = new CustomEvent('move', {
- bubbles: true,
- cancelable: true
- });
- } else {
- evt = document.createEvent('Event');
- evt.initEvent('move', true, true);
- }
- evt.to = toEl;
- evt.from = fromEl;
- evt.dragged = dragEl;
- evt.draggedRect = dragRect;
- evt.related = targetEl || toEl;
- evt.relatedRect = targetRect || getRect(toEl);
- evt.willInsertAfter = willInsertAfter;
- evt.originalEvent = originalEvent;
- fromEl.dispatchEvent(evt);
- if (onMoveFn) {
- retVal = onMoveFn.call(sortable, evt, originalEvent);
- }
- return retVal;
- }
- function _disableDraggable(el) {
- el.draggable = false;
- }
- function _unsilent() {
- _silent = false;
- }
- function _ghostIsFirst(evt, vertical, sortable) {
- var rect = getRect(getChild(sortable.el, 0, sortable.options, true));
- var spacer = 10;
- return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;
- }
- function _ghostIsLast(evt, vertical, sortable) {
- var rect = getRect(lastChild(sortable.el, sortable.options.draggable));
- var spacer = 10;
- 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;
- }
- function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
- var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
- targetLength = vertical ? targetRect.height : targetRect.width,
- targetS1 = vertical ? targetRect.top : targetRect.left,
- targetS2 = vertical ? targetRect.bottom : targetRect.right,
- invert = false;
- if (!invertSwap) {
- // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
- if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
- // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
- // check if past first invert threshold on side opposite of lastDirection
- if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
- // past first invert threshold, do not restrict inverted threshold to dragEl shadow
- pastFirstInvertThresh = true;
- }
- if (!pastFirstInvertThresh) {
- // dragEl shadow (target move distance shadow)
- if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
- : mouseOnAxis > targetS2 - targetMoveDistance) {
- return -lastDirection;
- }
- } else {
- invert = true;
- }
- } else {
- // Regular
- if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
- return _getInsertDirection(target);
- }
- }
- }
- invert = invert || invertSwap;
- if (invert) {
- // Invert of regular
- if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
- return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
- }
- }
- return 0;
- }
- /**
- * Gets the direction dragEl must be swapped relative to target in order to make it
- * seem that dragEl has been "inserted" into that element's position
- * @param {HTMLElement} target The target whose position dragEl is being inserted at
- * @return {Number} Direction dragEl must be swapped
- */
- function _getInsertDirection(target) {
- if (index(dragEl) < index(target)) {
- return 1;
- } else {
- return -1;
- }
- }
- /**
- * Generate id
- * @param {HTMLElement} el
- * @returns {String}
- * @private
- */
- function _generateId(el) {
- var str = el.tagName + el.className + el.src + el.href + el.textContent,
- i = str.length,
- sum = 0;
- while (i--) {
- sum += str.charCodeAt(i);
- }
- return sum.toString(36);
- }
- function _saveInputCheckedState(root) {
- savedInputChecked.length = 0;
- var inputs = root.getElementsByTagName('input');
- var idx = inputs.length;
- while (idx--) {
- var el = inputs[idx];
- el.checked && savedInputChecked.push(el);
- }
- }
- function _nextTick(fn) {
- return setTimeout(fn, 0);
- }
- function _cancelNextTick(id) {
- return clearTimeout(id);
- } // Fixed #973:
- if (documentExists) {
- on(document, 'touchmove', function (evt) {
- if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
- evt.preventDefault();
- }
- });
- } // Export utils
- Sortable.utils = {
- on: on,
- off: off,
- css: css,
- find: find,
- is: function is(el, selector) {
- return !!closest(el, selector, el, false);
- },
- extend: extend,
- throttle: throttle,
- closest: closest,
- toggleClass: toggleClass,
- clone: clone,
- index: index,
- nextTick: _nextTick,
- cancelNextTick: _cancelNextTick,
- detectDirection: _detectDirection,
- getChild: getChild
- };
- /**
- * Get the Sortable instance of an element
- * @param {HTMLElement} element The element
- * @return {Sortable|undefined} The instance of Sortable
- */
- Sortable.get = function (element) {
- return element[expando];
- };
- /**
- * Mount a plugin to Sortable
- * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
- */
- Sortable.mount = function () {
- for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
- plugins[_key] = arguments[_key];
- }
- if (plugins[0].constructor === Array) plugins = plugins[0];
- plugins.forEach(function (plugin) {
- if (!plugin.prototype || !plugin.prototype.constructor) {
- throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
- }
- if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
- PluginManager.mount(plugin);
- });
- };
- /**
- * Create sortable instance
- * @param {HTMLElement} el
- * @param {Object} [options]
- */
- Sortable.create = function (el, options) {
- return new Sortable(el, options);
- }; // Export
- Sortable.version = version;
- var autoScrolls = [],
- scrollEl,
- scrollRootEl,
- scrolling = false,
- lastAutoScrollX,
- lastAutoScrollY,
- touchEvt$1,
- pointerElemChangedInterval;
- function AutoScrollPlugin() {
- function AutoScroll() {
- this.defaults = {
- scroll: true,
- forceAutoScrollFallback: false,
- scrollSensitivity: 30,
- scrollSpeed: 10,
- bubbleScroll: true
- }; // Bind all private methods
- for (var fn in this) {
- if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
- this[fn] = this[fn].bind(this);
- }
- }
- }
- AutoScroll.prototype = {
- dragStarted: function dragStarted(_ref) {
- var originalEvent = _ref.originalEvent;
- if (this.sortable.nativeDraggable) {
- on(document, 'dragover', this._handleAutoScroll);
- } else {
- if (this.options.supportPointer) {
- on(document, 'pointermove', this._handleFallbackAutoScroll);
- } else if (originalEvent.touches) {
- on(document, 'touchmove', this._handleFallbackAutoScroll);
- } else {
- on(document, 'mousemove', this._handleFallbackAutoScroll);
- }
- }
- },
- dragOverCompleted: function dragOverCompleted(_ref2) {
- var originalEvent = _ref2.originalEvent;
- // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
- if (!this.options.dragOverBubble && !originalEvent.rootEl) {
- this._handleAutoScroll(originalEvent);
- }
- },
- drop: function drop() {
- if (this.sortable.nativeDraggable) {
- off(document, 'dragover', this._handleAutoScroll);
- } else {
- off(document, 'pointermove', this._handleFallbackAutoScroll);
- off(document, 'touchmove', this._handleFallbackAutoScroll);
- off(document, 'mousemove', this._handleFallbackAutoScroll);
- }
- clearPointerElemChangedInterval();
- clearAutoScrolls();
- cancelThrottle();
- },
- nulling: function nulling() {
- touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
- autoScrolls.length = 0;
- },
- _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
- this._handleAutoScroll(evt, true);
- },
- _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
- var _this = this;
- var x = (evt.touches ? evt.touches[0] : evt).clientX,
- y = (evt.touches ? evt.touches[0] : evt).clientY,
- elem = document.elementFromPoint(x, y);
- touchEvt$1 = evt; // IE does not seem to have native autoscroll,
- // Edge's autoscroll seems too conditional,
- // MACOS Safari does not have autoscroll,
- // Firefox and Chrome are good
- if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
- autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change
- var ogElemScroller = getParentAutoScrollElement(elem, true);
- if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
- pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour
- pointerElemChangedInterval = setInterval(function () {
- var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
- if (newElem !== ogElemScroller) {
- ogElemScroller = newElem;
- clearAutoScrolls();
- }
- autoScroll(evt, _this.options, newElem, fallback);
- }, 10);
- lastAutoScrollX = x;
- lastAutoScrollY = y;
- }
- } else {
- // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
- if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
- clearAutoScrolls();
- return;
- }
- autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
- }
- }
- };
- return _extends(AutoScroll, {
- pluginName: 'scroll',
- initializeByDefault: true
- });
- }
- function clearAutoScrolls() {
- autoScrolls.forEach(function (autoScroll) {
- clearInterval(autoScroll.pid);
- });
- autoScrolls = [];
- }
- function clearPointerElemChangedInterval() {
- clearInterval(pointerElemChangedInterval);
- }
- var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
- // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
- if (!options.scroll) return;
- var x = (evt.touches ? evt.touches[0] : evt).clientX,
- y = (evt.touches ? evt.touches[0] : evt).clientY,
- sens = options.scrollSensitivity,
- speed = options.scrollSpeed,
- winScroller = getWindowScrollingElement();
- var scrollThisInstance = false,
- scrollCustomFn; // New scroll root, set scrollEl
- if (scrollRootEl !== rootEl) {
- scrollRootEl = rootEl;
- clearAutoScrolls();
- scrollEl = options.scroll;
- scrollCustomFn = options.scrollFn;
- if (scrollEl === true) {
- scrollEl = getParentAutoScrollElement(rootEl, true);
- }
- }
- var layersOut = 0;
- var currentParent = scrollEl;
- do {
- var el = currentParent,
- rect = getRect(el),
- top = rect.top,
- bottom = rect.bottom,
- left = rect.left,
- right = rect.right,
- width = rect.width,
- height = rect.height,
- canScrollX = void 0,
- canScrollY = void 0,
- scrollWidth = el.scrollWidth,
- scrollHeight = el.scrollHeight,
- elCSS = css(el),
- scrollPosX = el.scrollLeft,
- scrollPosY = el.scrollTop;
- if (el === winScroller) {
- canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
- canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
- } else {
- canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
- canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
- }
- var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
- var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
- if (!autoScrolls[layersOut]) {
- for (var i = 0; i <= layersOut; i++) {
- if (!autoScrolls[i]) {
- autoScrolls[i] = {};
- }
- }
- }
- if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
- autoScrolls[layersOut].el = el;
- autoScrolls[layersOut].vx = vx;
- autoScrolls[layersOut].vy = vy;
- clearInterval(autoScrolls[layersOut].pid);
- if (vx != 0 || vy != 0) {
- scrollThisInstance = true;
- /* jshint loopfunc:true */
- autoScrolls[layersOut].pid = setInterval(function () {
- // emulate drag over during autoscroll (fallback), emulating native DnD behaviour
- if (isFallback && this.layer === 0) {
- Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
- }
- var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
- var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
- if (typeof scrollCustomFn === 'function') {
- if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
- return;
- }
- }
- scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
- }.bind({
- layer: layersOut
- }), 24);
- }
- }
- layersOut++;
- } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
- scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
- }, 30);
- var drop = function drop(_ref) {
- var originalEvent = _ref.originalEvent,
- putSortable = _ref.putSortable,
- dragEl = _ref.dragEl,
- activeSortable = _ref.activeSortable,
- dispatchSortableEvent = _ref.dispatchSortableEvent,
- hideGhostForTarget = _ref.hideGhostForTarget,
- unhideGhostForTarget = _ref.unhideGhostForTarget;
- if (!originalEvent) return;
- var toSortable = putSortable || activeSortable;
- hideGhostForTarget();
- var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
- var target = document.elementFromPoint(touch.clientX, touch.clientY);
- unhideGhostForTarget();
- if (toSortable && !toSortable.el.contains(target)) {
- dispatchSortableEvent('spill');
- this.onSpill({
- dragEl: dragEl,
- putSortable: putSortable
- });
- }
- };
- function Revert() {}
- Revert.prototype = {
- startIndex: null,
- dragStart: function dragStart(_ref2) {
- var oldDraggableIndex = _ref2.oldDraggableIndex;
- this.startIndex = oldDraggableIndex;
- },
- onSpill: function onSpill(_ref3) {
- var dragEl = _ref3.dragEl,
- putSortable = _ref3.putSortable;
- this.sortable.captureAnimationState();
- if (putSortable) {
- putSortable.captureAnimationState();
- }
- var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
- if (nextSibling) {
- this.sortable.el.insertBefore(dragEl, nextSibling);
- } else {
- this.sortable.el.appendChild(dragEl);
- }
- this.sortable.animateAll();
- if (putSortable) {
- putSortable.animateAll();
- }
- },
- drop: drop
- };
- _extends(Revert, {
- pluginName: 'revertOnSpill'
- });
- function Remove() {}
- Remove.prototype = {
- onSpill: function onSpill(_ref4) {
- var dragEl = _ref4.dragEl,
- putSortable = _ref4.putSortable;
- var parentSortable = putSortable || this.sortable;
- parentSortable.captureAnimationState();
- dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
- parentSortable.animateAll();
- },
- drop: drop
- };
- _extends(Remove, {
- pluginName: 'removeOnSpill'
- });
- var lastSwapEl;
- function SwapPlugin() {
- function Swap() {
- this.defaults = {
- swapClass: 'sortable-swap-highlight'
- };
- }
- Swap.prototype = {
- dragStart: function dragStart(_ref) {
- var dragEl = _ref.dragEl;
- lastSwapEl = dragEl;
- },
- dragOverValid: function dragOverValid(_ref2) {
- var completed = _ref2.completed,
- target = _ref2.target,
- onMove = _ref2.onMove,
- activeSortable = _ref2.activeSortable,
- changed = _ref2.changed,
- cancel = _ref2.cancel;
- if (!activeSortable.options.swap) return;
- var el = this.sortable.el,
- options = this.options;
- if (target && target !== el) {
- var prevSwapEl = lastSwapEl;
- if (onMove(target) !== false) {
- toggleClass(target, options.swapClass, true);
- lastSwapEl = target;
- } else {
- lastSwapEl = null;
- }
- if (prevSwapEl && prevSwapEl !== lastSwapEl) {
- toggleClass(prevSwapEl, options.swapClass, false);
- }
- }
- changed();
- completed(true);
- cancel();
- },
- drop: function drop(_ref3) {
- var activeSortable = _ref3.activeSortable,
- putSortable = _ref3.putSortable,
- dragEl = _ref3.dragEl;
- var toSortable = putSortable || this.sortable;
- var options = this.options;
- lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);
- if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {
- if (dragEl !== lastSwapEl) {
- toSortable.captureAnimationState();
- if (toSortable !== activeSortable) activeSortable.captureAnimationState();
- swapNodes(dragEl, lastSwapEl);
- toSortable.animateAll();
- if (toSortable !== activeSortable) activeSortable.animateAll();
- }
- }
- },
- nulling: function nulling() {
- lastSwapEl = null;
- }
- };
- return _extends(Swap, {
- pluginName: 'swap',
- eventProperties: function eventProperties() {
- return {
- swapItem: lastSwapEl
- };
- }
- });
- }
- function swapNodes(n1, n2) {
- var p1 = n1.parentNode,
- p2 = n2.parentNode,
- i1,
- i2;
- if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;
- i1 = index(n1);
- i2 = index(n2);
- if (p1.isEqualNode(p2) && i1 < i2) {
- i2++;
- }
- p1.insertBefore(n2, p1.children[i1]);
- p2.insertBefore(n1, p2.children[i2]);
- }
- var multiDragElements = (/* unused pure expression or super */ null && ([])),
- multiDragClones = (/* unused pure expression or super */ null && ([])),
- lastMultiDragSelect,
- // for selection with modifier key down (SHIFT)
- multiDragSortable,
- initialFolding = false,
- // Initial multi-drag fold when drag started
- folding = false,
- // Folding any other time
- dragStarted = false,
- dragEl$1,
- clonesFromRect,
- clonesHidden;
- function MultiDragPlugin() {
- function MultiDrag(sortable) {
- // Bind all private methods
- for (var fn in this) {
- if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
- this[fn] = this[fn].bind(this);
- }
- }
- if (sortable.options.supportPointer) {
- on(document, 'pointerup', this._deselectMultiDrag);
- } else {
- on(document, 'mouseup', this._deselectMultiDrag);
- on(document, 'touchend', this._deselectMultiDrag);
- }
- on(document, 'keydown', this._checkKeyDown);
- on(document, 'keyup', this._checkKeyUp);
- this.defaults = {
- selectedClass: 'sortable-selected',
- multiDragKey: null,
- setData: function setData(dataTransfer, dragEl) {
- var data = '';
- if (multiDragElements.length && multiDragSortable === sortable) {
- multiDragElements.forEach(function (multiDragElement, i) {
- data += (!i ? '' : ', ') + multiDragElement.textContent;
- });
- } else {
- data = dragEl.textContent;
- }
- dataTransfer.setData('Text', data);
- }
- };
- }
- MultiDrag.prototype = {
- multiDragKeyDown: false,
- isMultiDrag: false,
- delayStartGlobal: function delayStartGlobal(_ref) {
- var dragged = _ref.dragEl;
- dragEl$1 = dragged;
- },
- delayEnded: function delayEnded() {
- this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);
- },
- setupClone: function setupClone(_ref2) {
- var sortable = _ref2.sortable,
- cancel = _ref2.cancel;
- if (!this.isMultiDrag) return;
- for (var i = 0; i < multiDragElements.length; i++) {
- multiDragClones.push(clone(multiDragElements[i]));
- multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;
- multiDragClones[i].draggable = false;
- multiDragClones[i].style['will-change'] = '';
- toggleClass(multiDragClones[i], this.options.selectedClass, false);
- multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);
- }
- sortable._hideClone();
- cancel();
- },
- clone: function clone(_ref3) {
- var sortable = _ref3.sortable,
- rootEl = _ref3.rootEl,
- dispatchSortableEvent = _ref3.dispatchSortableEvent,
- cancel = _ref3.cancel;
- if (!this.isMultiDrag) return;
- if (!this.options.removeCloneOnHide) {
- if (multiDragElements.length && multiDragSortable === sortable) {
- insertMultiDragClones(true, rootEl);
- dispatchSortableEvent('clone');
- cancel();
- }
- }
- },
- showClone: function showClone(_ref4) {
- var cloneNowShown = _ref4.cloneNowShown,
- rootEl = _ref4.rootEl,
- cancel = _ref4.cancel;
- if (!this.isMultiDrag) return;
- insertMultiDragClones(false, rootEl);
- multiDragClones.forEach(function (clone) {
- css(clone, 'display', '');
- });
- cloneNowShown();
- clonesHidden = false;
- cancel();
- },
- hideClone: function hideClone(_ref5) {
- var _this = this;
- var sortable = _ref5.sortable,
- cloneNowHidden = _ref5.cloneNowHidden,
- cancel = _ref5.cancel;
- if (!this.isMultiDrag) return;
- multiDragClones.forEach(function (clone) {
- css(clone, 'display', 'none');
- if (_this.options.removeCloneOnHide && clone.parentNode) {
- clone.parentNode.removeChild(clone);
- }
- });
- cloneNowHidden();
- clonesHidden = true;
- cancel();
- },
- dragStartGlobal: function dragStartGlobal(_ref6) {
- var sortable = _ref6.sortable;
- if (!this.isMultiDrag && multiDragSortable) {
- multiDragSortable.multiDrag._deselectMultiDrag();
- }
- multiDragElements.forEach(function (multiDragElement) {
- multiDragElement.sortableIndex = index(multiDragElement);
- }); // Sort multi-drag elements
- multiDragElements = multiDragElements.sort(function (a, b) {
- return a.sortableIndex - b.sortableIndex;
- });
- dragStarted = true;
- },
- dragStarted: function dragStarted(_ref7) {
- var _this2 = this;
- var sortable = _ref7.sortable;
- if (!this.isMultiDrag) return;
- if (this.options.sort) {
- // Capture rects,
- // hide multi drag elements (by positioning them absolute),
- // set multi drag elements rects to dragRect,
- // show multi drag elements,
- // animate to rects,
- // unset rects & remove from DOM
- sortable.captureAnimationState();
- if (this.options.animation) {
- multiDragElements.forEach(function (multiDragElement) {
- if (multiDragElement === dragEl$1) return;
- css(multiDragElement, 'position', 'absolute');
- });
- var dragRect = getRect(dragEl$1, false, true, true);
- multiDragElements.forEach(function (multiDragElement) {
- if (multiDragElement === dragEl$1) return;
- setRect(multiDragElement, dragRect);
- });
- folding = true;
- initialFolding = true;
- }
- }
- sortable.animateAll(function () {
- folding = false;
- initialFolding = false;
- if (_this2.options.animation) {
- multiDragElements.forEach(function (multiDragElement) {
- unsetRect(multiDragElement);
- });
- } // Remove all auxiliary multidrag items from el, if sorting enabled
- if (_this2.options.sort) {
- removeMultiDragElements();
- }
- });
- },
- dragOver: function dragOver(_ref8) {
- var target = _ref8.target,
- completed = _ref8.completed,
- cancel = _ref8.cancel;
- if (folding && ~multiDragElements.indexOf(target)) {
- completed(false);
- cancel();
- }
- },
- revert: function revert(_ref9) {
- var fromSortable = _ref9.fromSortable,
- rootEl = _ref9.rootEl,
- sortable = _ref9.sortable,
- dragRect = _ref9.dragRect;
- if (multiDragElements.length > 1) {
- // Setup unfold animation
- multiDragElements.forEach(function (multiDragElement) {
- sortable.addAnimationState({
- target: multiDragElement,
- rect: folding ? getRect(multiDragElement) : dragRect
- });
- unsetRect(multiDragElement);
- multiDragElement.fromRect = dragRect;
- fromSortable.removeAnimationState(multiDragElement);
- });
- folding = false;
- insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);
- }
- },
- dragOverCompleted: function dragOverCompleted(_ref10) {
- var sortable = _ref10.sortable,
- isOwner = _ref10.isOwner,
- insertion = _ref10.insertion,
- activeSortable = _ref10.activeSortable,
- parentEl = _ref10.parentEl,
- putSortable = _ref10.putSortable;
- var options = this.options;
- if (insertion) {
- // Clones must be hidden before folding animation to capture dragRectAbsolute properly
- if (isOwner) {
- activeSortable._hideClone();
- }
- initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location
- if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {
- // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible
- var dragRectAbsolute = getRect(dragEl$1, false, true, true);
- multiDragElements.forEach(function (multiDragElement) {
- if (multiDragElement === dragEl$1) return;
- 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
- // while folding, and so that we can capture them again because old sortable will no longer be fromSortable
- parentEl.appendChild(multiDragElement);
- });
- folding = true;
- } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out
- if (!isOwner) {
- // Only remove if not folding (folding will remove them anyways)
- if (!folding) {
- removeMultiDragElements();
- }
- if (multiDragElements.length > 1) {
- var clonesHiddenBefore = clonesHidden;
- activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden
- if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {
- multiDragClones.forEach(function (clone) {
- activeSortable.addAnimationState({
- target: clone,
- rect: clonesFromRect
- });
- clone.fromRect = clonesFromRect;
- clone.thisAnimationDuration = null;
- });
- }
- } else {
- activeSortable._showClone(sortable);
- }
- }
- }
- },
- dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {
- var dragRect = _ref11.dragRect,
- isOwner = _ref11.isOwner,
- activeSortable = _ref11.activeSortable;
- multiDragElements.forEach(function (multiDragElement) {
- multiDragElement.thisAnimationDuration = null;
- });
- if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {
- clonesFromRect = _extends({}, dragRect);
- var dragMatrix = matrix(dragEl$1, true);
- clonesFromRect.top -= dragMatrix.f;
- clonesFromRect.left -= dragMatrix.e;
- }
- },
- dragOverAnimationComplete: function dragOverAnimationComplete() {
- if (folding) {
- folding = false;
- removeMultiDragElements();
- }
- },
- drop: function drop(_ref12) {
- var evt = _ref12.originalEvent,
- rootEl = _ref12.rootEl,
- parentEl = _ref12.parentEl,
- sortable = _ref12.sortable,
- dispatchSortableEvent = _ref12.dispatchSortableEvent,
- oldIndex = _ref12.oldIndex,
- putSortable = _ref12.putSortable;
- var toSortable = putSortable || this.sortable;
- if (!evt) return;
- var options = this.options,
- children = parentEl.children; // Multi-drag selection
- if (!dragStarted) {
- if (options.multiDragKey && !this.multiDragKeyDown) {
- this._deselectMultiDrag();
- }
- toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));
- if (!~multiDragElements.indexOf(dragEl$1)) {
- multiDragElements.push(dragEl$1);
- dispatchEvent({
- sortable: sortable,
- rootEl: rootEl,
- name: 'select',
- targetEl: dragEl$1,
- originalEvt: evt
- }); // Modifier activated, select from last to dragEl
- if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {
- var lastIndex = index(lastMultiDragSelect),
- currentIndex = index(dragEl$1);
- if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {
- // Must include lastMultiDragSelect (select it), in case modified selection from no selection
- // (but previous selection existed)
- var n, i;
- if (currentIndex > lastIndex) {
- i = lastIndex;
- n = currentIndex;
- } else {
- i = currentIndex;
- n = lastIndex + 1;
- }
- for (; i < n; i++) {
- if (~multiDragElements.indexOf(children[i])) continue;
- toggleClass(children[i], options.selectedClass, true);
- multiDragElements.push(children[i]);
- dispatchEvent({
- sortable: sortable,
- rootEl: rootEl,
- name: 'select',
- targetEl: children[i],
- originalEvt: evt
- });
- }
- }
- } else {
- lastMultiDragSelect = dragEl$1;
- }
- multiDragSortable = toSortable;
- } else {
- multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);
- lastMultiDragSelect = null;
- dispatchEvent({
- sortable: sortable,
- rootEl: rootEl,
- name: 'deselect',
- targetEl: dragEl$1,
- originalEvt: evt
- });
- }
- } // Multi-drag drop
- if (dragStarted && this.isMultiDrag) {
- folding = false; // Do not "unfold" after around dragEl if reverted
- if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {
- var dragRect = getRect(dragEl$1),
- multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');
- if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;
- toSortable.captureAnimationState();
- if (!initialFolding) {
- if (options.animation) {
- dragEl$1.fromRect = dragRect;
- multiDragElements.forEach(function (multiDragElement) {
- multiDragElement.thisAnimationDuration = null;
- if (multiDragElement !== dragEl$1) {
- var rect = folding ? getRect(multiDragElement) : dragRect;
- multiDragElement.fromRect = rect; // Prepare unfold animation
- toSortable.addAnimationState({
- target: multiDragElement,
- rect: rect
- });
- }
- });
- } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert
- // properly they must all be removed
- removeMultiDragElements();
- multiDragElements.forEach(function (multiDragElement) {
- if (children[multiDragIndex]) {
- parentEl.insertBefore(multiDragElement, children[multiDragIndex]);
- } else {
- parentEl.appendChild(multiDragElement);
- }
- multiDragIndex++;
- }); // If initial folding is done, the elements may have changed position because they are now
- // unfolding around dragEl, even though dragEl may not have his index changed, so update event
- // must be fired here as Sortable will not.
- if (oldIndex === index(dragEl$1)) {
- var update = false;
- multiDragElements.forEach(function (multiDragElement) {
- if (multiDragElement.sortableIndex !== index(multiDragElement)) {
- update = true;
- return;
- }
- });
- if (update) {
- dispatchSortableEvent('update');
- }
- }
- } // Must be done after capturing individual rects (scroll bar)
- multiDragElements.forEach(function (multiDragElement) {
- unsetRect(multiDragElement);
- });
- toSortable.animateAll();
- }
- multiDragSortable = toSortable;
- } // Remove clones if necessary
- if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
- multiDragClones.forEach(function (clone) {
- clone.parentNode && clone.parentNode.removeChild(clone);
- });
- }
- },
- nullingGlobal: function nullingGlobal() {
- this.isMultiDrag = dragStarted = false;
- multiDragClones.length = 0;
- },
- destroyGlobal: function destroyGlobal() {
- this._deselectMultiDrag();
- off(document, 'pointerup', this._deselectMultiDrag);
- off(document, 'mouseup', this._deselectMultiDrag);
- off(document, 'touchend', this._deselectMultiDrag);
- off(document, 'keydown', this._checkKeyDown);
- off(document, 'keyup', this._checkKeyUp);
- },
- _deselectMultiDrag: function _deselectMultiDrag(evt) {
- if (typeof dragStarted !== "undefined" && dragStarted) return; // Only deselect if selection is in this sortable
- if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable
- if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click
- if (evt && evt.button !== 0) return;
- while (multiDragElements.length) {
- var el = multiDragElements[0];
- toggleClass(el, this.options.selectedClass, false);
- multiDragElements.shift();
- dispatchEvent({
- sortable: this.sortable,
- rootEl: this.sortable.el,
- name: 'deselect',
- targetEl: el,
- originalEvt: evt
- });
- }
- },
- _checkKeyDown: function _checkKeyDown(evt) {
- if (evt.key === this.options.multiDragKey) {
- this.multiDragKeyDown = true;
- }
- },
- _checkKeyUp: function _checkKeyUp(evt) {
- if (evt.key === this.options.multiDragKey) {
- this.multiDragKeyDown = false;
- }
- }
- };
- return _extends(MultiDrag, {
- // Static methods & properties
- pluginName: 'multiDrag',
- utils: {
- /**
- * Selects the provided multi-drag item
- * @param {HTMLElement} el The element to be selected
- */
- select: function select(el) {
- var sortable = el.parentNode[expando];
- if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;
- if (multiDragSortable && multiDragSortable !== sortable) {
- multiDragSortable.multiDrag._deselectMultiDrag();
- multiDragSortable = sortable;
- }
- toggleClass(el, sortable.options.selectedClass, true);
- multiDragElements.push(el);
- },
- /**
- * Deselects the provided multi-drag item
- * @param {HTMLElement} el The element to be deselected
- */
- deselect: function deselect(el) {
- var sortable = el.parentNode[expando],
- index = multiDragElements.indexOf(el);
- if (!sortable || !sortable.options.multiDrag || !~index) return;
- toggleClass(el, sortable.options.selectedClass, false);
- multiDragElements.splice(index, 1);
- }
- },
- eventProperties: function eventProperties() {
- var _this3 = this;
- var oldIndicies = [],
- newIndicies = [];
- multiDragElements.forEach(function (multiDragElement) {
- oldIndicies.push({
- multiDragElement: multiDragElement,
- index: multiDragElement.sortableIndex
- }); // multiDragElements will already be sorted if folding
- var newIndex;
- if (folding && multiDragElement !== dragEl$1) {
- newIndex = -1;
- } else if (folding) {
- newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');
- } else {
- newIndex = index(multiDragElement);
- }
- newIndicies.push({
- multiDragElement: multiDragElement,
- index: newIndex
- });
- });
- return {
- items: _toConsumableArray(multiDragElements),
- clones: [].concat(multiDragClones),
- oldIndicies: oldIndicies,
- newIndicies: newIndicies
- };
- },
- optionListeners: {
- multiDragKey: function multiDragKey(key) {
- key = key.toLowerCase();
- if (key === 'ctrl') {
- key = 'Control';
- } else if (key.length > 1) {
- key = key.charAt(0).toUpperCase() + key.substr(1);
- }
- return key;
- }
- }
- });
- }
- function insertMultiDragElements(clonesInserted, rootEl) {
- multiDragElements.forEach(function (multiDragElement, i) {
- var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];
- if (target) {
- rootEl.insertBefore(multiDragElement, target);
- } else {
- rootEl.appendChild(multiDragElement);
- }
- });
- }
- /**
- * Insert multi-drag clones
- * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted
- * @param {HTMLElement} rootEl
- */
- function insertMultiDragClones(elementsInserted, rootEl) {
- multiDragClones.forEach(function (clone, i) {
- var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];
- if (target) {
- rootEl.insertBefore(clone, target);
- } else {
- rootEl.appendChild(clone);
- }
- });
- }
- function removeMultiDragElements() {
- multiDragElements.forEach(function (multiDragElement) {
- if (multiDragElement === dragEl$1) return;
- multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);
- });
- }
- Sortable.mount(new AutoScrollPlugin());
- Sortable.mount(Remove, Revert);
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Sortable);
- /***/ }),
- /***/ 989:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- module.exports = __webpack_require__(63268);
- /***/ }),
- /***/ 63268:
- /***/ (function(module, exports) {
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root) {
- 'use strict';
- /**
- * charMap
- * @type {Object}
- */
- var charMap = {
- // latin
- 'À': 'A',
- 'Á': 'A',
- 'Â': 'A',
- 'Ã': 'A',
- 'Ä': 'Ae',
- 'Å': 'A',
- 'Æ': 'AE',
- 'Ç': 'C',
- 'È': 'E',
- 'É': 'E',
- 'Ê': 'E',
- 'Ë': 'E',
- 'Ì': 'I',
- 'Í': 'I',
- 'Î': 'I',
- 'Ï': 'I',
- 'Ð': 'D',
- 'Ñ': 'N',
- 'Ò': 'O',
- 'Ó': 'O',
- 'Ô': 'O',
- 'Õ': 'O',
- 'Ö': 'Oe',
- 'Ő': 'O',
- 'Ø': 'O',
- 'Ù': 'U',
- 'Ú': 'U',
- 'Û': 'U',
- 'Ü': 'Ue',
- 'Ű': 'U',
- 'Ý': 'Y',
- 'Þ': 'TH',
- 'ß': 'ss',
- 'à': 'a',
- 'á': 'a',
- 'â': 'a',
- 'ã': 'a',
- 'ä': 'ae',
- 'å': 'a',
- 'æ': 'ae',
- 'ç': 'c',
- 'è': 'e',
- 'é': 'e',
- 'ê': 'e',
- 'ë': 'e',
- 'ì': 'i',
- 'í': 'i',
- 'î': 'i',
- 'ï': 'i',
- 'ð': 'd',
- 'ñ': 'n',
- 'ò': 'o',
- 'ó': 'o',
- 'ô': 'o',
- 'õ': 'o',
- 'ö': 'oe',
- 'ő': 'o',
- 'ø': 'o',
- 'ù': 'u',
- 'ú': 'u',
- 'û': 'u',
- 'ü': 'ue',
- 'ű': 'u',
- 'ý': 'y',
- 'þ': 'th',
- 'ÿ': 'y',
- 'ẞ': 'SS',
- // language specific
- // Arabic
- 'ا': 'a',
- 'أ': 'a',
- 'إ': 'i',
- 'آ': 'aa',
- 'ؤ': 'u',
- 'ئ': 'e',
- 'ء': 'a',
- 'ب': 'b',
- 'ت': 't',
- 'ث': 'th',
- 'ج': 'j',
- 'ح': 'h',
- 'خ': 'kh',
- 'د': 'd',
- 'ذ': 'th',
- 'ر': 'r',
- 'ز': 'z',
- 'س': 's',
- 'ش': 'sh',
- 'ص': 's',
- 'ض': 'dh',
- 'ط': 't',
- 'ظ': 'z',
- 'ع': 'a',
- 'غ': 'gh',
- 'ف': 'f',
- 'ق': 'q',
- 'ك': 'k',
- 'ل': 'l',
- 'م': 'm',
- 'ن': 'n',
- 'ه': 'h',
- 'و': 'w',
- 'ي': 'y',
- 'ى': 'a',
- 'ة': 'h',
- 'ﻻ': 'la',
- 'ﻷ': 'laa',
- 'ﻹ': 'lai',
- 'ﻵ': 'laa',
- // Persian additional characters than Arabic
- 'گ': 'g',
- 'چ': 'ch',
- 'پ': 'p',
- 'ژ': 'zh',
- 'ک': 'k',
- 'ی': 'y',
- // Arabic diactrics
- 'َ': 'a',
- 'ً': 'an',
- 'ِ': 'e',
- 'ٍ': 'en',
- 'ُ': 'u',
- 'ٌ': 'on',
- 'ْ': '',
- // Arabic numbers
- '٠': '0',
- '١': '1',
- '٢': '2',
- '٣': '3',
- '٤': '4',
- '٥': '5',
- '٦': '6',
- '٧': '7',
- '٨': '8',
- '٩': '9',
- // Persian numbers
- '۰': '0',
- '۱': '1',
- '۲': '2',
- '۳': '3',
- '۴': '4',
- '۵': '5',
- '۶': '6',
- '۷': '7',
- '۸': '8',
- '۹': '9',
- // Burmese consonants
- 'က': 'k',
- 'ခ': 'kh',
- 'ဂ': 'g',
- 'ဃ': 'ga',
- 'င': 'ng',
- 'စ': 's',
- 'ဆ': 'sa',
- 'ဇ': 'z',
- 'စျ': 'za',
- 'ည': 'ny',
- 'ဋ': 't',
- 'ဌ': 'ta',
- 'ဍ': 'd',
- 'ဎ': 'da',
- 'ဏ': 'na',
- 'တ': 't',
- 'ထ': 'ta',
- 'ဒ': 'd',
- 'ဓ': 'da',
- 'န': 'n',
- 'ပ': 'p',
- 'ဖ': 'pa',
- 'ဗ': 'b',
- 'ဘ': 'ba',
- 'မ': 'm',
- 'ယ': 'y',
- 'ရ': 'ya',
- 'လ': 'l',
- 'ဝ': 'w',
- 'သ': 'th',
- 'ဟ': 'h',
- 'ဠ': 'la',
- 'အ': 'a',
- // consonant character combos
- 'ြ': 'y',
- 'ျ': 'ya',
- 'ွ': 'w',
- 'ြွ': 'yw',
- 'ျွ': 'ywa',
- 'ှ': 'h',
- // independent vowels
- 'ဧ': 'e',
- '၏': '-e',
- 'ဣ': 'i',
- 'ဤ': '-i',
- 'ဉ': 'u',
- 'ဦ': '-u',
- 'ဩ': 'aw',
- 'သြော': 'aw',
- 'ဪ': 'aw',
- // numbers
- '၀': '0',
- '၁': '1',
- '၂': '2',
- '၃': '3',
- '၄': '4',
- '၅': '5',
- '၆': '6',
- '၇': '7',
- '၈': '8',
- '၉': '9',
- // virama and tone marks which are silent in transliteration
- '္': '',
- '့': '',
- 'း': '',
- // Czech
- 'č': 'c',
- 'ď': 'd',
- 'ě': 'e',
- 'ň': 'n',
- 'ř': 'r',
- 'š': 's',
- 'ť': 't',
- 'ů': 'u',
- 'ž': 'z',
- 'Č': 'C',
- 'Ď': 'D',
- 'Ě': 'E',
- 'Ň': 'N',
- 'Ř': 'R',
- 'Š': 'S',
- 'Ť': 'T',
- 'Ů': 'U',
- 'Ž': 'Z',
- // Dhivehi
- 'ހ': 'h',
- 'ށ': 'sh',
- 'ނ': 'n',
- 'ރ': 'r',
- 'ބ': 'b',
- 'ޅ': 'lh',
- 'ކ': 'k',
- 'އ': 'a',
- 'ވ': 'v',
- 'މ': 'm',
- 'ފ': 'f',
- 'ދ': 'dh',
- 'ތ': 'th',
- 'ލ': 'l',
- 'ގ': 'g',
- 'ޏ': 'gn',
- 'ސ': 's',
- 'ޑ': 'd',
- 'ޒ': 'z',
- 'ޓ': 't',
- 'ޔ': 'y',
- 'ޕ': 'p',
- 'ޖ': 'j',
- 'ޗ': 'ch',
- 'ޘ': 'tt',
- 'ޙ': 'hh',
- 'ޚ': 'kh',
- 'ޛ': 'th',
- 'ޜ': 'z',
- 'ޝ': 'sh',
- 'ޞ': 's',
- 'ޟ': 'd',
- 'ޠ': 't',
- 'ޡ': 'z',
- 'ޢ': 'a',
- 'ޣ': 'gh',
- 'ޤ': 'q',
- 'ޥ': 'w',
- 'ަ': 'a',
- 'ާ': 'aa',
- 'ި': 'i',
- 'ީ': 'ee',
- 'ު': 'u',
- 'ޫ': 'oo',
- 'ެ': 'e',
- 'ޭ': 'ey',
- 'ޮ': 'o',
- 'ޯ': 'oa',
- 'ް': '',
- // Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian
- // National system (2002)
- 'ა': 'a',
- 'ბ': 'b',
- 'გ': 'g',
- 'დ': 'd',
- 'ე': 'e',
- 'ვ': 'v',
- 'ზ': 'z',
- 'თ': 't',
- 'ი': 'i',
- 'კ': 'k',
- 'ლ': 'l',
- 'მ': 'm',
- 'ნ': 'n',
- 'ო': 'o',
- 'პ': 'p',
- 'ჟ': 'zh',
- 'რ': 'r',
- 'ს': 's',
- 'ტ': 't',
- 'უ': 'u',
- 'ფ': 'p',
- 'ქ': 'k',
- 'ღ': 'gh',
- 'ყ': 'q',
- 'შ': 'sh',
- 'ჩ': 'ch',
- 'ც': 'ts',
- 'ძ': 'dz',
- 'წ': 'ts',
- 'ჭ': 'ch',
- 'ხ': 'kh',
- 'ჯ': 'j',
- 'ჰ': 'h',
- // Greek
- 'α': 'a',
- 'β': 'v',
- 'γ': 'g',
- 'δ': 'd',
- 'ε': 'e',
- 'ζ': 'z',
- 'η': 'i',
- 'θ': 'th',
- 'ι': 'i',
- 'κ': 'k',
- 'λ': 'l',
- 'μ': 'm',
- 'ν': 'n',
- 'ξ': 'ks',
- 'ο': 'o',
- 'π': 'p',
- 'ρ': 'r',
- 'σ': 's',
- 'τ': 't',
- 'υ': 'y',
- 'φ': 'f',
- 'χ': 'x',
- 'ψ': 'ps',
- 'ω': 'o',
- 'ά': 'a',
- 'έ': 'e',
- 'ί': 'i',
- 'ό': 'o',
- 'ύ': 'y',
- 'ή': 'i',
- 'ώ': 'o',
- 'ς': 's',
- 'ϊ': 'i',
- 'ΰ': 'y',
- 'ϋ': 'y',
- 'ΐ': 'i',
- 'Α': 'A',
- 'Β': 'B',
- 'Γ': 'G',
- 'Δ': 'D',
- 'Ε': 'E',
- 'Ζ': 'Z',
- 'Η': 'I',
- 'Θ': 'TH',
- 'Ι': 'I',
- 'Κ': 'K',
- 'Λ': 'L',
- 'Μ': 'M',
- 'Ν': 'N',
- 'Ξ': 'KS',
- 'Ο': 'O',
- 'Π': 'P',
- 'Ρ': 'R',
- 'Σ': 'S',
- 'Τ': 'T',
- 'Υ': 'Y',
- 'Φ': 'F',
- 'Χ': 'X',
- 'Ψ': 'PS',
- 'Ω': 'O',
- 'Ά': 'A',
- 'Έ': 'E',
- 'Ί': 'I',
- 'Ό': 'O',
- 'Ύ': 'Y',
- 'Ή': 'I',
- 'Ώ': 'O',
- 'Ϊ': 'I',
- 'Ϋ': 'Y',
- // Latvian
- 'ā': 'a',
- // 'č': 'c', // duplicate
- 'ē': 'e',
- 'ģ': 'g',
- 'ī': 'i',
- 'ķ': 'k',
- 'ļ': 'l',
- 'ņ': 'n',
- // 'š': 's', // duplicate
- 'ū': 'u',
- // 'ž': 'z', // duplicate
- 'Ā': 'A',
- // 'Č': 'C', // duplicate
- 'Ē': 'E',
- 'Ģ': 'G',
- 'Ī': 'I',
- 'Ķ': 'k',
- 'Ļ': 'L',
- 'Ņ': 'N',
- // 'Š': 'S', // duplicate
- 'Ū': 'U',
- // 'Ž': 'Z', // duplicate
- // Macedonian
- 'Ќ': 'Kj',
- 'ќ': 'kj',
- 'Љ': 'Lj',
- 'љ': 'lj',
- 'Њ': 'Nj',
- 'њ': 'nj',
- 'Тс': 'Ts',
- 'тс': 'ts',
- // Polish
- 'ą': 'a',
- 'ć': 'c',
- 'ę': 'e',
- 'ł': 'l',
- 'ń': 'n',
- // 'ó': 'o', // duplicate
- 'ś': 's',
- 'ź': 'z',
- 'ż': 'z',
- 'Ą': 'A',
- 'Ć': 'C',
- 'Ę': 'E',
- 'Ł': 'L',
- 'Ń': 'N',
- 'Ś': 'S',
- 'Ź': 'Z',
- 'Ż': 'Z',
- // Ukranian
- 'Є': 'Ye',
- 'І': 'I',
- 'Ї': 'Yi',
- 'Ґ': 'G',
- 'є': 'ye',
- 'і': 'i',
- 'ї': 'yi',
- 'ґ': 'g',
- // Romanian
- 'ă': 'a',
- 'Ă': 'A',
- 'ș': 's',
- 'Ș': 'S',
- // 'ş': 's', // duplicate
- // 'Ş': 'S', // duplicate
- 'ț': 't',
- 'Ț': 'T',
- 'ţ': 't',
- 'Ţ': 'T',
- // Russian https://en.wikipedia.org/wiki/Romanization_of_Russian
- // ICAO
- 'а': 'a',
- 'б': 'b',
- 'в': 'v',
- 'г': 'g',
- 'д': 'd',
- 'е': 'e',
- 'ё': 'yo',
- 'ж': 'zh',
- 'з': 'z',
- 'и': 'i',
- 'й': 'i',
- 'к': 'k',
- 'л': 'l',
- 'м': 'm',
- 'н': 'n',
- 'о': 'o',
- 'п': 'p',
- 'р': 'r',
- 'с': 's',
- 'т': 't',
- 'у': 'u',
- 'ф': 'f',
- 'х': 'kh',
- 'ц': 'c',
- 'ч': 'ch',
- 'ш': 'sh',
- 'щ': 'sh',
- 'ъ': '',
- 'ы': 'y',
- 'ь': '',
- 'э': 'e',
- 'ю': 'yu',
- 'я': 'ya',
- 'А': 'A',
- 'Б': 'B',
- 'В': 'V',
- 'Г': 'G',
- 'Д': 'D',
- 'Е': 'E',
- 'Ё': 'Yo',
- 'Ж': 'Zh',
- 'З': 'Z',
- 'И': 'I',
- 'Й': 'I',
- 'К': 'K',
- 'Л': 'L',
- 'М': 'M',
- 'Н': 'N',
- 'О': 'O',
- 'П': 'P',
- 'Р': 'R',
- 'С': 'S',
- 'Т': 'T',
- 'У': 'U',
- 'Ф': 'F',
- 'Х': 'Kh',
- 'Ц': 'C',
- 'Ч': 'Ch',
- 'Ш': 'Sh',
- 'Щ': 'Sh',
- 'Ъ': '',
- 'Ы': 'Y',
- 'Ь': '',
- 'Э': 'E',
- 'Ю': 'Yu',
- 'Я': 'Ya',
- // Serbian
- 'ђ': 'dj',
- 'ј': 'j',
- // 'љ': 'lj', // duplicate
- // 'њ': 'nj', // duplicate
- 'ћ': 'c',
- 'џ': 'dz',
- 'Ђ': 'Dj',
- 'Ј': 'j',
- // 'Љ': 'Lj', // duplicate
- // 'Њ': 'Nj', // duplicate
- 'Ћ': 'C',
- 'Џ': 'Dz',
- // Slovak
- 'ľ': 'l',
- 'ĺ': 'l',
- 'ŕ': 'r',
- 'Ľ': 'L',
- 'Ĺ': 'L',
- 'Ŕ': 'R',
- // Turkish
- 'ş': 's',
- 'Ş': 'S',
- 'ı': 'i',
- 'İ': 'I',
- // 'ç': 'c', // duplicate
- // 'Ç': 'C', // duplicate
- // 'ü': 'u', // duplicate, see langCharMap
- // 'Ü': 'U', // duplicate, see langCharMap
- // 'ö': 'o', // duplicate, see langCharMap
- // 'Ö': 'O', // duplicate, see langCharMap
- 'ğ': 'g',
- 'Ğ': 'G',
- // Vietnamese
- 'ả': 'a',
- 'Ả': 'A',
- 'ẳ': 'a',
- 'Ẳ': 'A',
- 'ẩ': 'a',
- 'Ẩ': 'A',
- 'đ': 'd',
- 'Đ': 'D',
- 'ẹ': 'e',
- 'Ẹ': 'E',
- 'ẽ': 'e',
- 'Ẽ': 'E',
- 'ẻ': 'e',
- 'Ẻ': 'E',
- 'ế': 'e',
- 'Ế': 'E',
- 'ề': 'e',
- 'Ề': 'E',
- 'ệ': 'e',
- 'Ệ': 'E',
- 'ễ': 'e',
- 'Ễ': 'E',
- 'ể': 'e',
- 'Ể': 'E',
- 'ỏ': 'o',
- 'ọ': 'o',
- 'Ọ': 'o',
- 'ố': 'o',
- 'Ố': 'O',
- 'ồ': 'o',
- 'Ồ': 'O',
- 'ổ': 'o',
- 'Ổ': 'O',
- 'ộ': 'o',
- 'Ộ': 'O',
- 'ỗ': 'o',
- 'Ỗ': 'O',
- 'ơ': 'o',
- 'Ơ': 'O',
- 'ớ': 'o',
- 'Ớ': 'O',
- 'ờ': 'o',
- 'Ờ': 'O',
- 'ợ': 'o',
- 'Ợ': 'O',
- 'ỡ': 'o',
- 'Ỡ': 'O',
- 'Ở': 'o',
- 'ở': 'o',
- 'ị': 'i',
- 'Ị': 'I',
- 'ĩ': 'i',
- 'Ĩ': 'I',
- 'ỉ': 'i',
- 'Ỉ': 'i',
- 'ủ': 'u',
- 'Ủ': 'U',
- 'ụ': 'u',
- 'Ụ': 'U',
- 'ũ': 'u',
- 'Ũ': 'U',
- 'ư': 'u',
- 'Ư': 'U',
- 'ứ': 'u',
- 'Ứ': 'U',
- 'ừ': 'u',
- 'Ừ': 'U',
- 'ự': 'u',
- 'Ự': 'U',
- 'ữ': 'u',
- 'Ữ': 'U',
- 'ử': 'u',
- 'Ử': 'ư',
- 'ỷ': 'y',
- 'Ỷ': 'y',
- 'ỳ': 'y',
- 'Ỳ': 'Y',
- 'ỵ': 'y',
- 'Ỵ': 'Y',
- 'ỹ': 'y',
- 'Ỹ': 'Y',
- 'ạ': 'a',
- 'Ạ': 'A',
- 'ấ': 'a',
- 'Ấ': 'A',
- 'ầ': 'a',
- 'Ầ': 'A',
- 'ậ': 'a',
- 'Ậ': 'A',
- 'ẫ': 'a',
- 'Ẫ': 'A',
- // 'ă': 'a', // duplicate
- // 'Ă': 'A', // duplicate
- 'ắ': 'a',
- 'Ắ': 'A',
- 'ằ': 'a',
- 'Ằ': 'A',
- 'ặ': 'a',
- 'Ặ': 'A',
- 'ẵ': 'a',
- 'Ẵ': 'A',
- "⓪": "0",
- "①": "1",
- "②": "2",
- "③": "3",
- "④": "4",
- "⑤": "5",
- "⑥": "6",
- "⑦": "7",
- "⑧": "8",
- "⑨": "9",
- "⑩": "10",
- "⑪": "11",
- "⑫": "12",
- "⑬": "13",
- "⑭": "14",
- "⑮": "15",
- "⑯": "16",
- "⑰": "17",
- "⑱": "18",
- "⑲": "18",
- "⑳": "18",
- "⓵": "1",
- "⓶": "2",
- "⓷": "3",
- "⓸": "4",
- "⓹": "5",
- "⓺": "6",
- "⓻": "7",
- "⓼": "8",
- "⓽": "9",
- "⓾": "10",
- "⓿": "0",
- "⓫": "11",
- "⓬": "12",
- "⓭": "13",
- "⓮": "14",
- "⓯": "15",
- "⓰": "16",
- "⓱": "17",
- "⓲": "18",
- "⓳": "19",
- "⓴": "20",
- "Ⓐ": "A",
- "Ⓑ": "B",
- "Ⓒ": "C",
- "Ⓓ": "D",
- "Ⓔ": "E",
- "Ⓕ": "F",
- "Ⓖ": "G",
- "Ⓗ": "H",
- "Ⓘ": "I",
- "Ⓙ": "J",
- "Ⓚ": "K",
- "Ⓛ": "L",
- "Ⓜ": "M",
- "Ⓝ": "N",
- "Ⓞ": "O",
- "Ⓟ": "P",
- "Ⓠ": "Q",
- "Ⓡ": "R",
- "Ⓢ": "S",
- "Ⓣ": "T",
- "Ⓤ": "U",
- "Ⓥ": "V",
- "Ⓦ": "W",
- "Ⓧ": "X",
- "Ⓨ": "Y",
- "Ⓩ": "Z",
- "ⓐ": "a",
- "ⓑ": "b",
- "ⓒ": "c",
- "ⓓ": "d",
- "ⓔ": "e",
- "ⓕ": "f",
- "ⓖ": "g",
- "ⓗ": "h",
- "ⓘ": "i",
- "ⓙ": "j",
- "ⓚ": "k",
- "ⓛ": "l",
- "ⓜ": "m",
- "ⓝ": "n",
- "ⓞ": "o",
- "ⓟ": "p",
- "ⓠ": "q",
- "ⓡ": "r",
- "ⓢ": "s",
- "ⓣ": "t",
- "ⓤ": "u",
- "ⓦ": "v",
- "ⓥ": "w",
- "ⓧ": "x",
- "ⓨ": "y",
- "ⓩ": "z",
- // symbols
- '“': '"',
- '”': '"',
- '‘': "'",
- '’': "'",
- '∂': 'd',
- 'ƒ': 'f',
- '™': '(TM)',
- '©': '(C)',
- 'œ': 'oe',
- 'Œ': 'OE',
- '®': '(R)',
- '†': '+',
- '℠': '(SM)',
- '…': '...',
- '˚': 'o',
- 'º': 'o',
- 'ª': 'a',
- '•': '*',
- '၊': ',',
- '။': '.',
- // currency
- '$': 'USD',
- '€': 'EUR',
- '₢': 'BRN',
- '₣': 'FRF',
- '£': 'GBP',
- '₤': 'ITL',
- '₦': 'NGN',
- '₧': 'ESP',
- '₩': 'KRW',
- '₪': 'ILS',
- '₫': 'VND',
- '₭': 'LAK',
- '₮': 'MNT',
- '₯': 'GRD',
- '₱': 'ARS',
- '₲': 'PYG',
- '₳': 'ARA',
- '₴': 'UAH',
- '₵': 'GHS',
- '¢': 'cent',
- '¥': 'CNY',
- '元': 'CNY',
- '円': 'YEN',
- '﷼': 'IRR',
- '₠': 'EWE',
- '฿': 'THB',
- '₨': 'INR',
- '₹': 'INR',
- '₰': 'PF',
- '₺': 'TRY',
- '؋': 'AFN',
- '₼': 'AZN',
- 'лв': 'BGN',
- '៛': 'KHR',
- '₡': 'CRC',
- '₸': 'KZT',
- 'ден': 'MKD',
- 'zł': 'PLN',
- '₽': 'RUB',
- '₾': 'GEL'
- };
- /**
- * special look ahead character array
- * These characters form with consonants to become 'single'/consonant combo
- * @type [Array]
- */
- var lookAheadCharArray = [
- // burmese
- '်',
- // Dhivehi
- 'ް'
- ];
- /**
- * diatricMap for languages where transliteration changes entirely as more diatrics are added
- * @type {Object}
- */
- var diatricMap = {
- // Burmese
- // dependent vowels
- 'ာ': 'a',
- 'ါ': 'a',
- 'ေ': 'e',
- 'ဲ': 'e',
- 'ိ': 'i',
- 'ီ': 'i',
- 'ို': 'o',
- 'ု': 'u',
- 'ူ': 'u',
- 'ေါင်': 'aung',
- 'ော': 'aw',
- 'ော်': 'aw',
- 'ေါ': 'aw',
- 'ေါ်': 'aw',
- '်': '်', // this is special case but the character will be converted to latin in the code
- 'က်': 'et',
- 'ိုက်': 'aik',
- 'ောက်': 'auk',
- 'င်': 'in',
- 'ိုင်': 'aing',
- 'ောင်': 'aung',
- 'စ်': 'it',
- 'ည်': 'i',
- 'တ်': 'at',
- 'ိတ်': 'eik',
- 'ုတ်': 'ok',
- 'ွတ်': 'ut',
- 'ေတ်': 'it',
- 'ဒ်': 'd',
- 'ိုဒ်': 'ok',
- 'ုဒ်': 'ait',
- 'န်': 'an',
- 'ာန်': 'an',
- 'ိန်': 'ein',
- 'ုန်': 'on',
- 'ွန်': 'un',
- 'ပ်': 'at',
- 'ိပ်': 'eik',
- 'ုပ်': 'ok',
- 'ွပ်': 'ut',
- 'န်ုပ်': 'nub',
- 'မ်': 'an',
- 'ိမ်': 'ein',
- 'ုမ်': 'on',
- 'ွမ်': 'un',
- 'ယ်': 'e',
- 'ိုလ်': 'ol',
- 'ဉ်': 'in',
- 'ံ': 'an',
- 'ိံ': 'ein',
- 'ုံ': 'on',
- // Dhivehi
- 'ައް': 'ah',
- 'ަށް': 'ah'
- };
- /**
- * langCharMap language specific characters translations
- * @type {Object}
- */
- var langCharMap = {
- 'en': {}, // default language
- 'az': { // Azerbaijani
- 'ç': 'c',
- 'ə': 'e',
- 'ğ': 'g',
- 'ı': 'i',
- 'ö': 'o',
- 'ş': 's',
- 'ü': 'u',
- 'Ç': 'C',
- 'Ə': 'E',
- 'Ğ': 'G',
- 'İ': 'I',
- 'Ö': 'O',
- 'Ş': 'S',
- 'Ü': 'U'
- },
- 'cs': { // Czech
- 'č': 'c',
- 'ď': 'd',
- 'ě': 'e',
- 'ň': 'n',
- 'ř': 'r',
- 'š': 's',
- 'ť': 't',
- 'ů': 'u',
- 'ž': 'z',
- 'Č': 'C',
- 'Ď': 'D',
- 'Ě': 'E',
- 'Ň': 'N',
- 'Ř': 'R',
- 'Š': 'S',
- 'Ť': 'T',
- 'Ů': 'U',
- 'Ž': 'Z'
- },
- 'fi': { // Finnish
- // 'å': 'a', duplicate see charMap/latin
- // 'Å': 'A', duplicate see charMap/latin
- 'ä': 'a', // ok
- 'Ä': 'A', // ok
- 'ö': 'o', // ok
- 'Ö': 'O' // ok
- },
- 'hu': { // Hungarian
- 'ä': 'a', // ok
- 'Ä': 'A', // ok
- // 'á': 'a', duplicate see charMap/latin
- // 'Á': 'A', duplicate see charMap/latin
- 'ö': 'o', // ok
- 'Ö': 'O', // ok
- // 'ő': 'o', duplicate see charMap/latin
- // 'Ő': 'O', duplicate see charMap/latin
- 'ü': 'u',
- 'Ü': 'U',
- 'ű': 'u',
- 'Ű': 'U'
- },
- 'lt': { // Lithuanian
- 'ą': 'a',
- 'č': 'c',
- 'ę': 'e',
- 'ė': 'e',
- 'į': 'i',
- 'š': 's',
- 'ų': 'u',
- 'ū': 'u',
- 'ž': 'z',
- 'Ą': 'A',
- 'Č': 'C',
- 'Ę': 'E',
- 'Ė': 'E',
- 'Į': 'I',
- 'Š': 'S',
- 'Ų': 'U',
- 'Ū': 'U'
- },
- 'lv': { // Latvian
- 'ā': 'a',
- 'č': 'c',
- 'ē': 'e',
- 'ģ': 'g',
- 'ī': 'i',
- 'ķ': 'k',
- 'ļ': 'l',
- 'ņ': 'n',
- 'š': 's',
- 'ū': 'u',
- 'ž': 'z',
- 'Ā': 'A',
- 'Č': 'C',
- 'Ē': 'E',
- 'Ģ': 'G',
- 'Ī': 'i',
- 'Ķ': 'k',
- 'Ļ': 'L',
- 'Ņ': 'N',
- 'Š': 'S',
- 'Ū': 'u',
- 'Ž': 'Z'
- },
- 'pl': { // Polish
- 'ą': 'a',
- 'ć': 'c',
- 'ę': 'e',
- 'ł': 'l',
- 'ń': 'n',
- 'ó': 'o',
- 'ś': 's',
- 'ź': 'z',
- 'ż': 'z',
- 'Ą': 'A',
- 'Ć': 'C',
- 'Ę': 'e',
- 'Ł': 'L',
- 'Ń': 'N',
- 'Ó': 'O',
- 'Ś': 'S',
- 'Ź': 'Z',
- 'Ż': 'Z'
- },
- 'sv': { // Swedish
- // 'å': 'a', duplicate see charMap/latin
- // 'Å': 'A', duplicate see charMap/latin
- 'ä': 'a', // ok
- 'Ä': 'A', // ok
- 'ö': 'o', // ok
- 'Ö': 'O' // ok
- },
- 'sk': { // Slovak
- 'ä': 'a',
- 'Ä': 'A'
- },
- 'sr': { // Serbian
- 'љ': 'lj',
- 'њ': 'nj',
- 'Љ': 'Lj',
- 'Њ': 'Nj',
- 'đ': 'dj',
- 'Đ': 'Dj'
- },
- 'tr': { // Turkish
- 'Ü': 'U',
- 'Ö': 'O',
- 'ü': 'u',
- 'ö': 'o'
- }
- };
- /**
- * symbolMap language specific symbol translations
- * translations must be transliterated already
- * @type {Object}
- */
- var symbolMap = {
- 'ar': {
- '∆': 'delta',
- '∞': 'la-nihaya',
- '♥': 'hob',
- '&': 'wa',
- '|': 'aw',
- '<': 'aqal-men',
- '>': 'akbar-men',
- '∑': 'majmou',
- '¤': 'omla'
- },
- 'az': {},
- 'ca': {
- '∆': 'delta',
- '∞': 'infinit',
- '♥': 'amor',
- '&': 'i',
- '|': 'o',
- '<': 'menys que',
- '>': 'mes que',
- '∑': 'suma dels',
- '¤': 'moneda'
- },
- 'cs': {
- '∆': 'delta',
- '∞': 'nekonecno',
- '♥': 'laska',
- '&': 'a',
- '|': 'nebo',
- '<': 'mensi nez',
- '>': 'vetsi nez',
- '∑': 'soucet',
- '¤': 'mena'
- },
- 'de': {
- '∆': 'delta',
- '∞': 'unendlich',
- '♥': 'Liebe',
- '&': 'und',
- '|': 'oder',
- '<': 'kleiner als',
- '>': 'groesser als',
- '∑': 'Summe von',
- '¤': 'Waehrung'
- },
- 'dv': {
- '∆': 'delta',
- '∞': 'kolunulaa',
- '♥': 'loabi',
- '&': 'aai',
- '|': 'noonee',
- '<': 'ah vure kuda',
- '>': 'ah vure bodu',
- '∑': 'jumula',
- '¤': 'faisaa'
- },
- 'en': {
- '∆': 'delta',
- '∞': 'infinity',
- '♥': 'love',
- '&': 'and',
- '|': 'or',
- '<': 'less than',
- '>': 'greater than',
- '∑': 'sum',
- '¤': 'currency'
- },
- 'es': {
- '∆': 'delta',
- '∞': 'infinito',
- '♥': 'amor',
- '&': 'y',
- '|': 'u',
- '<': 'menos que',
- '>': 'mas que',
- '∑': 'suma de los',
- '¤': 'moneda'
- },
- 'fa': {
- '∆': 'delta',
- '∞': 'bi-nahayat',
- '♥': 'eshgh',
- '&': 'va',
- '|': 'ya',
- '<': 'kamtar-az',
- '>': 'bishtar-az',
- '∑': 'majmooe',
- '¤': 'vahed'
- },
- 'fi': {
- '∆': 'delta',
- '∞': 'aarettomyys',
- '♥': 'rakkaus',
- '&': 'ja',
- '|': 'tai',
- '<': 'pienempi kuin',
- '>': 'suurempi kuin',
- '∑': 'summa',
- '¤': 'valuutta'
- },
- 'fr': {
- '∆': 'delta',
- '∞': 'infiniment',
- '♥': 'Amour',
- '&': 'et',
- '|': 'ou',
- '<': 'moins que',
- '>': 'superieure a',
- '∑': 'somme des',
- '¤': 'monnaie'
- },
- 'ge': {
- '∆': 'delta',
- '∞': 'usasruloba',
- '♥': 'siqvaruli',
- '&': 'da',
- '|': 'an',
- '<': 'naklebi',
- '>': 'meti',
- '∑': 'jami',
- '¤': 'valuta'
- },
- 'gr': {},
- 'hu': {
- '∆': 'delta',
- '∞': 'vegtelen',
- '♥': 'szerelem',
- '&': 'es',
- '|': 'vagy',
- '<': 'kisebb mint',
- '>': 'nagyobb mint',
- '∑': 'szumma',
- '¤': 'penznem'
- },
- 'it': {
- '∆': 'delta',
- '∞': 'infinito',
- '♥': 'amore',
- '&': 'e',
- '|': 'o',
- '<': 'minore di',
- '>': 'maggiore di',
- '∑': 'somma',
- '¤': 'moneta'
- },
- 'lt': {
- '∆': 'delta',
- '∞': 'begalybe',
- '♥': 'meile',
- '&': 'ir',
- '|': 'ar',
- '<': 'maziau nei',
- '>': 'daugiau nei',
- '∑': 'suma',
- '¤': 'valiuta'
- },
- 'lv': {
- '∆': 'delta',
- '∞': 'bezgaliba',
- '♥': 'milestiba',
- '&': 'un',
- '|': 'vai',
- '<': 'mazak neka',
- '>': 'lielaks neka',
- '∑': 'summa',
- '¤': 'valuta'
- },
- 'my': {
- '∆': 'kwahkhyaet',
- '∞': 'asaonasme',
- '♥': 'akhyait',
- '&': 'nhin',
- '|': 'tho',
- '<': 'ngethaw',
- '>': 'kyithaw',
- '∑': 'paungld',
- '¤': 'ngwekye'
- },
- 'mk': {},
- 'nl': {
- '∆': 'delta',
- '∞': 'oneindig',
- '♥': 'liefde',
- '&': 'en',
- '|': 'of',
- '<': 'kleiner dan',
- '>': 'groter dan',
- '∑': 'som',
- '¤': 'valuta'
- },
- 'pl': {
- '∆': 'delta',
- '∞': 'nieskonczonosc',
- '♥': 'milosc',
- '&': 'i',
- '|': 'lub',
- '<': 'mniejsze niz',
- '>': 'wieksze niz',
- '∑': 'suma',
- '¤': 'waluta'
- },
- 'pt': {
- '∆': 'delta',
- '∞': 'infinito',
- '♥': 'amor',
- '&': 'e',
- '|': 'ou',
- '<': 'menor que',
- '>': 'maior que',
- '∑': 'soma',
- '¤': 'moeda'
- },
- 'ro': {
- '∆': 'delta',
- '∞': 'infinit',
- '♥': 'dragoste',
- '&': 'si',
- '|': 'sau',
- '<': 'mai mic ca',
- '>': 'mai mare ca',
- '∑': 'suma',
- '¤': 'valuta'
- },
- 'ru': {
- '∆': 'delta',
- '∞': 'beskonechno',
- '♥': 'lubov',
- '&': 'i',
- '|': 'ili',
- '<': 'menshe',
- '>': 'bolshe',
- '∑': 'summa',
- '¤': 'valjuta'
- },
- 'sk': {
- '∆': 'delta',
- '∞': 'nekonecno',
- '♥': 'laska',
- '&': 'a',
- '|': 'alebo',
- '<': 'menej ako',
- '>': 'viac ako',
- '∑': 'sucet',
- '¤': 'mena'
- },
- 'sr': {},
- 'tr': {
- '∆': 'delta',
- '∞': 'sonsuzluk',
- '♥': 'ask',
- '&': 've',
- '|': 'veya',
- '<': 'kucuktur',
- '>': 'buyuktur',
- '∑': 'toplam',
- '¤': 'para birimi'
- },
- 'uk': {
- '∆': 'delta',
- '∞': 'bezkinechnist',
- '♥': 'lubov',
- '&': 'i',
- '|': 'abo',
- '<': 'menshe',
- '>': 'bilshe',
- '∑': 'suma',
- '¤': 'valjuta'
- },
- 'vn': {
- '∆': 'delta',
- '∞': 'vo cuc',
- '♥': 'yeu',
- '&': 'va',
- '|': 'hoac',
- '<': 'nho hon',
- '>': 'lon hon',
- '∑': 'tong',
- '¤': 'tien te'
- }
- };
- var uricChars = [';', '?', ':', '@', '&', '=', '+', '$', ',', '/'].join('');
- var uricNoSlashChars = [';', '?', ':', '@', '&', '=', '+', '$', ','].join('');
- var markChars = ['.', '!', '~', '*', "'", '(', ')'].join('');
- /**
- * getSlug
- * @param {string} input input string
- * @param {object|string} opts config object or separator string/char
- * @api public
- * @return {string} sluggified string
- */
- var getSlug = function getSlug(input, opts) {
- var separator = '-';
- var result = '';
- var diatricString = '';
- var convertSymbols = true;
- var customReplacements = {};
- var maintainCase;
- var titleCase;
- var truncate;
- var uricFlag;
- var uricNoSlashFlag;
- var markFlag;
- var symbol;
- var langChar;
- var lucky;
- var i;
- var ch;
- var l;
- var lastCharWasSymbol;
- var lastCharWasDiatric;
- var allowedChars = '';
- if (typeof input !== 'string') {
- return '';
- }
- if (typeof opts === 'string') {
- separator = opts;
- }
- symbol = symbolMap.en;
- langChar = langCharMap.en;
- if (typeof opts === 'object') {
- maintainCase = opts.maintainCase || false;
- customReplacements = (opts.custom && typeof opts.custom === 'object') ? opts.custom : customReplacements;
- truncate = (+opts.truncate > 1 && opts.truncate) || false;
- uricFlag = opts.uric || false;
- uricNoSlashFlag = opts.uricNoSlash || false;
- markFlag = opts.mark || false;
- convertSymbols = (opts.symbols === false || opts.lang === false) ? false : true;
- separator = opts.separator || separator;
- if (uricFlag) {
- allowedChars += uricChars;
- }
- if (uricNoSlashFlag) {
- allowedChars += uricNoSlashChars;
- }
- if (markFlag) {
- allowedChars += markChars;
- }
- symbol = (opts.lang && symbolMap[opts.lang] && convertSymbols) ?
- symbolMap[opts.lang] : (convertSymbols ? symbolMap.en : {});
- langChar = (opts.lang && langCharMap[opts.lang]) ?
- langCharMap[opts.lang] :
- opts.lang === false || opts.lang === true ? {} : langCharMap.en;
- // if titleCase config is an Array, rewrite to object format
- if (opts.titleCase && typeof opts.titleCase.length === 'number' && Array.prototype.toString.call(opts.titleCase)) {
- opts.titleCase.forEach(function (v) {
- customReplacements[v + ''] = v + '';
- });
- titleCase = true;
- } else {
- titleCase = !!opts.titleCase;
- }
- // if custom config is an Array, rewrite to object format
- if (opts.custom && typeof opts.custom.length === 'number' && Array.prototype.toString.call(opts.custom)) {
- opts.custom.forEach(function (v) {
- customReplacements[v + ''] = v + '';
- });
- }
- // custom replacements
- Object.keys(customReplacements).forEach(function (v) {
- var r;
- if (v.length > 1) {
- r = new RegExp('\\b' + escapeChars(v) + '\\b', 'gi');
- } else {
- r = new RegExp(escapeChars(v), 'gi');
- }
- input = input.replace(r, customReplacements[v]);
- });
- // add all custom replacement to allowed charlist
- for (ch in customReplacements) {
- allowedChars += ch;
- }
- }
- allowedChars += separator;
- // escape all necessary chars
- allowedChars = escapeChars(allowedChars);
- // trim whitespaces
- input = input.replace(/(^\s+|\s+$)/g, '');
- lastCharWasSymbol = false;
- lastCharWasDiatric = false;
- for (i = 0, l = input.length; i < l; i++) {
- ch = input[i];
- if (isReplacedCustomChar(ch, customReplacements)) {
- // don't convert a already converted char
- lastCharWasSymbol = false;
- } else if (langChar[ch]) {
- // process language specific diactrics chars conversion
- ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? ' ' + langChar[ch] : langChar[ch];
- lastCharWasSymbol = false;
- } else if (ch in charMap) {
- // the transliteration changes entirely when some special characters are added
- if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {
- diatricString += ch;
- ch = '';
- } else if (lastCharWasDiatric === true) {
- ch = diatricMap[diatricString] + charMap[ch];
- diatricString = '';
- } else {
- // process diactrics chars
- ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? ' ' + charMap[ch] : charMap[ch];
- }
- lastCharWasSymbol = false;
- lastCharWasDiatric = false;
- } else if (ch in diatricMap) {
- diatricString += ch;
- ch = '';
- // end of string, put the whole meaningful word
- if (i === l - 1) {
- ch = diatricMap[diatricString];
- }
- lastCharWasDiatric = true;
- } else if (
- // process symbol chars
- symbol[ch] && !(uricFlag && uricChars
- .indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars
- // .indexOf(ch) !== -1) && !(markFlag && markChars
- .indexOf(ch) !== -1)) {
- ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
- ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : '';
- lastCharWasSymbol = true;
- } else {
- if (lastCharWasDiatric === true) {
- ch = diatricMap[diatricString] + ch;
- diatricString = '';
- lastCharWasDiatric = false;
- } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) {
- // process latin chars
- ch = ' ' + ch;
- }
- lastCharWasSymbol = false;
- }
- // add allowed chars
- result += ch.replace(new RegExp('[^\\w\\s' + allowedChars + '_-]', 'g'), separator);
- }
- if (titleCase) {
- result = result.replace(/(\w)(\S*)/g, function (_, i, r) {
- var j = i.toUpperCase() + (r !== null ? r : '');
- return (Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0) ? j : j.toLowerCase();
- });
- }
- // eliminate duplicate separators
- // add separator
- // trim separators from start and end
- result = result.replace(/\s+/g, separator)
- .replace(new RegExp('\\' + separator + '+', 'g'), separator)
- .replace(new RegExp('(^\\' + separator + '+|\\' + separator + '+$)', 'g'), '');
- if (truncate && result.length > truncate) {
- lucky = result.charAt(truncate) === separator;
- result = result.slice(0, truncate);
- if (!lucky) {
- result = result.slice(0, result.lastIndexOf(separator));
- }
- }
- if (!maintainCase && !titleCase) {
- result = result.toLowerCase();
- }
- return result;
- };
- /**
- * createSlug curried(opts)(input)
- * @param {object|string} opts config object or input string
- * @return {Function} function getSlugWithConfig()
- **/
- var createSlug = function createSlug(opts) {
- /**
- * getSlugWithConfig
- * @param {string} input string
- * @return {string} slug string
- */
- return function getSlugWithConfig(input) {
- return getSlug(input, opts);
- };
- };
- /**
- * escape Chars
- * @param {string} input string
- */
- var escapeChars = function escapeChars(input) {
- return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, '\\$&');
- };
- /**
- * check if the char is an already converted char from custom list
- * @param {char} ch character to check
- * @param {object} customReplacements custom translation map
- */
- var isReplacedCustomChar = function (ch, customReplacements) {
- for (var c in customReplacements) {
- if (customReplacements[c] === ch) {
- return true;
- }
- }
- };
- if ( true && module.exports) {
- // export functions for use in Node
- module.exports = getSlug;
- module.exports.createSlug = createSlug;
- } else if (true) {
- // export function for use in AMD
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
- return getSlug;
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
- })(this);
- /***/ }),
- /***/ 46226:
- /***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93379);
- /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7795);
- /* harmony import */ var _style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(90569);
- /* harmony import */ var _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3565);
- /* harmony import */ var _style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(70609);
- /* harmony import */ var _style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44589);
- /* harmony import */ var _style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _css_loader_dist_cjs_js_lint_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(39735);
-
-
-
-
-
-
-
-
-
- var options = {};
- options.styleTagTransform = (_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
- options.setAttributes = (_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
- options.insert = _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
-
- options.domAPI = (_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
- options.insertStyleElement = (_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
- var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_lint_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, options);
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (_css_loader_dist_cjs_js_lint_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z && _css_loader_dist_cjs_js_lint_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"].locals */ .Z.locals ? _css_loader_dist_cjs_js_lint_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"].locals */ .Z.locals : undefined);
- /***/ }),
- /***/ 93379:
- /***/ ((module) => {
- "use strict";
- var stylesInDOM = [];
- function getIndexByIdentifier(identifier) {
- var result = -1;
- for (var i = 0; i < stylesInDOM.length; i++) {
- if (stylesInDOM[i].identifier === identifier) {
- result = i;
- break;
- }
- }
- return result;
- }
- function modulesToDom(list, options) {
- var idCountMap = {};
- var identifiers = [];
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- var id = options.base ? item[0] + options.base : item[0];
- var count = idCountMap[id] || 0;
- var identifier = "".concat(id, " ").concat(count);
- idCountMap[id] = count + 1;
- var indexByIdentifier = getIndexByIdentifier(identifier);
- var obj = {
- css: item[1],
- media: item[2],
- sourceMap: item[3],
- supports: item[4],
- layer: item[5]
- };
- if (indexByIdentifier !== -1) {
- stylesInDOM[indexByIdentifier].references++;
- stylesInDOM[indexByIdentifier].updater(obj);
- } else {
- var updater = addElementStyle(obj, options);
- options.byIndex = i;
- stylesInDOM.splice(i, 0, {
- identifier: identifier,
- updater: updater,
- references: 1
- });
- }
- identifiers.push(identifier);
- }
- return identifiers;
- }
- function addElementStyle(obj, options) {
- var api = options.domAPI(options);
- api.update(obj);
- var updater = function updater(newObj) {
- if (newObj) {
- if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
- return;
- }
- api.update(obj = newObj);
- } else {
- api.remove();
- }
- };
- return updater;
- }
- module.exports = function (list, options) {
- options = options || {};
- list = list || [];
- var lastIdentifiers = modulesToDom(list, options);
- return function update(newList) {
- newList = newList || [];
- for (var i = 0; i < lastIdentifiers.length; i++) {
- var identifier = lastIdentifiers[i];
- var index = getIndexByIdentifier(identifier);
- stylesInDOM[index].references--;
- }
- var newLastIdentifiers = modulesToDom(newList, options);
- for (var _i = 0; _i < lastIdentifiers.length; _i++) {
- var _identifier = lastIdentifiers[_i];
- var _index = getIndexByIdentifier(_identifier);
- if (stylesInDOM[_index].references === 0) {
- stylesInDOM[_index].updater();
- stylesInDOM.splice(_index, 1);
- }
- }
- lastIdentifiers = newLastIdentifiers;
- };
- };
- /***/ }),
- /***/ 90569:
- /***/ ((module) => {
- "use strict";
- var memo = {};
- /* istanbul ignore next */
- function getTarget(target) {
- if (typeof memo[target] === "undefined") {
- var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
- if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
- try {
- // This will throw an exception if access to iframe is blocked
- // due to cross-origin restrictions
- styleTarget = styleTarget.contentDocument.head;
- } catch (e) {
- // istanbul ignore next
- styleTarget = null;
- }
- }
- memo[target] = styleTarget;
- }
- return memo[target];
- }
- /* istanbul ignore next */
- function insertBySelector(insert, style) {
- var target = getTarget(insert);
- if (!target) {
- throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
- }
- target.appendChild(style);
- }
- module.exports = insertBySelector;
- /***/ }),
- /***/ 70609:
- /***/ ((module) => {
- "use strict";
- /* istanbul ignore next */
- function insertStyleElement(options) {
- var element = document.createElement("style");
- options.setAttributes(element, options.attributes);
- options.insert(element, options.options);
- return element;
- }
- module.exports = insertStyleElement;
- /***/ }),
- /***/ 3565:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* istanbul ignore next */
- function setAttributesWithoutAttributes(styleElement) {
- var nonce = true ? __webpack_require__.nc : 0;
- if (nonce) {
- styleElement.setAttribute("nonce", nonce);
- }
- }
- module.exports = setAttributesWithoutAttributes;
- /***/ }),
- /***/ 7795:
- /***/ ((module) => {
- "use strict";
- /* istanbul ignore next */
- function apply(styleElement, options, obj) {
- var css = "";
- if (obj.supports) {
- css += "@supports (".concat(obj.supports, ") {");
- }
- if (obj.media) {
- css += "@media ".concat(obj.media, " {");
- }
- var needLayer = typeof obj.layer !== "undefined";
- if (needLayer) {
- css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
- }
- css += obj.css;
- if (needLayer) {
- css += "}";
- }
- if (obj.media) {
- css += "}";
- }
- if (obj.supports) {
- css += "}";
- }
- var sourceMap = obj.sourceMap;
- if (sourceMap && typeof btoa !== "undefined") {
- css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
- } // For old IE
- /* istanbul ignore if */
- options.styleTagTransform(css, styleElement, options.options);
- }
- function removeStyleElement(styleElement) {
- // istanbul ignore if
- if (styleElement.parentNode === null) {
- return false;
- }
- styleElement.parentNode.removeChild(styleElement);
- }
- /* istanbul ignore next */
- function domAPI(options) {
- var styleElement = options.insertStyleElement(options);
- return {
- update: function update(obj) {
- apply(styleElement, options, obj);
- },
- remove: function remove() {
- removeStyleElement(styleElement);
- }
- };
- }
- module.exports = domAPI;
- /***/ }),
- /***/ 44589:
- /***/ ((module) => {
- "use strict";
- /* istanbul ignore next */
- function styleTagTransform(css, styleElement) {
- if (styleElement.styleSheet) {
- styleElement.styleSheet.cssText = css;
- } else {
- while (styleElement.firstChild) {
- styleElement.removeChild(styleElement.firstChild);
- }
- styleElement.appendChild(document.createTextNode(css));
- }
- }
- module.exports = styleTagTransform;
- /***/ }),
- /***/ 8901:
- /***/ ((module, exports, __webpack_require__) => {
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
- * Toastr
- * Copyright 2012-2015
- * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.
- * All Rights Reserved.
- * Use, reproduction, distribution, and modification of this code is subject to the terms and
- * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
- *
- * ARIA Support: Greta Krafsig
- *
- * Project: https://github.com/CodeSeven/toastr
- */
- /* global define */
- (function (define) {
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(65311)], __WEBPACK_AMD_DEFINE_RESULT__ = (function ($) {
- return (function () {
- var $container;
- var listener;
- var toastId = 0;
- var toastType = {
- error: 'error',
- info: 'info',
- success: 'success',
- warning: 'warning'
- };
- var toastr = {
- clear: clear,
- remove: remove,
- error: error,
- getContainer: getContainer,
- info: info,
- options: {},
- subscribe: subscribe,
- success: success,
- version: '2.1.4',
- warning: warning
- };
- var previousToast;
- return toastr;
- ////////////////
- function error(message, title, optionsOverride) {
- return notify({
- type: toastType.error,
- iconClass: getOptions().iconClasses.error,
- message: message,
- optionsOverride: optionsOverride,
- title: title
- });
- }
- function getContainer(options, create) {
- if (!options) { options = getOptions(); }
- $container = $('#' + options.containerId);
- if ($container.length) {
- return $container;
- }
- if (create) {
- $container = createContainer(options);
- }
- return $container;
- }
- function info(message, title, optionsOverride) {
- return notify({
- type: toastType.info,
- iconClass: getOptions().iconClasses.info,
- message: message,
- optionsOverride: optionsOverride,
- title: title
- });
- }
- function subscribe(callback) {
- listener = callback;
- }
- function success(message, title, optionsOverride) {
- return notify({
- type: toastType.success,
- iconClass: getOptions().iconClasses.success,
- message: message,
- optionsOverride: optionsOverride,
- title: title
- });
- }
- function warning(message, title, optionsOverride) {
- return notify({
- type: toastType.warning,
- iconClass: getOptions().iconClasses.warning,
- message: message,
- optionsOverride: optionsOverride,
- title: title
- });
- }
- function clear($toastElement, clearOptions) {
- var options = getOptions();
- if (!$container) { getContainer(options); }
- if (!clearToast($toastElement, options, clearOptions)) {
- clearContainer(options);
- }
- }
- function remove($toastElement) {
- var options = getOptions();
- if (!$container) { getContainer(options); }
- if ($toastElement && $(':focus', $toastElement).length === 0) {
- removeToast($toastElement);
- return;
- }
- if ($container.children().length) {
- $container.remove();
- }
- }
- // internal functions
- function clearContainer (options) {
- var toastsToClear = $container.children();
- for (var i = toastsToClear.length - 1; i >= 0; i--) {
- clearToast($(toastsToClear[i]), options);
- }
- }
- function clearToast ($toastElement, options, clearOptions) {
- var force = clearOptions && clearOptions.force ? clearOptions.force : false;
- if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
- $toastElement[options.hideMethod]({
- duration: options.hideDuration,
- easing: options.hideEasing,
- complete: function () { removeToast($toastElement); }
- });
- return true;
- }
- return false;
- }
- function createContainer(options) {
- $container = $('<div/>')
- .attr('id', options.containerId)
- .addClass(options.positionClass);
- $container.appendTo($(options.target));
- return $container;
- }
- function getDefaults() {
- return {
- tapToDismiss: true,
- toastClass: 'toast',
- containerId: 'toast-container',
- debug: false,
- showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
- showDuration: 300,
- showEasing: 'swing', //swing and linear are built into jQuery
- onShown: undefined,
- hideMethod: 'fadeOut',
- hideDuration: 1000,
- hideEasing: 'swing',
- onHidden: undefined,
- closeMethod: false,
- closeDuration: false,
- closeEasing: false,
- closeOnHover: true,
- extendedTimeOut: 1000,
- iconClasses: {
- error: 'toast-error',
- info: 'toast-info',
- success: 'toast-success',
- warning: 'toast-warning'
- },
- iconClass: 'toast-info',
- positionClass: 'toast-top-right',
- timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
- titleClass: 'toast-title',
- messageClass: 'toast-message',
- escapeHtml: false,
- target: 'body',
- closeHtml: '<button type="button">×</button>',
- closeClass: 'toast-close-button',
- newestOnTop: true,
- preventDuplicates: false,
- progressBar: false,
- progressClass: 'toast-progress',
- rtl: false
- };
- }
- function publish(args) {
- if (!listener) { return; }
- listener(args);
- }
- function notify(map) {
- var options = getOptions();
- var iconClass = map.iconClass || options.iconClass;
- if (typeof (map.optionsOverride) !== 'undefined') {
- options = $.extend(options, map.optionsOverride);
- iconClass = map.optionsOverride.iconClass || iconClass;
- }
- if (shouldExit(options, map)) { return; }
- toastId++;
- $container = getContainer(options, true);
- var intervalId = null;
- var $toastElement = $('<div/>');
- var $titleElement = $('<div/>');
- var $messageElement = $('<div/>');
- var $progressElement = $('<div/>');
- var $closeElement = $(options.closeHtml);
- var progressBar = {
- intervalId: null,
- hideEta: null,
- maxHideTime: null
- };
- var response = {
- toastId: toastId,
- state: 'visible',
- startTime: new Date(),
- options: options,
- map: map
- };
- personalizeToast();
- displayToast();
- handleEvents();
- publish(response);
- if (options.debug && console) {
- console.log(response);
- }
- return $toastElement;
- function escapeHtml(source) {
- if (source == null) {
- source = '';
- }
- return source
- .replace(/&/g, '&')
- .replace(/"/g, '"')
- .replace(/'/g, ''')
- .replace(/</g, '<')
- .replace(/>/g, '>');
- }
- function personalizeToast() {
- setIcon();
- setTitle();
- setMessage();
- setCloseButton();
- setProgressBar();
- setRTL();
- setSequence();
- setAria();
- }
- function setAria() {
- var ariaValue = '';
- switch (map.iconClass) {
- case 'toast-success':
- case 'toast-info':
- ariaValue = 'polite';
- break;
- default:
- ariaValue = 'assertive';
- }
- $toastElement.attr('aria-live', ariaValue);
- }
- function handleEvents() {
- if (options.closeOnHover) {
- $toastElement.hover(stickAround, delayedHideToast);
- }
- if (!options.onclick && options.tapToDismiss) {
- $toastElement.click(hideToast);
- }
- if (options.closeButton && $closeElement) {
- $closeElement.click(function (event) {
- if (event.stopPropagation) {
- event.stopPropagation();
- } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
- event.cancelBubble = true;
- }
- if (options.onCloseClick) {
- options.onCloseClick(event);
- }
- hideToast(true);
- });
- }
- if (options.onclick) {
- $toastElement.click(function (event) {
- options.onclick(event);
- hideToast();
- });
- }
- }
- function displayToast() {
- $toastElement.hide();
- $toastElement[options.showMethod](
- {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
- );
- if (options.timeOut > 0) {
- intervalId = setTimeout(hideToast, options.timeOut);
- progressBar.maxHideTime = parseFloat(options.timeOut);
- progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
- if (options.progressBar) {
- progressBar.intervalId = setInterval(updateProgress, 10);
- }
- }
- }
- function setIcon() {
- if (map.iconClass) {
- $toastElement.addClass(options.toastClass).addClass(iconClass);
- }
- }
- function setSequence() {
- if (options.newestOnTop) {
- $container.prepend($toastElement);
- } else {
- $container.append($toastElement);
- }
- }
- function setTitle() {
- if (map.title) {
- var suffix = map.title;
- if (options.escapeHtml) {
- suffix = escapeHtml(map.title);
- }
- $titleElement.append(suffix).addClass(options.titleClass);
- $toastElement.append($titleElement);
- }
- }
- function setMessage() {
- if (map.message) {
- var suffix = map.message;
- if (options.escapeHtml) {
- suffix = escapeHtml(map.message);
- }
- $messageElement.append(suffix).addClass(options.messageClass);
- $toastElement.append($messageElement);
- }
- }
- function setCloseButton() {
- if (options.closeButton) {
- $closeElement.addClass(options.closeClass).attr('role', 'button');
- $toastElement.prepend($closeElement);
- }
- }
- function setProgressBar() {
- if (options.progressBar) {
- $progressElement.addClass(options.progressClass);
- $toastElement.prepend($progressElement);
- }
- }
- function setRTL() {
- if (options.rtl) {
- $toastElement.addClass('rtl');
- }
- }
- function shouldExit(options, map) {
- if (options.preventDuplicates) {
- if (map.message === previousToast) {
- return true;
- } else {
- previousToast = map.message;
- }
- }
- return false;
- }
- function hideToast(override) {
- var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;
- var duration = override && options.closeDuration !== false ?
- options.closeDuration : options.hideDuration;
- var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;
- if ($(':focus', $toastElement).length && !override) {
- return;
- }
- clearTimeout(progressBar.intervalId);
- return $toastElement[method]({
- duration: duration,
- easing: easing,
- complete: function () {
- removeToast($toastElement);
- clearTimeout(intervalId);
- if (options.onHidden && response.state !== 'hidden') {
- options.onHidden();
- }
- response.state = 'hidden';
- response.endTime = new Date();
- publish(response);
- }
- });
- }
- function delayedHideToast() {
- if (options.timeOut > 0 || options.extendedTimeOut > 0) {
- intervalId = setTimeout(hideToast, options.extendedTimeOut);
- progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
- progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
- }
- }
- function stickAround() {
- clearTimeout(intervalId);
- progressBar.hideEta = 0;
- $toastElement.stop(true, true)[options.showMethod](
- {duration: options.showDuration, easing: options.showEasing}
- );
- }
- function updateProgress() {
- var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
- $progressElement.width(percentage + '%');
- }
- }
- function getOptions() {
- return $.extend({}, getDefaults(), toastr.options);
- }
- function removeToast($toastElement) {
- if (!$container) { $container = getContainer(); }
- if ($toastElement.is(':visible')) {
- return;
- }
- $toastElement.remove();
- $toastElement = null;
- if ($container.children().length === 0) {
- $container.remove();
- previousToast = undefined;
- }
- }
- })();
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- }(__webpack_require__.amdD));
- /***/ }),
- /***/ 29950:
- /***/ ((module) => {
- "use strict";
- /**
- * DEVELOPED BY
- * GIL LOPES BUENO
- * gilbueno.mail@gmail.com
- *
- * WORKS WITH:
- * IE 9+, FF 4+, SF 5+, WebKit, CH 7+, OP 12+, BESEN, Rhino 1.7+
- *
- * FORK:
- * https://github.com/melanke/Watch.JS
- */
- (function (factory) {
- if (true) {
- // Node. Does not work with strict CommonJS, but
- // only CommonJS-like enviroments that support module.exports,
- // like Node.
- module.exports = factory();
- } else {}
- }(function () {
- var WatchJS = {
- noMore: false
- },
- defineWatcher,
- unwatchOne,
- callWatchers;
- var isFunction = function (functionToCheck) {
- var getType = {};
- return functionToCheck && getType.toString.call(functionToCheck) == '[object Function]';
- };
- var isInt = function (x) {
- return x % 1 === 0;
- };
- var isArray = function(obj) {
- return Object.prototype.toString.call(obj) === '[object Array]';
- };
- var isModernBrowser = function () {
- return Object.defineProperty || Object.prototype.__defineGetter__;
- };
- var defineGetAndSet = function (obj, propName, getter, setter) {
- try {
- Object.defineProperty(obj, propName, {
- get: getter,
- set: setter,
- enumerable: true,
- configurable: true
- });
- } catch(error) {
- try{
- Object.prototype.__defineGetter__.call(obj, propName, getter);
- Object.prototype.__defineSetter__.call(obj, propName, setter);
- }catch(error2){
- throw "watchJS error: browser not supported :/"
- }
- }
- };
- var defineProp = function (obj, propName, value) {
- try {
- Object.defineProperty(obj, propName, {
- enumerable: false,
- configurable: true,
- writable: false,
- value: value
- });
- } catch(error) {
- obj[propName] = value;
- }
- };
- var watch = function () {
- if (isFunction(arguments[1])) {
- watchAll.apply(this, arguments);
- } else if (isArray(arguments[1])) {
- watchMany.apply(this, arguments);
- } else {
- watchOne.apply(this, arguments);
- }
- };
- var watchAll = function (obj, watcher, level) {
- if (obj instanceof String || (!(obj instanceof Object) && !isArray(obj))) { //accepts only objects and array (not string)
- return;
- }
- var props = [];
- if(isArray(obj)) {
- for (var prop = 0; prop < obj.length; prop++) { //for each item if obj is an array
- props.push(prop); //put in the props
- }
- } else {
- for (var prop2 in obj) { //for each attribute if obj is an object
- props.push(prop2); //put in the props
- }
- }
- watchMany(obj, props, watcher, level); //watch all itens of the props
- };
- var watchMany = function (obj, props, watcher, level) {
- for (var prop in props) { //watch each attribute of "props" if is an object
- watchOne(obj, props[prop], watcher, level);
- }
- };
- var watchOne = function (obj, prop, watcher, level) {
- if(isFunction(obj[prop])) { //dont watch if it is a function
- return;
- }
- if(obj[prop] != null && (level === undefined || level > 0)){
- if(level !== undefined){
- level--;
- }
- watchAll(obj[prop], watcher, level); //recursively watch all attributes of this
- }
- defineWatcher(obj, prop, watcher);
- };
- var unwatch = function () {
- if (isFunction(arguments[1])) {
- unwatchAll.apply(this, arguments);
- } else if (isArray(arguments[1])) {
- unwatchMany.apply(this, arguments);
- } else {
- unwatchOne.apply(this, arguments);
- }
- };
- var unwatchAll = function (obj, watcher) {
- if (obj instanceof String || (!(obj instanceof Object) && !isArray(obj))) { //accepts only objects and array (not string)
- return;
- }
- var props = [];
- if (isArray(obj)) {
- for (var prop = 0; prop < obj.length; prop++) { //for each item if obj is an array
- props.push(prop); //put in the props
- }
- } else {
- for (var prop2 in obj) { //for each attribute if obj is an object
- props.push(prop2); //put in the props
- }
- }
- unwatchMany(obj, props, watcher); //watch all itens of the props
- };
- var unwatchMany = function (obj, props, watcher) {
- for (var prop2 in props) { //watch each attribute of "props" if is an object
- unwatchOne(obj, props[prop2], watcher);
- }
- };
- if(isModernBrowser()){
- defineWatcher = function (obj, prop, watcher) {
- var val = obj[prop];
- watchFunctions(obj, prop);
- if (!obj.watchers) {
- defineProp(obj, "watchers", {});
- }
- if (!obj.watchers[prop]) {
- obj.watchers[prop] = [];
- }
- obj.watchers[prop].push(watcher); //add the new watcher in the watchers array
- var getter = function () {
- return val;
- };
- var setter = function (newval) {
- var oldval = val;
- val = newval;
- if (obj[prop]){
- watchAll(obj[prop], watcher);
- }
- watchFunctions(obj, prop);
- if (!WatchJS.noMore){
- if (JSON.stringify(oldval) !== JSON.stringify(newval)) {
- callWatchers(obj, prop, "set", newval, oldval);
- WatchJS.noMore = false;
- }
- }
- };
- defineGetAndSet(obj, prop, getter, setter);
- };
- callWatchers = function (obj, prop, action, newval, oldval) {
- for (var wr in obj.watchers[prop]) {
- if (isInt(wr)){
- obj.watchers[prop][wr].call(obj, prop, action, newval, oldval);
- }
- }
- };
- // @todo code related to "watchFunctions" is certainly buggy
- var methodNames = ['pop', 'push', 'reverse', 'shift', 'sort', 'slice', 'unshift'];
- var defineArrayMethodWatcher = function (obj, prop, original, methodName) {
- defineProp(obj[prop], methodName, function () {
- var response = original.apply(obj[prop], arguments);
- watchOne(obj, obj[prop]);
- if (methodName !== 'slice') {
- callWatchers(obj, prop, methodName,arguments);
- }
- return response;
- });
- };
- var watchFunctions = function(obj, prop) {
- if ((!obj[prop]) || (obj[prop] instanceof String) || (!isArray(obj[prop]))) {
- return;
- }
- for (var i = methodNames.length, methodName; i--;) {
- methodName = methodNames[i];
- defineArrayMethodWatcher(obj, prop, obj[prop][methodName], methodName);
- }
- };
- unwatchOne = function (obj, prop, watcher) {
- for(var i in obj.watchers[prop]){
- var w = obj.watchers[prop][i];
- if(w == watcher) {
- obj.watchers[prop].splice(i, 1);
- }
- }
- };
- } else {
- //this implementation dont work because it cant handle the gap between "settings".
- //I mean, if you use a setter for an attribute after another setter of the same attribute it will only fire the second
- //but I think we could think something to fix it
- var subjects = [];
- defineWatcher = function(obj, prop, watcher){
- subjects.push({
- obj: obj,
- prop: prop,
- serialized: JSON.stringify(obj[prop]),
- watcher: watcher
- });
- };
- unwatchOne = function (obj, prop, watcher) {
- for (var i in subjects) {
- var subj = subjects[i];
- if (subj.obj == obj && subj.prop == prop && subj.watcher == watcher) {
- subjects.splice(i, 1);
- }
- }
- };
- callWatchers = function (obj, prop, action, value) {
- for (var i in subjects) {
- var subj = subjects[i];
- if (subj.obj == obj && subj.prop == prop) {
- subj.watcher.call(obj, prop, action, value);
- }
- }
- };
- var loop = function(){
- for(var i in subjects){
- var subj = subjects[i];
- var newSer = JSON.stringify(subj.obj[subj.prop]);
- if(newSer != subj.serialized){
- subj.watcher.call(subj.obj, subj.prop, subj.obj[subj.prop], JSON.parse(subj.serialized));
- subj.serialized = newSer;
- }
- }
- };
- setInterval(loop, 50);
- }
- WatchJS.watch = watch;
- WatchJS.unwatch = unwatch;
- WatchJS.callWatchers = callWatchers;
- return WatchJS;
- }));
- /***/ }),
- /***/ 1272:
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* unused harmony exports CORE_SCHEMA, DEFAULT_SCHEMA, FAILSAFE_SCHEMA, JSON_SCHEMA, Schema, Type, YAMLException, dump, load, loadAll, safeDump, safeLoad, safeLoadAll, types */
- /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
- function isNothing(subject) {
- return (typeof subject === 'undefined') || (subject === null);
- }
- function isObject(subject) {
- return (typeof subject === 'object') && (subject !== null);
- }
- function toArray(sequence) {
- if (Array.isArray(sequence)) return sequence;
- else if (isNothing(sequence)) return [];
- return [ sequence ];
- }
- function extend(target, source) {
- var index, length, key, sourceKeys;
- if (source) {
- sourceKeys = Object.keys(source);
- for (index = 0, length = sourceKeys.length; index < length; index += 1) {
- key = sourceKeys[index];
- target[key] = source[key];
- }
- }
- return target;
- }
- function repeat(string, count) {
- var result = '', cycle;
- for (cycle = 0; cycle < count; cycle += 1) {
- result += string;
- }
- return result;
- }
- function isNegativeZero(number) {
- return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
- }
- var isNothing_1 = isNothing;
- var isObject_1 = isObject;
- var toArray_1 = toArray;
- var repeat_1 = repeat;
- var isNegativeZero_1 = isNegativeZero;
- var extend_1 = extend;
- var common = {
- isNothing: isNothing_1,
- isObject: isObject_1,
- toArray: toArray_1,
- repeat: repeat_1,
- isNegativeZero: isNegativeZero_1,
- extend: extend_1
- };
- // YAML error class. http://stackoverflow.com/questions/8458984
- function formatError(exception, compact) {
- var where = '', message = exception.reason || '(unknown reason)';
- if (!exception.mark) return message;
- if (exception.mark.name) {
- where += 'in "' + exception.mark.name + '" ';
- }
- where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';
- if (!compact && exception.mark.snippet) {
- where += '\n\n' + exception.mark.snippet;
- }
- return message + ' ' + where;
- }
- function YAMLException$1(reason, mark) {
- // Super constructor
- Error.call(this);
- this.name = 'YAMLException';
- this.reason = reason;
- this.mark = mark;
- this.message = formatError(this, false);
- // Include stack trace in error object
- if (Error.captureStackTrace) {
- // Chrome and NodeJS
- Error.captureStackTrace(this, this.constructor);
- } else {
- // FF, IE 10+ and Safari 6+. Fallback for others
- this.stack = (new Error()).stack || '';
- }
- }
- // Inherit from Error
- YAMLException$1.prototype = Object.create(Error.prototype);
- YAMLException$1.prototype.constructor = YAMLException$1;
- YAMLException$1.prototype.toString = function toString(compact) {
- return this.name + ': ' + formatError(this, compact);
- };
- var exception = YAMLException$1;
- // get snippet for a single line, respecting maxLength
- function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
- var head = '';
- var tail = '';
- var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
- if (position - lineStart > maxHalfLength) {
- head = ' ... ';
- lineStart = position - maxHalfLength + head.length;
- }
- if (lineEnd - position > maxHalfLength) {
- tail = ' ...';
- lineEnd = position + maxHalfLength - tail.length;
- }
- return {
- str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail,
- pos: position - lineStart + head.length // relative position
- };
- }
- function padStart(string, max) {
- return common.repeat(' ', max - string.length) + string;
- }
- function makeSnippet(mark, options) {
- options = Object.create(options || null);
- if (!mark.buffer) return null;
- if (!options.maxLength) options.maxLength = 79;
- if (typeof options.indent !== 'number') options.indent = 1;
- if (typeof options.linesBefore !== 'number') options.linesBefore = 3;
- if (typeof options.linesAfter !== 'number') options.linesAfter = 2;
- var re = /\r?\n|\r|\0/g;
- var lineStarts = [ 0 ];
- var lineEnds = [];
- var match;
- var foundLineNo = -1;
- while ((match = re.exec(mark.buffer))) {
- lineEnds.push(match.index);
- lineStarts.push(match.index + match[0].length);
- if (mark.position <= match.index && foundLineNo < 0) {
- foundLineNo = lineStarts.length - 2;
- }
- }
- if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
- var result = '', i, line;
- var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
- var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
- for (i = 1; i <= options.linesBefore; i++) {
- if (foundLineNo - i < 0) break;
- line = getLine(
- mark.buffer,
- lineStarts[foundLineNo - i],
- lineEnds[foundLineNo - i],
- mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
- maxLineLength
- );
- result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +
- ' | ' + line.str + '\n' + result;
- }
- line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
- result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +
- ' | ' + line.str + '\n';
- result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n';
- for (i = 1; i <= options.linesAfter; i++) {
- if (foundLineNo + i >= lineEnds.length) break;
- line = getLine(
- mark.buffer,
- lineStarts[foundLineNo + i],
- lineEnds[foundLineNo + i],
- mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
- maxLineLength
- );
- result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +
- ' | ' + line.str + '\n';
- }
- return result.replace(/\n$/, '');
- }
- var snippet = makeSnippet;
- var TYPE_CONSTRUCTOR_OPTIONS = [
- 'kind',
- 'multi',
- 'resolve',
- 'construct',
- 'instanceOf',
- 'predicate',
- 'represent',
- 'representName',
- 'defaultStyle',
- 'styleAliases'
- ];
- var YAML_NODE_KINDS = [
- 'scalar',
- 'sequence',
- 'mapping'
- ];
- function compileStyleAliases(map) {
- var result = {};
- if (map !== null) {
- Object.keys(map).forEach(function (style) {
- map[style].forEach(function (alias) {
- result[String(alias)] = style;
- });
- });
- }
- return result;
- }
- function Type$1(tag, options) {
- options = options || {};
- Object.keys(options).forEach(function (name) {
- if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
- throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
- }
- });
- // TODO: Add tag format check.
- this.options = options; // keep original options in case user wants to extend this type later
- this.tag = tag;
- this.kind = options['kind'] || null;
- this.resolve = options['resolve'] || function () { return true; };
- this.construct = options['construct'] || function (data) { return data; };
- this.instanceOf = options['instanceOf'] || null;
- this.predicate = options['predicate'] || null;
- this.represent = options['represent'] || null;
- this.representName = options['representName'] || null;
- this.defaultStyle = options['defaultStyle'] || null;
- this.multi = options['multi'] || false;
- this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
- if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
- throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
- }
- }
- var type = Type$1;
- /*eslint-disable max-len*/
- function compileList(schema, name) {
- var result = [];
- schema[name].forEach(function (currentType) {
- var newIndex = result.length;
- result.forEach(function (previousType, previousIndex) {
- if (previousType.tag === currentType.tag &&
- previousType.kind === currentType.kind &&
- previousType.multi === currentType.multi) {
- newIndex = previousIndex;
- }
- });
- result[newIndex] = currentType;
- });
- return result;
- }
- function compileMap(/* lists... */) {
- var result = {
- scalar: {},
- sequence: {},
- mapping: {},
- fallback: {},
- multi: {
- scalar: [],
- sequence: [],
- mapping: [],
- fallback: []
- }
- }, index, length;
- function collectType(type) {
- if (type.multi) {
- result.multi[type.kind].push(type);
- result.multi['fallback'].push(type);
- } else {
- result[type.kind][type.tag] = result['fallback'][type.tag] = type;
- }
- }
- for (index = 0, length = arguments.length; index < length; index += 1) {
- arguments[index].forEach(collectType);
- }
- return result;
- }
- function Schema$1(definition) {
- return this.extend(definition);
- }
- Schema$1.prototype.extend = function extend(definition) {
- var implicit = [];
- var explicit = [];
- if (definition instanceof type) {
- // Schema.extend(type)
- explicit.push(definition);
- } else if (Array.isArray(definition)) {
- // Schema.extend([ type1, type2, ... ])
- explicit = explicit.concat(definition);
- } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
- // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })
- if (definition.implicit) implicit = implicit.concat(definition.implicit);
- if (definition.explicit) explicit = explicit.concat(definition.explicit);
- } else {
- throw new exception('Schema.extend argument should be a Type, [ Type ], ' +
- 'or a schema definition ({ implicit: [...], explicit: [...] })');
- }
- implicit.forEach(function (type$1) {
- if (!(type$1 instanceof type)) {
- throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
- }
- if (type$1.loadKind && type$1.loadKind !== 'scalar') {
- throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
- }
- if (type$1.multi) {
- throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');
- }
- });
- explicit.forEach(function (type$1) {
- if (!(type$1 instanceof type)) {
- throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
- }
- });
- var result = Object.create(Schema$1.prototype);
- result.implicit = (this.implicit || []).concat(implicit);
- result.explicit = (this.explicit || []).concat(explicit);
- result.compiledImplicit = compileList(result, 'implicit');
- result.compiledExplicit = compileList(result, 'explicit');
- result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
- return result;
- };
- var schema = Schema$1;
- var str = new type('tag:yaml.org,2002:str', {
- kind: 'scalar',
- construct: function (data) { return data !== null ? data : ''; }
- });
- var seq = new type('tag:yaml.org,2002:seq', {
- kind: 'sequence',
- construct: function (data) { return data !== null ? data : []; }
- });
- var map = new type('tag:yaml.org,2002:map', {
- kind: 'mapping',
- construct: function (data) { return data !== null ? data : {}; }
- });
- var failsafe = new schema({
- explicit: [
- str,
- seq,
- map
- ]
- });
- function resolveYamlNull(data) {
- if (data === null) return true;
- var max = data.length;
- return (max === 1 && data === '~') ||
- (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
- }
- function constructYamlNull() {
- return null;
- }
- function isNull(object) {
- return object === null;
- }
- var _null = new type('tag:yaml.org,2002:null', {
- kind: 'scalar',
- resolve: resolveYamlNull,
- construct: constructYamlNull,
- predicate: isNull,
- represent: {
- canonical: function () { return '~'; },
- lowercase: function () { return 'null'; },
- uppercase: function () { return 'NULL'; },
- camelcase: function () { return 'Null'; },
- empty: function () { return ''; }
- },
- defaultStyle: 'lowercase'
- });
- function resolveYamlBoolean(data) {
- if (data === null) return false;
- var max = data.length;
- return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
- (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
- }
- function constructYamlBoolean(data) {
- return data === 'true' ||
- data === 'True' ||
- data === 'TRUE';
- }
- function isBoolean(object) {
- return Object.prototype.toString.call(object) === '[object Boolean]';
- }
- var bool = new type('tag:yaml.org,2002:bool', {
- kind: 'scalar',
- resolve: resolveYamlBoolean,
- construct: constructYamlBoolean,
- predicate: isBoolean,
- represent: {
- lowercase: function (object) { return object ? 'true' : 'false'; },
- uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
- camelcase: function (object) { return object ? 'True' : 'False'; }
- },
- defaultStyle: 'lowercase'
- });
- function isHexCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
- ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
- ((0x61/* a */ <= c) && (c <= 0x66/* f */));
- }
- function isOctCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
- }
- function isDecCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
- }
- function resolveYamlInteger(data) {
- if (data === null) return false;
- var max = data.length,
- index = 0,
- hasDigits = false,
- ch;
- if (!max) return false;
- ch = data[index];
- // sign
- if (ch === '-' || ch === '+') {
- ch = data[++index];
- }
- if (ch === '0') {
- // 0
- if (index + 1 === max) return true;
- ch = data[++index];
- // base 2, base 8, base 16
- if (ch === 'b') {
- // base 2
- index++;
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (ch !== '0' && ch !== '1') return false;
- hasDigits = true;
- }
- return hasDigits && ch !== '_';
- }
- if (ch === 'x') {
- // base 16
- index++;
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (!isHexCode(data.charCodeAt(index))) return false;
- hasDigits = true;
- }
- return hasDigits && ch !== '_';
- }
- if (ch === 'o') {
- // base 8
- index++;
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (!isOctCode(data.charCodeAt(index))) return false;
- hasDigits = true;
- }
- return hasDigits && ch !== '_';
- }
- }
- // base 10 (except 0)
- // value should not start with `_`;
- if (ch === '_') return false;
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (!isDecCode(data.charCodeAt(index))) {
- return false;
- }
- hasDigits = true;
- }
- // Should have digits and should not end with `_`
- if (!hasDigits || ch === '_') return false;
- return true;
- }
- function constructYamlInteger(data) {
- var value = data, sign = 1, ch;
- if (value.indexOf('_') !== -1) {
- value = value.replace(/_/g, '');
- }
- ch = value[0];
- if (ch === '-' || ch === '+') {
- if (ch === '-') sign = -1;
- value = value.slice(1);
- ch = value[0];
- }
- if (value === '0') return 0;
- if (ch === '0') {
- if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
- if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);
- if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);
- }
- return sign * parseInt(value, 10);
- }
- function isInteger(object) {
- return (Object.prototype.toString.call(object)) === '[object Number]' &&
- (object % 1 === 0 && !common.isNegativeZero(object));
- }
- var int = new type('tag:yaml.org,2002:int', {
- kind: 'scalar',
- resolve: resolveYamlInteger,
- construct: constructYamlInteger,
- predicate: isInteger,
- represent: {
- binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
- octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },
- decimal: function (obj) { return obj.toString(10); },
- /* eslint-disable max-len */
- hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
- },
- defaultStyle: 'decimal',
- styleAliases: {
- binary: [ 2, 'bin' ],
- octal: [ 8, 'oct' ],
- decimal: [ 10, 'dec' ],
- hexadecimal: [ 16, 'hex' ]
- }
- });
- var YAML_FLOAT_PATTERN = new RegExp(
- // 2.5e4, 2.5 and integers
- '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
- // .2e4, .2
- // special case, seems not from spec
- '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
- // .inf
- '|[-+]?\\.(?:inf|Inf|INF)' +
- // .nan
- '|\\.(?:nan|NaN|NAN))$');
- function resolveYamlFloat(data) {
- if (data === null) return false;
- if (!YAML_FLOAT_PATTERN.test(data) ||
- // Quick hack to not allow integers end with `_`
- // Probably should update regexp & check speed
- data[data.length - 1] === '_') {
- return false;
- }
- return true;
- }
- function constructYamlFloat(data) {
- var value, sign;
- value = data.replace(/_/g, '').toLowerCase();
- sign = value[0] === '-' ? -1 : 1;
- if ('+-'.indexOf(value[0]) >= 0) {
- value = value.slice(1);
- }
- if (value === '.inf') {
- return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
- } else if (value === '.nan') {
- return NaN;
- }
- return sign * parseFloat(value, 10);
- }
- var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
- function representYamlFloat(object, style) {
- var res;
- if (isNaN(object)) {
- switch (style) {
- case 'lowercase': return '.nan';
- case 'uppercase': return '.NAN';
- case 'camelcase': return '.NaN';
- }
- } else if (Number.POSITIVE_INFINITY === object) {
- switch (style) {
- case 'lowercase': return '.inf';
- case 'uppercase': return '.INF';
- case 'camelcase': return '.Inf';
- }
- } else if (Number.NEGATIVE_INFINITY === object) {
- switch (style) {
- case 'lowercase': return '-.inf';
- case 'uppercase': return '-.INF';
- case 'camelcase': return '-.Inf';
- }
- } else if (common.isNegativeZero(object)) {
- return '-0.0';
- }
- res = object.toString(10);
- // JS stringifier can build scientific format without dots: 5e-100,
- // while YAML requres dot: 5.e-100. Fix it with simple hack
- return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
- }
- function isFloat(object) {
- return (Object.prototype.toString.call(object) === '[object Number]') &&
- (object % 1 !== 0 || common.isNegativeZero(object));
- }
- var float = new type('tag:yaml.org,2002:float', {
- kind: 'scalar',
- resolve: resolveYamlFloat,
- construct: constructYamlFloat,
- predicate: isFloat,
- represent: representYamlFloat,
- defaultStyle: 'lowercase'
- });
- var json = failsafe.extend({
- implicit: [
- _null,
- bool,
- int,
- float
- ]
- });
- var core = json;
- var YAML_DATE_REGEXP = new RegExp(
- '^([0-9][0-9][0-9][0-9])' + // [1] year
- '-([0-9][0-9])' + // [2] month
- '-([0-9][0-9])$'); // [3] day
- var YAML_TIMESTAMP_REGEXP = new RegExp(
- '^([0-9][0-9][0-9][0-9])' + // [1] year
- '-([0-9][0-9]?)' + // [2] month
- '-([0-9][0-9]?)' + // [3] day
- '(?:[Tt]|[ \\t]+)' + // ...
- '([0-9][0-9]?)' + // [4] hour
- ':([0-9][0-9])' + // [5] minute
- ':([0-9][0-9])' + // [6] second
- '(?:\\.([0-9]*))?' + // [7] fraction
- '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
- '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
- function resolveYamlTimestamp(data) {
- if (data === null) return false;
- if (YAML_DATE_REGEXP.exec(data) !== null) return true;
- if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
- return false;
- }
- function constructYamlTimestamp(data) {
- var match, year, month, day, hour, minute, second, fraction = 0,
- delta = null, tz_hour, tz_minute, date;
- match = YAML_DATE_REGEXP.exec(data);
- if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
- if (match === null) throw new Error('Date resolve error');
- // match: [1] year [2] month [3] day
- year = +(match[1]);
- month = +(match[2]) - 1; // JS month starts with 0
- day = +(match[3]);
- if (!match[4]) { // no hour
- return new Date(Date.UTC(year, month, day));
- }
- // match: [4] hour [5] minute [6] second [7] fraction
- hour = +(match[4]);
- minute = +(match[5]);
- second = +(match[6]);
- if (match[7]) {
- fraction = match[7].slice(0, 3);
- while (fraction.length < 3) { // milli-seconds
- fraction += '0';
- }
- fraction = +fraction;
- }
- // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
- if (match[9]) {
- tz_hour = +(match[10]);
- tz_minute = +(match[11] || 0);
- delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
- if (match[9] === '-') delta = -delta;
- }
- date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
- if (delta) date.setTime(date.getTime() - delta);
- return date;
- }
- function representYamlTimestamp(object /*, style*/) {
- return object.toISOString();
- }
- var timestamp = new type('tag:yaml.org,2002:timestamp', {
- kind: 'scalar',
- resolve: resolveYamlTimestamp,
- construct: constructYamlTimestamp,
- instanceOf: Date,
- represent: representYamlTimestamp
- });
- function resolveYamlMerge(data) {
- return data === '<<' || data === null;
- }
- var merge = new type('tag:yaml.org,2002:merge', {
- kind: 'scalar',
- resolve: resolveYamlMerge
- });
- /*eslint-disable no-bitwise*/
- // [ 64, 65, 66 ] -> [ padding, CR, LF ]
- var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
- function resolveYamlBinary(data) {
- if (data === null) return false;
- var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
- // Convert one by one.
- for (idx = 0; idx < max; idx++) {
- code = map.indexOf(data.charAt(idx));
- // Skip CR/LF
- if (code > 64) continue;
- // Fail on illegal characters
- if (code < 0) return false;
- bitlen += 6;
- }
- // If there are any bits left, source was corrupted
- return (bitlen % 8) === 0;
- }
- function constructYamlBinary(data) {
- var idx, tailbits,
- input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
- max = input.length,
- map = BASE64_MAP,
- bits = 0,
- result = [];
- // Collect by 6*4 bits (3 bytes)
- for (idx = 0; idx < max; idx++) {
- if ((idx % 4 === 0) && idx) {
- result.push((bits >> 16) & 0xFF);
- result.push((bits >> 8) & 0xFF);
- result.push(bits & 0xFF);
- }
- bits = (bits << 6) | map.indexOf(input.charAt(idx));
- }
- // Dump tail
- tailbits = (max % 4) * 6;
- if (tailbits === 0) {
- result.push((bits >> 16) & 0xFF);
- result.push((bits >> 8) & 0xFF);
- result.push(bits & 0xFF);
- } else if (tailbits === 18) {
- result.push((bits >> 10) & 0xFF);
- result.push((bits >> 2) & 0xFF);
- } else if (tailbits === 12) {
- result.push((bits >> 4) & 0xFF);
- }
- return new Uint8Array(result);
- }
- function representYamlBinary(object /*, style*/) {
- var result = '', bits = 0, idx, tail,
- max = object.length,
- map = BASE64_MAP;
- // Convert every three bytes to 4 ASCII characters.
- for (idx = 0; idx < max; idx++) {
- if ((idx % 3 === 0) && idx) {
- result += map[(bits >> 18) & 0x3F];
- result += map[(bits >> 12) & 0x3F];
- result += map[(bits >> 6) & 0x3F];
- result += map[bits & 0x3F];
- }
- bits = (bits << 8) + object[idx];
- }
- // Dump tail
- tail = max % 3;
- if (tail === 0) {
- result += map[(bits >> 18) & 0x3F];
- result += map[(bits >> 12) & 0x3F];
- result += map[(bits >> 6) & 0x3F];
- result += map[bits & 0x3F];
- } else if (tail === 2) {
- result += map[(bits >> 10) & 0x3F];
- result += map[(bits >> 4) & 0x3F];
- result += map[(bits << 2) & 0x3F];
- result += map[64];
- } else if (tail === 1) {
- result += map[(bits >> 2) & 0x3F];
- result += map[(bits << 4) & 0x3F];
- result += map[64];
- result += map[64];
- }
- return result;
- }
- function isBinary(obj) {
- return Object.prototype.toString.call(obj) === '[object Uint8Array]';
- }
- var binary = new type('tag:yaml.org,2002:binary', {
- kind: 'scalar',
- resolve: resolveYamlBinary,
- construct: constructYamlBinary,
- predicate: isBinary,
- represent: representYamlBinary
- });
- var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
- var _toString$2 = Object.prototype.toString;
- function resolveYamlOmap(data) {
- if (data === null) return true;
- var objectKeys = [], index, length, pair, pairKey, pairHasKey,
- object = data;
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
- pairHasKey = false;
- if (_toString$2.call(pair) !== '[object Object]') return false;
- for (pairKey in pair) {
- if (_hasOwnProperty$3.call(pair, pairKey)) {
- if (!pairHasKey) pairHasKey = true;
- else return false;
- }
- }
- if (!pairHasKey) return false;
- if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
- else return false;
- }
- return true;
- }
- function constructYamlOmap(data) {
- return data !== null ? data : [];
- }
- var omap = new type('tag:yaml.org,2002:omap', {
- kind: 'sequence',
- resolve: resolveYamlOmap,
- construct: constructYamlOmap
- });
- var _toString$1 = Object.prototype.toString;
- function resolveYamlPairs(data) {
- if (data === null) return true;
- var index, length, pair, keys, result,
- object = data;
- result = new Array(object.length);
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
- if (_toString$1.call(pair) !== '[object Object]') return false;
- keys = Object.keys(pair);
- if (keys.length !== 1) return false;
- result[index] = [ keys[0], pair[keys[0]] ];
- }
- return true;
- }
- function constructYamlPairs(data) {
- if (data === null) return [];
- var index, length, pair, keys, result,
- object = data;
- result = new Array(object.length);
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
- keys = Object.keys(pair);
- result[index] = [ keys[0], pair[keys[0]] ];
- }
- return result;
- }
- var pairs = new type('tag:yaml.org,2002:pairs', {
- kind: 'sequence',
- resolve: resolveYamlPairs,
- construct: constructYamlPairs
- });
- var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
- function resolveYamlSet(data) {
- if (data === null) return true;
- var key, object = data;
- for (key in object) {
- if (_hasOwnProperty$2.call(object, key)) {
- if (object[key] !== null) return false;
- }
- }
- return true;
- }
- function constructYamlSet(data) {
- return data !== null ? data : {};
- }
- var set = new type('tag:yaml.org,2002:set', {
- kind: 'mapping',
- resolve: resolveYamlSet,
- construct: constructYamlSet
- });
- var _default = core.extend({
- implicit: [
- timestamp,
- merge
- ],
- explicit: [
- binary,
- omap,
- pairs,
- set
- ]
- });
- /*eslint-disable max-len,no-use-before-define*/
- var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
- var CONTEXT_FLOW_IN = 1;
- var CONTEXT_FLOW_OUT = 2;
- var CONTEXT_BLOCK_IN = 3;
- var CONTEXT_BLOCK_OUT = 4;
- var CHOMPING_CLIP = 1;
- var CHOMPING_STRIP = 2;
- var CHOMPING_KEEP = 3;
- var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
- var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
- var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
- var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
- var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
- function _class(obj) { return Object.prototype.toString.call(obj); }
- function is_EOL(c) {
- return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
- }
- function is_WHITE_SPACE(c) {
- return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
- }
- function is_WS_OR_EOL(c) {
- return (c === 0x09/* Tab */) ||
- (c === 0x20/* Space */) ||
- (c === 0x0A/* LF */) ||
- (c === 0x0D/* CR */);
- }
- function is_FLOW_INDICATOR(c) {
- return c === 0x2C/* , */ ||
- c === 0x5B/* [ */ ||
- c === 0x5D/* ] */ ||
- c === 0x7B/* { */ ||
- c === 0x7D/* } */;
- }
- function fromHexCode(c) {
- var lc;
- if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
- return c - 0x30;
- }
- /*eslint-disable no-bitwise*/
- lc = c | 0x20;
- if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
- return lc - 0x61 + 10;
- }
- return -1;
- }
- function escapedHexLen(c) {
- if (c === 0x78/* x */) { return 2; }
- if (c === 0x75/* u */) { return 4; }
- if (c === 0x55/* U */) { return 8; }
- return 0;
- }
- function fromDecimalCode(c) {
- if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
- return c - 0x30;
- }
- return -1;
- }
- function simpleEscapeSequence(c) {
- /* eslint-disable indent */
- return (c === 0x30/* 0 */) ? '\x00' :
- (c === 0x61/* a */) ? '\x07' :
- (c === 0x62/* b */) ? '\x08' :
- (c === 0x74/* t */) ? '\x09' :
- (c === 0x09/* Tab */) ? '\x09' :
- (c === 0x6E/* n */) ? '\x0A' :
- (c === 0x76/* v */) ? '\x0B' :
- (c === 0x66/* f */) ? '\x0C' :
- (c === 0x72/* r */) ? '\x0D' :
- (c === 0x65/* e */) ? '\x1B' :
- (c === 0x20/* Space */) ? ' ' :
- (c === 0x22/* " */) ? '\x22' :
- (c === 0x2F/* / */) ? '/' :
- (c === 0x5C/* \ */) ? '\x5C' :
- (c === 0x4E/* N */) ? '\x85' :
- (c === 0x5F/* _ */) ? '\xA0' :
- (c === 0x4C/* L */) ? '\u2028' :
- (c === 0x50/* P */) ? '\u2029' : '';
- }
- function charFromCodepoint(c) {
- if (c <= 0xFFFF) {
- return String.fromCharCode(c);
- }
- // Encode UTF-16 surrogate pair
- // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
- return String.fromCharCode(
- ((c - 0x010000) >> 10) + 0xD800,
- ((c - 0x010000) & 0x03FF) + 0xDC00
- );
- }
- var simpleEscapeCheck = new Array(256); // integer, for fast access
- var simpleEscapeMap = new Array(256);
- for (var i = 0; i < 256; i++) {
- simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
- simpleEscapeMap[i] = simpleEscapeSequence(i);
- }
- function State$1(input, options) {
- this.input = input;
- this.filename = options['filename'] || null;
- this.schema = options['schema'] || _default;
- this.onWarning = options['onWarning'] || null;
- // (Hidden) Remove? makes the loader to expect YAML 1.1 documents
- // if such documents have no explicit %YAML directive
- this.legacy = options['legacy'] || false;
- this.json = options['json'] || false;
- this.listener = options['listener'] || null;
- this.implicitTypes = this.schema.compiledImplicit;
- this.typeMap = this.schema.compiledTypeMap;
- this.length = input.length;
- this.position = 0;
- this.line = 0;
- this.lineStart = 0;
- this.lineIndent = 0;
- // position of first leading tab in the current line,
- // used to make sure there are no tabs in the indentation
- this.firstTabInLine = -1;
- this.documents = [];
- /*
- this.version;
- this.checkLineBreaks;
- this.tagMap;
- this.anchorMap;
- this.tag;
- this.anchor;
- this.kind;
- this.result;*/
- }
- function generateError(state, message) {
- var mark = {
- name: state.filename,
- buffer: state.input.slice(0, -1), // omit trailing \0
- position: state.position,
- line: state.line,
- column: state.position - state.lineStart
- };
- mark.snippet = snippet(mark);
- return new exception(message, mark);
- }
- function throwError(state, message) {
- throw generateError(state, message);
- }
- function throwWarning(state, message) {
- if (state.onWarning) {
- state.onWarning.call(null, generateError(state, message));
- }
- }
- var directiveHandlers = {
- YAML: function handleYamlDirective(state, name, args) {
- var match, major, minor;
- if (state.version !== null) {
- throwError(state, 'duplication of %YAML directive');
- }
- if (args.length !== 1) {
- throwError(state, 'YAML directive accepts exactly one argument');
- }
- match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
- if (match === null) {
- throwError(state, 'ill-formed argument of the YAML directive');
- }
- major = parseInt(match[1], 10);
- minor = parseInt(match[2], 10);
- if (major !== 1) {
- throwError(state, 'unacceptable YAML version of the document');
- }
- state.version = args[0];
- state.checkLineBreaks = (minor < 2);
- if (minor !== 1 && minor !== 2) {
- throwWarning(state, 'unsupported YAML version of the document');
- }
- },
- TAG: function handleTagDirective(state, name, args) {
- var handle, prefix;
- if (args.length !== 2) {
- throwError(state, 'TAG directive accepts exactly two arguments');
- }
- handle = args[0];
- prefix = args[1];
- if (!PATTERN_TAG_HANDLE.test(handle)) {
- throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
- }
- if (_hasOwnProperty$1.call(state.tagMap, handle)) {
- throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
- }
- if (!PATTERN_TAG_URI.test(prefix)) {
- throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
- }
- try {
- prefix = decodeURIComponent(prefix);
- } catch (err) {
- throwError(state, 'tag prefix is malformed: ' + prefix);
- }
- state.tagMap[handle] = prefix;
- }
- };
- function captureSegment(state, start, end, checkJson) {
- var _position, _length, _character, _result;
- if (start < end) {
- _result = state.input.slice(start, end);
- if (checkJson) {
- for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
- _character = _result.charCodeAt(_position);
- if (!(_character === 0x09 ||
- (0x20 <= _character && _character <= 0x10FFFF))) {
- throwError(state, 'expected valid JSON character');
- }
- }
- } else if (PATTERN_NON_PRINTABLE.test(_result)) {
- throwError(state, 'the stream contains non-printable characters');
- }
- state.result += _result;
- }
- }
- function mergeMappings(state, destination, source, overridableKeys) {
- var sourceKeys, key, index, quantity;
- if (!common.isObject(source)) {
- throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
- }
- sourceKeys = Object.keys(source);
- for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
- key = sourceKeys[index];
- if (!_hasOwnProperty$1.call(destination, key)) {
- destination[key] = source[key];
- overridableKeys[key] = true;
- }
- }
- }
- function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,
- startLine, startLineStart, startPos) {
- var index, quantity;
- // The output is a plain object here, so keys can only be strings.
- // We need to convert keyNode to a string, but doing so can hang the process
- // (deeply nested arrays that explode exponentially using aliases).
- if (Array.isArray(keyNode)) {
- keyNode = Array.prototype.slice.call(keyNode);
- for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
- if (Array.isArray(keyNode[index])) {
- throwError(state, 'nested arrays are not supported inside keys');
- }
- if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
- keyNode[index] = '[object Object]';
- }
- }
- }
- // Avoid code execution in load() via toString property
- // (still use its own toString for arrays, timestamps,
- // and whatever user schema extensions happen to have @@toStringTag)
- if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
- keyNode = '[object Object]';
- }
- keyNode = String(keyNode);
- if (_result === null) {
- _result = {};
- }
- if (keyTag === 'tag:yaml.org,2002:merge') {
- if (Array.isArray(valueNode)) {
- for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
- mergeMappings(state, _result, valueNode[index], overridableKeys);
- }
- } else {
- mergeMappings(state, _result, valueNode, overridableKeys);
- }
- } else {
- if (!state.json &&
- !_hasOwnProperty$1.call(overridableKeys, keyNode) &&
- _hasOwnProperty$1.call(_result, keyNode)) {
- state.line = startLine || state.line;
- state.lineStart = startLineStart || state.lineStart;
- state.position = startPos || state.position;
- throwError(state, 'duplicated mapping key');
- }
- // used for this specific key only because Object.defineProperty is slow
- if (keyNode === '__proto__') {
- Object.defineProperty(_result, keyNode, {
- configurable: true,
- enumerable: true,
- writable: true,
- value: valueNode
- });
- } else {
- _result[keyNode] = valueNode;
- }
- delete overridableKeys[keyNode];
- }
- return _result;
- }
- function readLineBreak(state) {
- var ch;
- ch = state.input.charCodeAt(state.position);
- if (ch === 0x0A/* LF */) {
- state.position++;
- } else if (ch === 0x0D/* CR */) {
- state.position++;
- if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
- state.position++;
- }
- } else {
- throwError(state, 'a line break is expected');
- }
- state.line += 1;
- state.lineStart = state.position;
- state.firstTabInLine = -1;
- }
- function skipSeparationSpace(state, allowComments, checkIndent) {
- var lineBreaks = 0,
- ch = state.input.charCodeAt(state.position);
- while (ch !== 0) {
- while (is_WHITE_SPACE(ch)) {
- if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {
- state.firstTabInLine = state.position;
- }
- ch = state.input.charCodeAt(++state.position);
- }
- if (allowComments && ch === 0x23/* # */) {
- do {
- ch = state.input.charCodeAt(++state.position);
- } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
- }
- if (is_EOL(ch)) {
- readLineBreak(state);
- ch = state.input.charCodeAt(state.position);
- lineBreaks++;
- state.lineIndent = 0;
- while (ch === 0x20/* Space */) {
- state.lineIndent++;
- ch = state.input.charCodeAt(++state.position);
- }
- } else {
- break;
- }
- }
- if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
- throwWarning(state, 'deficient indentation');
- }
- return lineBreaks;
- }
- function testDocumentSeparator(state) {
- var _position = state.position,
- ch;
- ch = state.input.charCodeAt(_position);
- // Condition state.position === state.lineStart is tested
- // in parent on each call, for efficiency. No needs to test here again.
- if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
- ch === state.input.charCodeAt(_position + 1) &&
- ch === state.input.charCodeAt(_position + 2)) {
- _position += 3;
- ch = state.input.charCodeAt(_position);
- if (ch === 0 || is_WS_OR_EOL(ch)) {
- return true;
- }
- }
- return false;
- }
- function writeFoldedLines(state, count) {
- if (count === 1) {
- state.result += ' ';
- } else if (count > 1) {
- state.result += common.repeat('\n', count - 1);
- }
- }
- function readPlainScalar(state, nodeIndent, withinFlowCollection) {
- var preceding,
- following,
- captureStart,
- captureEnd,
- hasPendingContent,
- _line,
- _lineStart,
- _lineIndent,
- _kind = state.kind,
- _result = state.result,
- ch;
- ch = state.input.charCodeAt(state.position);
- if (is_WS_OR_EOL(ch) ||
- is_FLOW_INDICATOR(ch) ||
- ch === 0x23/* # */ ||
- ch === 0x26/* & */ ||
- ch === 0x2A/* * */ ||
- ch === 0x21/* ! */ ||
- ch === 0x7C/* | */ ||
- ch === 0x3E/* > */ ||
- ch === 0x27/* ' */ ||
- ch === 0x22/* " */ ||
- ch === 0x25/* % */ ||
- ch === 0x40/* @ */ ||
- ch === 0x60/* ` */) {
- return false;
- }
- if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
- following = state.input.charCodeAt(state.position + 1);
- if (is_WS_OR_EOL(following) ||
- withinFlowCollection && is_FLOW_INDICATOR(following)) {
- return false;
- }
- }
- state.kind = 'scalar';
- state.result = '';
- captureStart = captureEnd = state.position;
- hasPendingContent = false;
- while (ch !== 0) {
- if (ch === 0x3A/* : */) {
- following = state.input.charCodeAt(state.position + 1);
- if (is_WS_OR_EOL(following) ||
- withinFlowCollection && is_FLOW_INDICATOR(following)) {
- break;
- }
- } else if (ch === 0x23/* # */) {
- preceding = state.input.charCodeAt(state.position - 1);
- if (is_WS_OR_EOL(preceding)) {
- break;
- }
- } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
- withinFlowCollection && is_FLOW_INDICATOR(ch)) {
- break;
- } else if (is_EOL(ch)) {
- _line = state.line;
- _lineStart = state.lineStart;
- _lineIndent = state.lineIndent;
- skipSeparationSpace(state, false, -1);
- if (state.lineIndent >= nodeIndent) {
- hasPendingContent = true;
- ch = state.input.charCodeAt(state.position);
- continue;
- } else {
- state.position = captureEnd;
- state.line = _line;
- state.lineStart = _lineStart;
- state.lineIndent = _lineIndent;
- break;
- }
- }
- if (hasPendingContent) {
- captureSegment(state, captureStart, captureEnd, false);
- writeFoldedLines(state, state.line - _line);
- captureStart = captureEnd = state.position;
- hasPendingContent = false;
- }
- if (!is_WHITE_SPACE(ch)) {
- captureEnd = state.position + 1;
- }
- ch = state.input.charCodeAt(++state.position);
- }
- captureSegment(state, captureStart, captureEnd, false);
- if (state.result) {
- return true;
- }
- state.kind = _kind;
- state.result = _result;
- return false;
- }
- function readSingleQuotedScalar(state, nodeIndent) {
- var ch,
- captureStart, captureEnd;
- ch = state.input.charCodeAt(state.position);
- if (ch !== 0x27/* ' */) {
- return false;
- }
- state.kind = 'scalar';
- state.result = '';
- state.position++;
- captureStart = captureEnd = state.position;
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- if (ch === 0x27/* ' */) {
- captureSegment(state, captureStart, state.position, true);
- ch = state.input.charCodeAt(++state.position);
- if (ch === 0x27/* ' */) {
- captureStart = state.position;
- state.position++;
- captureEnd = state.position;
- } else {
- return true;
- }
- } else if (is_EOL(ch)) {
- captureSegment(state, captureStart, captureEnd, true);
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
- captureStart = captureEnd = state.position;
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
- throwError(state, 'unexpected end of the document within a single quoted scalar');
- } else {
- state.position++;
- captureEnd = state.position;
- }
- }
- throwError(state, 'unexpected end of the stream within a single quoted scalar');
- }
- function readDoubleQuotedScalar(state, nodeIndent) {
- var captureStart,
- captureEnd,
- hexLength,
- hexResult,
- tmp,
- ch;
- ch = state.input.charCodeAt(state.position);
- if (ch !== 0x22/* " */) {
- return false;
- }
- state.kind = 'scalar';
- state.result = '';
- state.position++;
- captureStart = captureEnd = state.position;
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- if (ch === 0x22/* " */) {
- captureSegment(state, captureStart, state.position, true);
- state.position++;
- return true;
- } else if (ch === 0x5C/* \ */) {
- captureSegment(state, captureStart, state.position, true);
- ch = state.input.charCodeAt(++state.position);
- if (is_EOL(ch)) {
- skipSeparationSpace(state, false, nodeIndent);
- // TODO: rework to inline fn with no type cast?
- } else if (ch < 256 && simpleEscapeCheck[ch]) {
- state.result += simpleEscapeMap[ch];
- state.position++;
- } else if ((tmp = escapedHexLen(ch)) > 0) {
- hexLength = tmp;
- hexResult = 0;
- for (; hexLength > 0; hexLength--) {
- ch = state.input.charCodeAt(++state.position);
- if ((tmp = fromHexCode(ch)) >= 0) {
- hexResult = (hexResult << 4) + tmp;
- } else {
- throwError(state, 'expected hexadecimal character');
- }
- }
- state.result += charFromCodepoint(hexResult);
- state.position++;
- } else {
- throwError(state, 'unknown escape sequence');
- }
- captureStart = captureEnd = state.position;
- } else if (is_EOL(ch)) {
- captureSegment(state, captureStart, captureEnd, true);
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
- captureStart = captureEnd = state.position;
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
- throwError(state, 'unexpected end of the document within a double quoted scalar');
- } else {
- state.position++;
- captureEnd = state.position;
- }
- }
- throwError(state, 'unexpected end of the stream within a double quoted scalar');
- }
- function readFlowCollection(state, nodeIndent) {
- var readNext = true,
- _line,
- _lineStart,
- _pos,
- _tag = state.tag,
- _result,
- _anchor = state.anchor,
- following,
- terminator,
- isPair,
- isExplicitPair,
- isMapping,
- overridableKeys = Object.create(null),
- keyNode,
- keyTag,
- valueNode,
- ch;
- ch = state.input.charCodeAt(state.position);
- if (ch === 0x5B/* [ */) {
- terminator = 0x5D;/* ] */
- isMapping = false;
- _result = [];
- } else if (ch === 0x7B/* { */) {
- terminator = 0x7D;/* } */
- isMapping = true;
- _result = {};
- } else {
- return false;
- }
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
- }
- ch = state.input.charCodeAt(++state.position);
- while (ch !== 0) {
- skipSeparationSpace(state, true, nodeIndent);
- ch = state.input.charCodeAt(state.position);
- if (ch === terminator) {
- state.position++;
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = isMapping ? 'mapping' : 'sequence';
- state.result = _result;
- return true;
- } else if (!readNext) {
- throwError(state, 'missed comma between flow collection entries');
- } else if (ch === 0x2C/* , */) {
- // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4
- throwError(state, "expected the node content, but found ','");
- }
- keyTag = keyNode = valueNode = null;
- isPair = isExplicitPair = false;
- if (ch === 0x3F/* ? */) {
- following = state.input.charCodeAt(state.position + 1);
- if (is_WS_OR_EOL(following)) {
- isPair = isExplicitPair = true;
- state.position++;
- skipSeparationSpace(state, true, nodeIndent);
- }
- }
- _line = state.line; // Save the current line.
- _lineStart = state.lineStart;
- _pos = state.position;
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
- keyTag = state.tag;
- keyNode = state.result;
- skipSeparationSpace(state, true, nodeIndent);
- ch = state.input.charCodeAt(state.position);
- if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
- isPair = true;
- ch = state.input.charCodeAt(++state.position);
- skipSeparationSpace(state, true, nodeIndent);
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
- valueNode = state.result;
- }
- if (isMapping) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
- } else if (isPair) {
- _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
- } else {
- _result.push(keyNode);
- }
- skipSeparationSpace(state, true, nodeIndent);
- ch = state.input.charCodeAt(state.position);
- if (ch === 0x2C/* , */) {
- readNext = true;
- ch = state.input.charCodeAt(++state.position);
- } else {
- readNext = false;
- }
- }
- throwError(state, 'unexpected end of the stream within a flow collection');
- }
- function readBlockScalar(state, nodeIndent) {
- var captureStart,
- folding,
- chomping = CHOMPING_CLIP,
- didReadContent = false,
- detectedIndent = false,
- textIndent = nodeIndent,
- emptyLines = 0,
- atMoreIndented = false,
- tmp,
- ch;
- ch = state.input.charCodeAt(state.position);
- if (ch === 0x7C/* | */) {
- folding = false;
- } else if (ch === 0x3E/* > */) {
- folding = true;
- } else {
- return false;
- }
- state.kind = 'scalar';
- state.result = '';
- while (ch !== 0) {
- ch = state.input.charCodeAt(++state.position);
- if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
- if (CHOMPING_CLIP === chomping) {
- chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
- } else {
- throwError(state, 'repeat of a chomping mode identifier');
- }
- } else if ((tmp = fromDecimalCode(ch)) >= 0) {
- if (tmp === 0) {
- throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
- } else if (!detectedIndent) {
- textIndent = nodeIndent + tmp - 1;
- detectedIndent = true;
- } else {
- throwError(state, 'repeat of an indentation width identifier');
- }
- } else {
- break;
- }
- }
- if (is_WHITE_SPACE(ch)) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (is_WHITE_SPACE(ch));
- if (ch === 0x23/* # */) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (!is_EOL(ch) && (ch !== 0));
- }
- }
- while (ch !== 0) {
- readLineBreak(state);
- state.lineIndent = 0;
- ch = state.input.charCodeAt(state.position);
- while ((!detectedIndent || state.lineIndent < textIndent) &&
- (ch === 0x20/* Space */)) {
- state.lineIndent++;
- ch = state.input.charCodeAt(++state.position);
- }
- if (!detectedIndent && state.lineIndent > textIndent) {
- textIndent = state.lineIndent;
- }
- if (is_EOL(ch)) {
- emptyLines++;
- continue;
- }
- // End of the scalar.
- if (state.lineIndent < textIndent) {
- // Perform the chomping.
- if (chomping === CHOMPING_KEEP) {
- state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
- } else if (chomping === CHOMPING_CLIP) {
- if (didReadContent) { // i.e. only if the scalar is not empty.
- state.result += '\n';
- }
- }
- // Break this `while` cycle and go to the funciton's epilogue.
- break;
- }
- // Folded style: use fancy rules to handle line breaks.
- if (folding) {
- // Lines starting with white space characters (more-indented lines) are not folded.
- if (is_WHITE_SPACE(ch)) {
- atMoreIndented = true;
- // except for the first content line (cf. Example 8.1)
- state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
- // End of more-indented block.
- } else if (atMoreIndented) {
- atMoreIndented = false;
- state.result += common.repeat('\n', emptyLines + 1);
- // Just one line break - perceive as the same line.
- } else if (emptyLines === 0) {
- if (didReadContent) { // i.e. only if we have already read some scalar content.
- state.result += ' ';
- }
- // Several line breaks - perceive as different lines.
- } else {
- state.result += common.repeat('\n', emptyLines);
- }
- // Literal style: just add exact number of line breaks between content lines.
- } else {
- // Keep all line breaks except the header line break.
- state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
- }
- didReadContent = true;
- detectedIndent = true;
- emptyLines = 0;
- captureStart = state.position;
- while (!is_EOL(ch) && (ch !== 0)) {
- ch = state.input.charCodeAt(++state.position);
- }
- captureSegment(state, captureStart, state.position, false);
- }
- return true;
- }
- function readBlockSequence(state, nodeIndent) {
- var _line,
- _tag = state.tag,
- _anchor = state.anchor,
- _result = [],
- following,
- detected = false,
- ch;
- // there is a leading tab before this token, so it can't be a block sequence/mapping;
- // it can still be flow sequence/mapping or a scalar
- if (state.firstTabInLine !== -1) return false;
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
- }
- ch = state.input.charCodeAt(state.position);
- while (ch !== 0) {
- if (state.firstTabInLine !== -1) {
- state.position = state.firstTabInLine;
- throwError(state, 'tab characters must not be used in indentation');
- }
- if (ch !== 0x2D/* - */) {
- break;
- }
- following = state.input.charCodeAt(state.position + 1);
- if (!is_WS_OR_EOL(following)) {
- break;
- }
- detected = true;
- state.position++;
- if (skipSeparationSpace(state, true, -1)) {
- if (state.lineIndent <= nodeIndent) {
- _result.push(null);
- ch = state.input.charCodeAt(state.position);
- continue;
- }
- }
- _line = state.line;
- composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
- _result.push(state.result);
- skipSeparationSpace(state, true, -1);
- ch = state.input.charCodeAt(state.position);
- if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
- throwError(state, 'bad indentation of a sequence entry');
- } else if (state.lineIndent < nodeIndent) {
- break;
- }
- }
- if (detected) {
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = 'sequence';
- state.result = _result;
- return true;
- }
- return false;
- }
- function readBlockMapping(state, nodeIndent, flowIndent) {
- var following,
- allowCompact,
- _line,
- _keyLine,
- _keyLineStart,
- _keyPos,
- _tag = state.tag,
- _anchor = state.anchor,
- _result = {},
- overridableKeys = Object.create(null),
- keyTag = null,
- keyNode = null,
- valueNode = null,
- atExplicitKey = false,
- detected = false,
- ch;
- // there is a leading tab before this token, so it can't be a block sequence/mapping;
- // it can still be flow sequence/mapping or a scalar
- if (state.firstTabInLine !== -1) return false;
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
- }
- ch = state.input.charCodeAt(state.position);
- while (ch !== 0) {
- if (!atExplicitKey && state.firstTabInLine !== -1) {
- state.position = state.firstTabInLine;
- throwError(state, 'tab characters must not be used in indentation');
- }
- following = state.input.charCodeAt(state.position + 1);
- _line = state.line; // Save the current line.
- //
- // Explicit notation case. There are two separate blocks:
- // first for the key (denoted by "?") and second for the value (denoted by ":")
- //
- if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
- if (ch === 0x3F/* ? */) {
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
- keyTag = keyNode = valueNode = null;
- }
- detected = true;
- atExplicitKey = true;
- allowCompact = true;
- } else if (atExplicitKey) {
- // i.e. 0x3A/* : */ === character after the explicit key.
- atExplicitKey = false;
- allowCompact = true;
- } else {
- throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
- }
- state.position += 1;
- ch = following;
- //
- // Implicit notation case. Flow-style node as the key first, then ":", and the value.
- //
- } else {
- _keyLine = state.line;
- _keyLineStart = state.lineStart;
- _keyPos = state.position;
- if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
- // Neither implicit nor explicit notation.
- // Reading is done. Go to the epilogue.
- break;
- }
- if (state.line === _line) {
- ch = state.input.charCodeAt(state.position);
- while (is_WHITE_SPACE(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
- if (ch === 0x3A/* : */) {
- ch = state.input.charCodeAt(++state.position);
- if (!is_WS_OR_EOL(ch)) {
- throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
- }
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
- keyTag = keyNode = valueNode = null;
- }
- detected = true;
- atExplicitKey = false;
- allowCompact = false;
- keyTag = state.tag;
- keyNode = state.result;
- } else if (detected) {
- throwError(state, 'can not read an implicit mapping pair; a colon is missed');
- } else {
- state.tag = _tag;
- state.anchor = _anchor;
- return true; // Keep the result of `composeNode`.
- }
- } else if (detected) {
- throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
- } else {
- state.tag = _tag;
- state.anchor = _anchor;
- return true; // Keep the result of `composeNode`.
- }
- }
- //
- // Common reading code for both explicit and implicit notations.
- //
- if (state.line === _line || state.lineIndent > nodeIndent) {
- if (atExplicitKey) {
- _keyLine = state.line;
- _keyLineStart = state.lineStart;
- _keyPos = state.position;
- }
- if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
- if (atExplicitKey) {
- keyNode = state.result;
- } else {
- valueNode = state.result;
- }
- }
- if (!atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
- keyTag = keyNode = valueNode = null;
- }
- skipSeparationSpace(state, true, -1);
- ch = state.input.charCodeAt(state.position);
- }
- if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
- throwError(state, 'bad indentation of a mapping entry');
- } else if (state.lineIndent < nodeIndent) {
- break;
- }
- }
- //
- // Epilogue.
- //
- // Special case: last mapping's node contains only the key in explicit notation.
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
- }
- // Expose the resulting mapping.
- if (detected) {
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = 'mapping';
- state.result = _result;
- }
- return detected;
- }
- function readTagProperty(state) {
- var _position,
- isVerbatim = false,
- isNamed = false,
- tagHandle,
- tagName,
- ch;
- ch = state.input.charCodeAt(state.position);
- if (ch !== 0x21/* ! */) return false;
- if (state.tag !== null) {
- throwError(state, 'duplication of a tag property');
- }
- ch = state.input.charCodeAt(++state.position);
- if (ch === 0x3C/* < */) {
- isVerbatim = true;
- ch = state.input.charCodeAt(++state.position);
- } else if (ch === 0x21/* ! */) {
- isNamed = true;
- tagHandle = '!!';
- ch = state.input.charCodeAt(++state.position);
- } else {
- tagHandle = '!';
- }
- _position = state.position;
- if (isVerbatim) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (ch !== 0 && ch !== 0x3E/* > */);
- if (state.position < state.length) {
- tagName = state.input.slice(_position, state.position);
- ch = state.input.charCodeAt(++state.position);
- } else {
- throwError(state, 'unexpected end of the stream within a verbatim tag');
- }
- } else {
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- if (ch === 0x21/* ! */) {
- if (!isNamed) {
- tagHandle = state.input.slice(_position - 1, state.position + 1);
- if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
- throwError(state, 'named tag handle cannot contain such characters');
- }
- isNamed = true;
- _position = state.position + 1;
- } else {
- throwError(state, 'tag suffix cannot contain exclamation marks');
- }
- }
- ch = state.input.charCodeAt(++state.position);
- }
- tagName = state.input.slice(_position, state.position);
- if (PATTERN_FLOW_INDICATORS.test(tagName)) {
- throwError(state, 'tag suffix cannot contain flow indicator characters');
- }
- }
- if (tagName && !PATTERN_TAG_URI.test(tagName)) {
- throwError(state, 'tag name cannot contain such characters: ' + tagName);
- }
- try {
- tagName = decodeURIComponent(tagName);
- } catch (err) {
- throwError(state, 'tag name is malformed: ' + tagName);
- }
- if (isVerbatim) {
- state.tag = tagName;
- } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
- state.tag = state.tagMap[tagHandle] + tagName;
- } else if (tagHandle === '!') {
- state.tag = '!' + tagName;
- } else if (tagHandle === '!!') {
- state.tag = 'tag:yaml.org,2002:' + tagName;
- } else {
- throwError(state, 'undeclared tag handle "' + tagHandle + '"');
- }
- return true;
- }
- function readAnchorProperty(state) {
- var _position,
- ch;
- ch = state.input.charCodeAt(state.position);
- if (ch !== 0x26/* & */) return false;
- if (state.anchor !== null) {
- throwError(state, 'duplication of an anchor property');
- }
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
- if (state.position === _position) {
- throwError(state, 'name of an anchor node must contain at least one character');
- }
- state.anchor = state.input.slice(_position, state.position);
- return true;
- }
- function readAlias(state) {
- var _position, alias,
- ch;
- ch = state.input.charCodeAt(state.position);
- if (ch !== 0x2A/* * */) return false;
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
- if (state.position === _position) {
- throwError(state, 'name of an alias node must contain at least one character');
- }
- alias = state.input.slice(_position, state.position);
- if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
- throwError(state, 'unidentified alias "' + alias + '"');
- }
- state.result = state.anchorMap[alias];
- skipSeparationSpace(state, true, -1);
- return true;
- }
- function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
- var allowBlockStyles,
- allowBlockScalars,
- allowBlockCollections,
- indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
- atNewLine = false,
- hasContent = false,
- typeIndex,
- typeQuantity,
- typeList,
- type,
- flowIndent,
- blockIndent;
- if (state.listener !== null) {
- state.listener('open', state);
- }
- state.tag = null;
- state.anchor = null;
- state.kind = null;
- state.result = null;
- allowBlockStyles = allowBlockScalars = allowBlockCollections =
- CONTEXT_BLOCK_OUT === nodeContext ||
- CONTEXT_BLOCK_IN === nodeContext;
- if (allowToSeek) {
- if (skipSeparationSpace(state, true, -1)) {
- atNewLine = true;
- if (state.lineIndent > parentIndent) {
- indentStatus = 1;
- } else if (state.lineIndent === parentIndent) {
- indentStatus = 0;
- } else if (state.lineIndent < parentIndent) {
- indentStatus = -1;
- }
- }
- }
- if (indentStatus === 1) {
- while (readTagProperty(state) || readAnchorProperty(state)) {
- if (skipSeparationSpace(state, true, -1)) {
- atNewLine = true;
- allowBlockCollections = allowBlockStyles;
- if (state.lineIndent > parentIndent) {
- indentStatus = 1;
- } else if (state.lineIndent === parentIndent) {
- indentStatus = 0;
- } else if (state.lineIndent < parentIndent) {
- indentStatus = -1;
- }
- } else {
- allowBlockCollections = false;
- }
- }
- }
- if (allowBlockCollections) {
- allowBlockCollections = atNewLine || allowCompact;
- }
- if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
- if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
- flowIndent = parentIndent;
- } else {
- flowIndent = parentIndent + 1;
- }
- blockIndent = state.position - state.lineStart;
- if (indentStatus === 1) {
- if (allowBlockCollections &&
- (readBlockSequence(state, blockIndent) ||
- readBlockMapping(state, blockIndent, flowIndent)) ||
- readFlowCollection(state, flowIndent)) {
- hasContent = true;
- } else {
- if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
- readSingleQuotedScalar(state, flowIndent) ||
- readDoubleQuotedScalar(state, flowIndent)) {
- hasContent = true;
- } else if (readAlias(state)) {
- hasContent = true;
- if (state.tag !== null || state.anchor !== null) {
- throwError(state, 'alias node should not have any properties');
- }
- } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
- hasContent = true;
- if (state.tag === null) {
- state.tag = '?';
- }
- }
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
- }
- } else if (indentStatus === 0) {
- // Special case: block sequences are allowed to have same indentation level as the parent.
- // http://www.yaml.org/spec/1.2/spec.html#id2799784
- hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
- }
- }
- if (state.tag === null) {
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
- } else if (state.tag === '?') {
- // Implicit resolving is not allowed for non-scalar types, and '?'
- // non-specific tag is only automatically assigned to plain scalars.
- //
- // We only need to check kind conformity in case user explicitly assigns '?'
- // tag, for example like this: "!<?> [0]"
- //
- if (state.result !== null && state.kind !== 'scalar') {
- throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
- }
- for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
- type = state.implicitTypes[typeIndex];
- if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
- state.result = type.construct(state.result);
- state.tag = type.tag;
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
- break;
- }
- }
- } else if (state.tag !== '!') {
- if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
- type = state.typeMap[state.kind || 'fallback'][state.tag];
- } else {
- // looking for multi type
- type = null;
- typeList = state.typeMap.multi[state.kind || 'fallback'];
- for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
- if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
- type = typeList[typeIndex];
- break;
- }
- }
- }
- if (!type) {
- throwError(state, 'unknown tag !<' + state.tag + '>');
- }
- if (state.result !== null && type.kind !== state.kind) {
- throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
- }
- if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched
- throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
- } else {
- state.result = type.construct(state.result, state.tag);
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
- }
- }
- if (state.listener !== null) {
- state.listener('close', state);
- }
- return state.tag !== null || state.anchor !== null || hasContent;
- }
- function readDocument(state) {
- var documentStart = state.position,
- _position,
- directiveName,
- directiveArgs,
- hasDirectives = false,
- ch;
- state.version = null;
- state.checkLineBreaks = state.legacy;
- state.tagMap = Object.create(null);
- state.anchorMap = Object.create(null);
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- skipSeparationSpace(state, true, -1);
- ch = state.input.charCodeAt(state.position);
- if (state.lineIndent > 0 || ch !== 0x25/* % */) {
- break;
- }
- hasDirectives = true;
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
- directiveName = state.input.slice(_position, state.position);
- directiveArgs = [];
- if (directiveName.length < 1) {
- throwError(state, 'directive name must not be less than one character in length');
- }
- while (ch !== 0) {
- while (is_WHITE_SPACE(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
- if (ch === 0x23/* # */) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (ch !== 0 && !is_EOL(ch));
- break;
- }
- if (is_EOL(ch)) break;
- _position = state.position;
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
- directiveArgs.push(state.input.slice(_position, state.position));
- }
- if (ch !== 0) readLineBreak(state);
- if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
- directiveHandlers[directiveName](state, directiveName, directiveArgs);
- } else {
- throwWarning(state, 'unknown document directive "' + directiveName + '"');
- }
- }
- skipSeparationSpace(state, true, -1);
- if (state.lineIndent === 0 &&
- state.input.charCodeAt(state.position) === 0x2D/* - */ &&
- state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
- state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
- state.position += 3;
- skipSeparationSpace(state, true, -1);
- } else if (hasDirectives) {
- throwError(state, 'directives end mark is expected');
- }
- composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
- skipSeparationSpace(state, true, -1);
- if (state.checkLineBreaks &&
- PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
- throwWarning(state, 'non-ASCII line breaks are interpreted as content');
- }
- state.documents.push(state.result);
- if (state.position === state.lineStart && testDocumentSeparator(state)) {
- if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
- state.position += 3;
- skipSeparationSpace(state, true, -1);
- }
- return;
- }
- if (state.position < (state.length - 1)) {
- throwError(state, 'end of the stream or a document separator is expected');
- } else {
- return;
- }
- }
- function loadDocuments(input, options) {
- input = String(input);
- options = options || {};
- if (input.length !== 0) {
- // Add tailing `\n` if not exists
- if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
- input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
- input += '\n';
- }
- // Strip BOM
- if (input.charCodeAt(0) === 0xFEFF) {
- input = input.slice(1);
- }
- }
- var state = new State$1(input, options);
- var nullpos = input.indexOf('\0');
- if (nullpos !== -1) {
- state.position = nullpos;
- throwError(state, 'null byte is not allowed in input');
- }
- // Use 0 as string terminator. That significantly simplifies bounds check.
- state.input += '\0';
- while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
- state.lineIndent += 1;
- state.position += 1;
- }
- while (state.position < (state.length - 1)) {
- readDocument(state);
- }
- return state.documents;
- }
- function loadAll$1(input, iterator, options) {
- if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
- options = iterator;
- iterator = null;
- }
- var documents = loadDocuments(input, options);
- if (typeof iterator !== 'function') {
- return documents;
- }
- for (var index = 0, length = documents.length; index < length; index += 1) {
- iterator(documents[index]);
- }
- }
- function load$1(input, options) {
- var documents = loadDocuments(input, options);
- if (documents.length === 0) {
- /*eslint-disable no-undefined*/
- return undefined;
- } else if (documents.length === 1) {
- return documents[0];
- }
- throw new exception('expected a single document in the stream, but found more');
- }
- var loadAll_1 = loadAll$1;
- var load_1 = load$1;
- var loader = {
- loadAll: loadAll_1,
- load: load_1
- };
- /*eslint-disable no-use-before-define*/
- var _toString = Object.prototype.toString;
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
- var CHAR_BOM = 0xFEFF;
- var CHAR_TAB = 0x09; /* Tab */
- var CHAR_LINE_FEED = 0x0A; /* LF */
- var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
- var CHAR_SPACE = 0x20; /* Space */
- var CHAR_EXCLAMATION = 0x21; /* ! */
- var CHAR_DOUBLE_QUOTE = 0x22; /* " */
- var CHAR_SHARP = 0x23; /* # */
- var CHAR_PERCENT = 0x25; /* % */
- var CHAR_AMPERSAND = 0x26; /* & */
- var CHAR_SINGLE_QUOTE = 0x27; /* ' */
- var CHAR_ASTERISK = 0x2A; /* * */
- var CHAR_COMMA = 0x2C; /* , */
- var CHAR_MINUS = 0x2D; /* - */
- var CHAR_COLON = 0x3A; /* : */
- var CHAR_EQUALS = 0x3D; /* = */
- var CHAR_GREATER_THAN = 0x3E; /* > */
- var CHAR_QUESTION = 0x3F; /* ? */
- var CHAR_COMMERCIAL_AT = 0x40; /* @ */
- var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
- var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
- var CHAR_GRAVE_ACCENT = 0x60; /* ` */
- var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
- var CHAR_VERTICAL_LINE = 0x7C; /* | */
- var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
- var ESCAPE_SEQUENCES = {};
- ESCAPE_SEQUENCES[0x00] = '\\0';
- ESCAPE_SEQUENCES[0x07] = '\\a';
- ESCAPE_SEQUENCES[0x08] = '\\b';
- ESCAPE_SEQUENCES[0x09] = '\\t';
- ESCAPE_SEQUENCES[0x0A] = '\\n';
- ESCAPE_SEQUENCES[0x0B] = '\\v';
- ESCAPE_SEQUENCES[0x0C] = '\\f';
- ESCAPE_SEQUENCES[0x0D] = '\\r';
- ESCAPE_SEQUENCES[0x1B] = '\\e';
- ESCAPE_SEQUENCES[0x22] = '\\"';
- ESCAPE_SEQUENCES[0x5C] = '\\\\';
- ESCAPE_SEQUENCES[0x85] = '\\N';
- ESCAPE_SEQUENCES[0xA0] = '\\_';
- ESCAPE_SEQUENCES[0x2028] = '\\L';
- ESCAPE_SEQUENCES[0x2029] = '\\P';
- var DEPRECATED_BOOLEANS_SYNTAX = [
- 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
- 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
- ];
- var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
- function compileStyleMap(schema, map) {
- var result, keys, index, length, tag, style, type;
- if (map === null) return {};
- result = {};
- keys = Object.keys(map);
- for (index = 0, length = keys.length; index < length; index += 1) {
- tag = keys[index];
- style = String(map[tag]);
- if (tag.slice(0, 2) === '!!') {
- tag = 'tag:yaml.org,2002:' + tag.slice(2);
- }
- type = schema.compiledTypeMap['fallback'][tag];
- if (type && _hasOwnProperty.call(type.styleAliases, style)) {
- style = type.styleAliases[style];
- }
- result[tag] = style;
- }
- return result;
- }
- function encodeHex(character) {
- var string, handle, length;
- string = character.toString(16).toUpperCase();
- if (character <= 0xFF) {
- handle = 'x';
- length = 2;
- } else if (character <= 0xFFFF) {
- handle = 'u';
- length = 4;
- } else if (character <= 0xFFFFFFFF) {
- handle = 'U';
- length = 8;
- } else {
- throw new exception('code point within a string may not be greater than 0xFFFFFFFF');
- }
- return '\\' + handle + common.repeat('0', length - string.length) + string;
- }
- var QUOTING_TYPE_SINGLE = 1,
- QUOTING_TYPE_DOUBLE = 2;
- function State(options) {
- this.schema = options['schema'] || _default;
- this.indent = Math.max(1, (options['indent'] || 2));
- this.noArrayIndent = options['noArrayIndent'] || false;
- this.skipInvalid = options['skipInvalid'] || false;
- this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
- this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
- this.sortKeys = options['sortKeys'] || false;
- this.lineWidth = options['lineWidth'] || 80;
- this.noRefs = options['noRefs'] || false;
- this.noCompatMode = options['noCompatMode'] || false;
- this.condenseFlow = options['condenseFlow'] || false;
- this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
- this.forceQuotes = options['forceQuotes'] || false;
- this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;
- this.implicitTypes = this.schema.compiledImplicit;
- this.explicitTypes = this.schema.compiledExplicit;
- this.tag = null;
- this.result = '';
- this.duplicates = [];
- this.usedDuplicates = null;
- }
- // Indents every line in a string. Empty lines (\n only) are not indented.
- function indentString(string, spaces) {
- var ind = common.repeat(' ', spaces),
- position = 0,
- next = -1,
- result = '',
- line,
- length = string.length;
- while (position < length) {
- next = string.indexOf('\n', position);
- if (next === -1) {
- line = string.slice(position);
- position = length;
- } else {
- line = string.slice(position, next + 1);
- position = next + 1;
- }
- if (line.length && line !== '\n') result += ind;
- result += line;
- }
- return result;
- }
- function generateNextLine(state, level) {
- return '\n' + common.repeat(' ', state.indent * level);
- }
- function testImplicitResolving(state, str) {
- var index, length, type;
- for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
- type = state.implicitTypes[index];
- if (type.resolve(str)) {
- return true;
- }
- }
- return false;
- }
- // [33] s-white ::= s-space | s-tab
- function isWhitespace(c) {
- return c === CHAR_SPACE || c === CHAR_TAB;
- }
- // Returns true if the character can be printed without escaping.
- // From YAML 1.2: "any allowed characters known to be non-printable
- // should also be escaped. [However,] This isn’t mandatory"
- // Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
- function isPrintable(c) {
- return (0x00020 <= c && c <= 0x00007E)
- || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
- || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)
- || (0x10000 <= c && c <= 0x10FFFF);
- }
- // [34] ns-char ::= nb-char - s-white
- // [27] nb-char ::= c-printable - b-char - c-byte-order-mark
- // [26] b-char ::= b-line-feed | b-carriage-return
- // Including s-white (for some reason, examples doesn't match specs in this aspect)
- // ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark
- function isNsCharOrWhitespace(c) {
- return isPrintable(c)
- && c !== CHAR_BOM
- // - b-char
- && c !== CHAR_CARRIAGE_RETURN
- && c !== CHAR_LINE_FEED;
- }
- // [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out
- // c = flow-in ⇒ ns-plain-safe-in
- // c = block-key ⇒ ns-plain-safe-out
- // c = flow-key ⇒ ns-plain-safe-in
- // [128] ns-plain-safe-out ::= ns-char
- // [129] ns-plain-safe-in ::= ns-char - c-flow-indicator
- // [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )
- // | ( /* An ns-char preceding */ “#” )
- // | ( “:” /* Followed by an ns-plain-safe(c) */ )
- function isPlainSafe(c, prev, inblock) {
- var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
- var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
- return (
- // ns-plain-safe
- inblock ? // c = flow-in
- cIsNsCharOrWhitespace
- : cIsNsCharOrWhitespace
- // - c-flow-indicator
- && c !== CHAR_COMMA
- && c !== CHAR_LEFT_SQUARE_BRACKET
- && c !== CHAR_RIGHT_SQUARE_BRACKET
- && c !== CHAR_LEFT_CURLY_BRACKET
- && c !== CHAR_RIGHT_CURLY_BRACKET
- )
- // ns-plain-char
- && c !== CHAR_SHARP // false on '#'
- && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '
- || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'
- || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'
- }
- // Simplified test for values allowed as the first character in plain style.
- function isPlainSafeFirst(c) {
- // Uses a subset of ns-char - c-indicator
- // where ns-char = nb-char - s-white.
- // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part
- return isPrintable(c) && c !== CHAR_BOM
- && !isWhitespace(c) // - s-white
- // - (c-indicator ::=
- // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
- && c !== CHAR_MINUS
- && c !== CHAR_QUESTION
- && c !== CHAR_COLON
- && c !== CHAR_COMMA
- && c !== CHAR_LEFT_SQUARE_BRACKET
- && c !== CHAR_RIGHT_SQUARE_BRACKET
- && c !== CHAR_LEFT_CURLY_BRACKET
- && c !== CHAR_RIGHT_CURLY_BRACKET
- // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"”
- && c !== CHAR_SHARP
- && c !== CHAR_AMPERSAND
- && c !== CHAR_ASTERISK
- && c !== CHAR_EXCLAMATION
- && c !== CHAR_VERTICAL_LINE
- && c !== CHAR_EQUALS
- && c !== CHAR_GREATER_THAN
- && c !== CHAR_SINGLE_QUOTE
- && c !== CHAR_DOUBLE_QUOTE
- // | “%” | “@” | “`”)
- && c !== CHAR_PERCENT
- && c !== CHAR_COMMERCIAL_AT
- && c !== CHAR_GRAVE_ACCENT;
- }
- // Simplified test for values allowed as the last character in plain style.
- function isPlainSafeLast(c) {
- // just not whitespace or colon, it will be checked to be plain character later
- return !isWhitespace(c) && c !== CHAR_COLON;
- }
- // Same as 'string'.codePointAt(pos), but works in older browsers.
- function codePointAt(string, pos) {
- var first = string.charCodeAt(pos), second;
- if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
- second = string.charCodeAt(pos + 1);
- if (second >= 0xDC00 && second <= 0xDFFF) {
- // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
- return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
- }
- }
- return first;
- }
- // Determines whether block indentation indicator is required.
- function needIndentIndicator(string) {
- var leadingSpaceRe = /^\n* /;
- return leadingSpaceRe.test(string);
- }
- var STYLE_PLAIN = 1,
- STYLE_SINGLE = 2,
- STYLE_LITERAL = 3,
- STYLE_FOLDED = 4,
- STYLE_DOUBLE = 5;
- // Determines which scalar styles are possible and returns the preferred style.
- // lineWidth = -1 => no limit.
- // Pre-conditions: str.length > 0.
- // Post-conditions:
- // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
- // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
- // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
- function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
- testAmbiguousType, quotingType, forceQuotes, inblock) {
- var i;
- var char = 0;
- var prevChar = null;
- var hasLineBreak = false;
- var hasFoldableLine = false; // only checked if shouldTrackWidth
- var shouldTrackWidth = lineWidth !== -1;
- var previousLineBreak = -1; // count the first line correctly
- var plain = isPlainSafeFirst(codePointAt(string, 0))
- && isPlainSafeLast(codePointAt(string, string.length - 1));
- if (singleLineOnly || forceQuotes) {
- // Case: no block styles.
- // Check for disallowed characters to rule out plain and single.
- for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
- char = codePointAt(string, i);
- if (!isPrintable(char)) {
- return STYLE_DOUBLE;
- }
- plain = plain && isPlainSafe(char, prevChar, inblock);
- prevChar = char;
- }
- } else {
- // Case: block styles permitted.
- for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
- char = codePointAt(string, i);
- if (char === CHAR_LINE_FEED) {
- hasLineBreak = true;
- // Check if any line can be folded.
- if (shouldTrackWidth) {
- hasFoldableLine = hasFoldableLine ||
- // Foldable line = too long, and not more-indented.
- (i - previousLineBreak - 1 > lineWidth &&
- string[previousLineBreak + 1] !== ' ');
- previousLineBreak = i;
- }
- } else if (!isPrintable(char)) {
- return STYLE_DOUBLE;
- }
- plain = plain && isPlainSafe(char, prevChar, inblock);
- prevChar = char;
- }
- // in case the end is missing a \n
- hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
- (i - previousLineBreak - 1 > lineWidth &&
- string[previousLineBreak + 1] !== ' '));
- }
- // Although every style can represent \n without escaping, prefer block styles
- // for multiline, since they're more readable and they don't add empty lines.
- // Also prefer folding a super-long line.
- if (!hasLineBreak && !hasFoldableLine) {
- // Strings interpretable as another type have to be quoted;
- // e.g. the string 'true' vs. the boolean true.
- if (plain && !forceQuotes && !testAmbiguousType(string)) {
- return STYLE_PLAIN;
- }
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
- }
- // Edge case: block indentation indicator can only have one digit.
- if (indentPerLevel > 9 && needIndentIndicator(string)) {
- return STYLE_DOUBLE;
- }
- // At this point we know block styles are valid.
- // Prefer literal style unless we want to fold.
- if (!forceQuotes) {
- return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
- }
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
- }
- // Note: line breaking/folding is implemented for only the folded style.
- // NB. We drop the last trailing newline (if any) of a returned block scalar
- // since the dumper adds its own newline. This always works:
- // • No ending newline => unaffected; already using strip "-" chomping.
- // • Ending newline => removed then restored.
- // Importantly, this keeps the "+" chomp indicator from gaining an extra line.
- function writeScalar(state, string, level, iskey, inblock) {
- state.dump = (function () {
- if (string.length === 0) {
- return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
- }
- if (!state.noCompatMode) {
- if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
- return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'");
- }
- }
- var indent = state.indent * Math.max(1, level); // no 0-indent scalars
- // As indentation gets deeper, let the width decrease monotonically
- // to the lower bound min(state.lineWidth, 40).
- // Note that this implies
- // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
- // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
- // This behaves better than a constant minimum width which disallows narrower options,
- // or an indent threshold which causes the width to suddenly increase.
- var lineWidth = state.lineWidth === -1
- ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
- // Without knowing if keys are implicit/explicit, assume implicit for safety.
- var singleLineOnly = iskey
- // No block styles in flow mode.
- || (state.flowLevel > -1 && level >= state.flowLevel);
- function testAmbiguity(string) {
- return testImplicitResolving(state, string);
- }
- switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,
- testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
- case STYLE_PLAIN:
- return string;
- case STYLE_SINGLE:
- return "'" + string.replace(/'/g, "''") + "'";
- case STYLE_LITERAL:
- return '|' + blockHeader(string, state.indent)
- + dropEndingNewline(indentString(string, indent));
- case STYLE_FOLDED:
- return '>' + blockHeader(string, state.indent)
- + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
- case STYLE_DOUBLE:
- return '"' + escapeString(string) + '"';
- default:
- throw new exception('impossible error: invalid scalar style');
- }
- }());
- }
- // Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
- function blockHeader(string, indentPerLevel) {
- var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
- // note the special case: the string '\n' counts as a "trailing" empty line.
- var clip = string[string.length - 1] === '\n';
- var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
- var chomp = keep ? '+' : (clip ? '' : '-');
- return indentIndicator + chomp + '\n';
- }
- // (See the note for writeScalar.)
- function dropEndingNewline(string) {
- return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
- }
- // Note: a long line without a suitable break point will exceed the width limit.
- // Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
- function foldString(string, width) {
- // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
- // unless they're before or after a more-indented line, or at the very
- // beginning or end, in which case $k$ maps to $k$.
- // Therefore, parse each chunk as newline(s) followed by a content line.
- var lineRe = /(\n+)([^\n]*)/g;
- // first line (possibly an empty line)
- var result = (function () {
- var nextLF = string.indexOf('\n');
- nextLF = nextLF !== -1 ? nextLF : string.length;
- lineRe.lastIndex = nextLF;
- return foldLine(string.slice(0, nextLF), width);
- }());
- // If we haven't reached the first content line yet, don't add an extra \n.
- var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
- var moreIndented;
- // rest of the lines
- var match;
- while ((match = lineRe.exec(string))) {
- var prefix = match[1], line = match[2];
- moreIndented = (line[0] === ' ');
- result += prefix
- + (!prevMoreIndented && !moreIndented && line !== ''
- ? '\n' : '')
- + foldLine(line, width);
- prevMoreIndented = moreIndented;
- }
- return result;
- }
- // Greedy line breaking.
- // Picks the longest line under the limit each time,
- // otherwise settles for the shortest line over the limit.
- // NB. More-indented lines *cannot* be folded, as that would add an extra \n.
- function foldLine(line, width) {
- if (line === '' || line[0] === ' ') return line;
- // Since a more-indented line adds a \n, breaks can't be followed by a space.
- var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
- var match;
- // start is an inclusive index. end, curr, and next are exclusive.
- var start = 0, end, curr = 0, next = 0;
- var result = '';
- // Invariants: 0 <= start <= length-1.
- // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
- // Inside the loop:
- // A match implies length >= 2, so curr and next are <= length-2.
- while ((match = breakRe.exec(line))) {
- next = match.index;
- // maintain invariant: curr - start <= width
- if (next - start > width) {
- end = (curr > start) ? curr : next; // derive end <= length-2
- result += '\n' + line.slice(start, end);
- // skip the space that was output as \n
- start = end + 1; // derive start <= length-1
- }
- curr = next;
- }
- // By the invariants, start <= length-1, so there is something left over.
- // It is either the whole string or a part starting from non-whitespace.
- result += '\n';
- // Insert a break if the remainder is too long and there is a break available.
- if (line.length - start > width && curr > start) {
- result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
- } else {
- result += line.slice(start);
- }
- return result.slice(1); // drop extra \n joiner
- }
- // Escapes a double-quoted string.
- function escapeString(string) {
- var result = '';
- var char = 0;
- var escapeSeq;
- for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
- char = codePointAt(string, i);
- escapeSeq = ESCAPE_SEQUENCES[char];
- if (!escapeSeq && isPrintable(char)) {
- result += string[i];
- if (char >= 0x10000) result += string[i + 1];
- } else {
- result += escapeSeq || encodeHex(char);
- }
- }
- return result;
- }
- function writeFlowSequence(state, level, object) {
- var _result = '',
- _tag = state.tag,
- index,
- length,
- value;
- for (index = 0, length = object.length; index < length; index += 1) {
- value = object[index];
- if (state.replacer) {
- value = state.replacer.call(object, String(index), value);
- }
- // Write only valid elements, put null instead of invalid elements.
- if (writeNode(state, level, value, false, false) ||
- (typeof value === 'undefined' &&
- writeNode(state, level, null, false, false))) {
- if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');
- _result += state.dump;
- }
- }
- state.tag = _tag;
- state.dump = '[' + _result + ']';
- }
- function writeBlockSequence(state, level, object, compact) {
- var _result = '',
- _tag = state.tag,
- index,
- length,
- value;
- for (index = 0, length = object.length; index < length; index += 1) {
- value = object[index];
- if (state.replacer) {
- value = state.replacer.call(object, String(index), value);
- }
- // Write only valid elements, put null instead of invalid elements.
- if (writeNode(state, level + 1, value, true, true, false, true) ||
- (typeof value === 'undefined' &&
- writeNode(state, level + 1, null, true, true, false, true))) {
- if (!compact || _result !== '') {
- _result += generateNextLine(state, level);
- }
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- _result += '-';
- } else {
- _result += '- ';
- }
- _result += state.dump;
- }
- }
- state.tag = _tag;
- state.dump = _result || '[]'; // Empty sequence if no valid values.
- }
- function writeFlowMapping(state, level, object) {
- var _result = '',
- _tag = state.tag,
- objectKeyList = Object.keys(object),
- index,
- length,
- objectKey,
- objectValue,
- pairBuffer;
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
- pairBuffer = '';
- if (_result !== '') pairBuffer += ', ';
- if (state.condenseFlow) pairBuffer += '"';
- objectKey = objectKeyList[index];
- objectValue = object[objectKey];
- if (state.replacer) {
- objectValue = state.replacer.call(object, objectKey, objectValue);
- }
- if (!writeNode(state, level, objectKey, false, false)) {
- continue; // Skip this pair because of invalid key;
- }
- if (state.dump.length > 1024) pairBuffer += '? ';
- pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
- if (!writeNode(state, level, objectValue, false, false)) {
- continue; // Skip this pair because of invalid value.
- }
- pairBuffer += state.dump;
- // Both key and value are valid.
- _result += pairBuffer;
- }
- state.tag = _tag;
- state.dump = '{' + _result + '}';
- }
- function writeBlockMapping(state, level, object, compact) {
- var _result = '',
- _tag = state.tag,
- objectKeyList = Object.keys(object),
- index,
- length,
- objectKey,
- objectValue,
- explicitPair,
- pairBuffer;
- // Allow sorting keys so that the output file is deterministic
- if (state.sortKeys === true) {
- // Default sorting
- objectKeyList.sort();
- } else if (typeof state.sortKeys === 'function') {
- // Custom sort function
- objectKeyList.sort(state.sortKeys);
- } else if (state.sortKeys) {
- // Something is wrong
- throw new exception('sortKeys must be a boolean or a function');
- }
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
- pairBuffer = '';
- if (!compact || _result !== '') {
- pairBuffer += generateNextLine(state, level);
- }
- objectKey = objectKeyList[index];
- objectValue = object[objectKey];
- if (state.replacer) {
- objectValue = state.replacer.call(object, objectKey, objectValue);
- }
- if (!writeNode(state, level + 1, objectKey, true, true, true)) {
- continue; // Skip this pair because of invalid key.
- }
- explicitPair = (state.tag !== null && state.tag !== '?') ||
- (state.dump && state.dump.length > 1024);
- if (explicitPair) {
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- pairBuffer += '?';
- } else {
- pairBuffer += '? ';
- }
- }
- pairBuffer += state.dump;
- if (explicitPair) {
- pairBuffer += generateNextLine(state, level);
- }
- if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
- continue; // Skip this pair because of invalid value.
- }
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- pairBuffer += ':';
- } else {
- pairBuffer += ': ';
- }
- pairBuffer += state.dump;
- // Both key and value are valid.
- _result += pairBuffer;
- }
- state.tag = _tag;
- state.dump = _result || '{}'; // Empty mapping if no valid pairs.
- }
- function detectType(state, object, explicit) {
- var _result, typeList, index, length, type, style;
- typeList = explicit ? state.explicitTypes : state.implicitTypes;
- for (index = 0, length = typeList.length; index < length; index += 1) {
- type = typeList[index];
- if ((type.instanceOf || type.predicate) &&
- (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
- (!type.predicate || type.predicate(object))) {
- if (explicit) {
- if (type.multi && type.representName) {
- state.tag = type.representName(object);
- } else {
- state.tag = type.tag;
- }
- } else {
- state.tag = '?';
- }
- if (type.represent) {
- style = state.styleMap[type.tag] || type.defaultStyle;
- if (_toString.call(type.represent) === '[object Function]') {
- _result = type.represent(object, style);
- } else if (_hasOwnProperty.call(type.represent, style)) {
- _result = type.represent[style](object, style);
- } else {
- throw new exception('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
- }
- state.dump = _result;
- }
- return true;
- }
- }
- return false;
- }
- // Serializes `object` and writes it to global `result`.
- // Returns true on success, or false on invalid object.
- //
- function writeNode(state, level, object, block, compact, iskey, isblockseq) {
- state.tag = null;
- state.dump = object;
- if (!detectType(state, object, false)) {
- detectType(state, object, true);
- }
- var type = _toString.call(state.dump);
- var inblock = block;
- var tagStr;
- if (block) {
- block = (state.flowLevel < 0 || state.flowLevel > level);
- }
- var objectOrArray = type === '[object Object]' || type === '[object Array]',
- duplicateIndex,
- duplicate;
- if (objectOrArray) {
- duplicateIndex = state.duplicates.indexOf(object);
- duplicate = duplicateIndex !== -1;
- }
- if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
- compact = false;
- }
- if (duplicate && state.usedDuplicates[duplicateIndex]) {
- state.dump = '*ref_' + duplicateIndex;
- } else {
- if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
- state.usedDuplicates[duplicateIndex] = true;
- }
- if (type === '[object Object]') {
- if (block && (Object.keys(state.dump).length !== 0)) {
- writeBlockMapping(state, level, state.dump, compact);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + state.dump;
- }
- } else {
- writeFlowMapping(state, level, state.dump);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
- }
- }
- } else if (type === '[object Array]') {
- if (block && (state.dump.length !== 0)) {
- if (state.noArrayIndent && !isblockseq && level > 0) {
- writeBlockSequence(state, level - 1, state.dump, compact);
- } else {
- writeBlockSequence(state, level, state.dump, compact);
- }
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + state.dump;
- }
- } else {
- writeFlowSequence(state, level, state.dump);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
- }
- }
- } else if (type === '[object String]') {
- if (state.tag !== '?') {
- writeScalar(state, state.dump, level, iskey, inblock);
- }
- } else if (type === '[object Undefined]') {
- return false;
- } else {
- if (state.skipInvalid) return false;
- throw new exception('unacceptable kind of an object to dump ' + type);
- }
- if (state.tag !== null && state.tag !== '?') {
- // Need to encode all characters except those allowed by the spec:
- //
- // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */
- // [36] ns-hex-digit ::= ns-dec-digit
- // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */
- // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */
- // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-”
- // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#”
- // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,”
- // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]”
- //
- // Also need to encode '!' because it has special meaning (end of tag prefix).
- //
- tagStr = encodeURI(
- state.tag[0] === '!' ? state.tag.slice(1) : state.tag
- ).replace(/!/g, '%21');
- if (state.tag[0] === '!') {
- tagStr = '!' + tagStr;
- } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {
- tagStr = '!!' + tagStr.slice(18);
- } else {
- tagStr = '!<' + tagStr + '>';
- }
- state.dump = tagStr + ' ' + state.dump;
- }
- }
- return true;
- }
- function getDuplicateReferences(object, state) {
- var objects = [],
- duplicatesIndexes = [],
- index,
- length;
- inspectNode(object, objects, duplicatesIndexes);
- for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
- state.duplicates.push(objects[duplicatesIndexes[index]]);
- }
- state.usedDuplicates = new Array(length);
- }
- function inspectNode(object, objects, duplicatesIndexes) {
- var objectKeyList,
- index,
- length;
- if (object !== null && typeof object === 'object') {
- index = objects.indexOf(object);
- if (index !== -1) {
- if (duplicatesIndexes.indexOf(index) === -1) {
- duplicatesIndexes.push(index);
- }
- } else {
- objects.push(object);
- if (Array.isArray(object)) {
- for (index = 0, length = object.length; index < length; index += 1) {
- inspectNode(object[index], objects, duplicatesIndexes);
- }
- } else {
- objectKeyList = Object.keys(object);
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
- inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
- }
- }
- }
- }
- }
- function dump$1(input, options) {
- options = options || {};
- var state = new State(options);
- if (!state.noRefs) getDuplicateReferences(input, state);
- var value = input;
- if (state.replacer) {
- value = state.replacer.call({ '': value }, '', value);
- }
- if (writeNode(state, 0, value, true, true)) return state.dump + '\n';
- return '';
- }
- var dump_1 = dump$1;
- var dumper = {
- dump: dump_1
- };
- function renamed(from, to) {
- return function () {
- throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +
- 'Use yaml.' + to + ' instead, which is now safe by default.');
- };
- }
- var Type = type;
- var Schema = schema;
- var FAILSAFE_SCHEMA = failsafe;
- var JSON_SCHEMA = json;
- var CORE_SCHEMA = core;
- var DEFAULT_SCHEMA = _default;
- var load = loader.load;
- var loadAll = loader.loadAll;
- var dump = dumper.dump;
- var YAMLException = exception;
- // Re-export all types in case user wants to create custom schema
- var types = {
- binary: binary,
- float: float,
- map: map,
- null: _null,
- pairs: pairs,
- set: set,
- timestamp: timestamp,
- bool: bool,
- int: int,
- merge: merge,
- omap: omap,
- seq: seq,
- str: str
- };
- // Removed functions from JS-YAML 3.0.x
- var safeLoad = renamed('safeLoad', 'load');
- var safeLoadAll = renamed('safeLoadAll', 'loadAll');
- var safeDump = renamed('safeDump', 'dump');
- var jsYaml = {
- Type: Type,
- Schema: Schema,
- FAILSAFE_SCHEMA: FAILSAFE_SCHEMA,
- JSON_SCHEMA: JSON_SCHEMA,
- CORE_SCHEMA: CORE_SCHEMA,
- DEFAULT_SCHEMA: DEFAULT_SCHEMA,
- load: load,
- loadAll: loadAll,
- dump: dump,
- YAMLException: YAMLException,
- types: types,
- safeLoad: safeLoad,
- safeLoadAll: safeLoadAll,
- safeDump: safeDump
- };
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (jsYaml);
- /***/ })
- }]);
|